Windows 10: Can I access a mapped network drive in task scheduler when user is logged off?

Discus and support Can I access a mapped network drive in task scheduler when user is logged off? in Windows 10 Network and Sharing to solve the problem; I have a python script that needs to grab files from a mapped network drive. The script works fine if I run it with the option "Run only when user is... Discussion in 'Windows 10 Network and Sharing' started by Wesley Price, Apr 27, 2022.

  1. Can I access a mapped network drive in task scheduler when user is logged off?


    I have a python script that needs to grab files from a mapped network drive. The script works fine if I run it with the option "Run only when user is logged in", but will not run if the "Run whether user is logged in or not". It won't even work if I try to run it with the highest privileges and select to run only when the user is logged on. I get an error that says the network drive cannot be found. I am getting this error from python, but since it works fine with the other option checked I believe it has something to do with how Windows is running it.Is it impossible to access a network drive

    :)
     
    Wesley Price, Apr 27, 2022
    #1

  2. Task Scheduler Tasks copy file to mapped network drive fails

    JR, the only other thing that springs to mind is to make sure that the scheduled task is being run as the user that is currently logged on. You note that you are doing this, but make sure that the user name is in the form of machine_name\user_name (assuming that you are in a workgroup and not a domain).

    For confirmation, open a command prompt and run the command "whoami". The user name that you specify should look exactly like the output of that command.

    If that user is not logged on when the scheduled task is run, then you may need to add the "net use" command as you noted earlier to establish the connection and map the P: drive.

    - - - Updated - - -

    Here is a sample of what my working task looks like (tested while I am logged on as PYROMANIA\hanness):


    Can I access a mapped network drive in task scheduler when user is logged off? [​IMG]

    Can I access a mapped network drive in task scheduler when user is logged off? [​IMG]

    Can I access a mapped network drive in task scheduler when user is logged off? [​IMG]


    Here are the contents of the actual batch file:

    Code:
     
    hsehestedt, Apr 27, 2022
    #2
  3. Task Scheduler Tasks copy file to mapped network drive fails

    JR, is it possible that when run via task scheduler you don't have task scheduler set to run the task as the currently signed in user? If the task is run under another account, then P: will not be already mapped for that account.

    Sample:


    Can I access a mapped network drive in task scheduler when user is logged off? [​IMG]
     
    hsehestedt, Apr 27, 2022
    #3
  4. jhonnie Win User

    Can I access a mapped network drive in task scheduler when user is logged off?

    Task Scheduler Tasks copy file to mapped network drive fails

    I've read a dozen or so of the posts regarding Task Scheduler issues - so far haven't seen my issue solved.
    Tasks which functioned more-or-less in W7 were saved, then imported to a new PC with a fresh install of W10. They seem to have imported intact. They all call batch files.
    One of the commands in a batch file is to copy a file from the local C: drive to a shared network drive. The drive is already mapped for the logged-on user as "P:".
    If exists c:\userdir\example.dat copy c:\userdir\example.dat p:\example.dat
    I made a new BAT file that only has this command. When I run the bat file manually (double-click) it functions, but if I run the task which calls it, the action fails.
    The Windows account has full privileges on the share (mapped network) drive and admin rights on the PC. What could be stopping the Task Scheduler-invoked bat file command from copying the file?
    Thanks,
    JR
    Windows Version 10.0.17763
     
    jhonnie, Apr 27, 2022
    #4
Thema:

Can I access a mapped network drive in task scheduler when user is logged off?

Loading...
  1. Can I access a mapped network drive in task scheduler when user is logged off? - Similar Threads - access mapped network

  2. Task scheduler - option "user is logged in or not"

    in Windows 10 Customization
    Task scheduler - option "user is logged in or not": Hello there.I have task in task scheduler, that has to run bat file. Bat file is OK, everything does good. I'm local admin and I need that task scheduler runs bat file althouhg I'm logged off. Settings does not work unfortunatelly. I did browse many websites and webforums but...
  3. Task scheduler - option "user is logged in or not"

    in Windows 10 Gaming
    Task scheduler - option "user is logged in or not": Hello there.I have task in task scheduler, that has to run bat file. Bat file is OK, everything does good. I'm local admin and I need that task scheduler runs bat file althouhg I'm logged off. Settings does not work unfortunatelly. I did browse many websites and webforums but...
  4. Task scheduler - option "user is logged in or not"

    in Windows 10 Software and Apps
    Task scheduler - option "user is logged in or not": Hello there.I have task in task scheduler, that has to run bat file. Bat file is OK, everything does good. I'm local admin and I need that task scheduler runs bat file althouhg I'm logged off. Settings does not work unfortunatelly. I did browse many websites and webforums but...
  5. Can I access a mapped network drive in task scheduler when user is logged off?

    in Windows 10 Gaming
    Can I access a mapped network drive in task scheduler when user is logged off?: I have a python script that needs to grab files from a mapped network drive. The script works fine if I run it with the option "Run only when user is logged in", but will not run if the "Run whether user is logged in or not". It won't even work if I try to run it with the...
  6. Can I access a mapped network drive in task scheduler when user is logged off?

    in Windows 10 Software and Apps
    Can I access a mapped network drive in task scheduler when user is logged off?: I have a python script that needs to grab files from a mapped network drive. The script works fine if I run it with the option "Run only when user is logged in", but will not run if the "Run whether user is logged in or not". It won't even work if I try to run it with the...
  7. Network drive mapping disconnect after log off or restart.

    in Windows 10 Network and Sharing
    Network drive mapping disconnect after log off or restart.: I have to remap share drive connections every time I log off or when Windows 10 prompts to install system updates and a reboot.. Is there a remedy not to constantly remap network drives to access data? Thanks to anywone who can asssit....
  8. Task scheduler run as system and logged in user

    in Windows 10 Support
    Task scheduler run as system and logged in user: I have a script which must be run as system in task scheduler. But at the end should be runned an exe file in that script as logged in user withouth username and password. Is that possible? 182571
  9. Task Scheduler Tasks copy file to mapped network drive fails

    in Windows 10 Network and Sharing
    Task Scheduler Tasks copy file to mapped network drive fails: I've read a dozen or so of the posts regarding Task Scheduler issues - so far haven't seen my issue solved. Tasks which functioned more-or-less in W7 were saved, then imported to a new PC with a fresh install of W10. They seem to have imported intact. They all call batch...
  10. Network drive mapped as 'X' can be seen be not accessed

    in Windows 10 Network and Sharing
    Network drive mapped as 'X' can be seen be not accessed: Hello everyone. I work for a small charity and we have three windows 10 PCs that have a small network set up. This is primarily to use one MS Access database over the three machines. If you try and access the database it doesn't work (only on the main PC, not the 2 slave...