Can not access the network driver in windows server 2016 in the scheduling task.

jizheng zhang 0 Reputation points


 I have two computers in one local network, they can visit each other using local IP address( and, the system is windows server 2016, for the easy visiting, I added network driver to which in fact mapped to the web address \\,  the network dirver is Z:, so i can visit the share folder in the server 196 just like: Z:/Config/*.csv in my script.  
Such scripts runs correctly when I loggin in the server 197, but the same scripts will report "access failed" when I put them into the scheduled task with high priority, and runs in the mid-night when I not loggin-in.

 So what shall i do to keep the netwok driver connected and accessible anytime?  Thanks a lot!.
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,082 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 43,926 Reputation points
    Hello Jizheng,
    Thank you for your question and for reaching out with your question today.
    When you're running scheduled tasks in Windows Server 2016 that involve accessing network drives, you might encounter issues with network drive mappings if they're not properly set up.  PLease try the following:
    1. Instead of relying on network drive mappings (such as Z:), use UNC (Universal Naming Convention) paths directly in your scripts. UNC paths are less dependent on user sessions and tend to work more reliably in non-interactive contexts.  For example, replace `Z:/Config/*.csv` with `\\\Config\*.csv`.
    2. In the properties of the scheduled task, on the "General" tab, check the "Run with highest privileges" option.
    3. When you map a network drive, use the `/PERSISTENT:YES` switch to ensure that the mapping persists across reboots and non-interactive sessions. For example:
    net use Z: \\\Config /PERSISTENT:YES
    4. Sometimes, network resources might not be fully available immediately after system startup. You can configure the scheduled task to have a delay in execution to give the system more time to establish network connectivity.
    If the reply was helpful, please don’t forget to upvote or accept as answer.
    0 comments No comments

  2. Hania Lian 7,631 Reputation points Microsoft Vendor


    Modify the registry value of EnabledLinkedConnections under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System and set it to 1. This will enable the sharing of network connections between the standard and administrator accounts.

    Best Regards,

    Hania Lian

    0 comments No comments