|
1 | 1 | --- |
2 | 2 | title: Mapped network drive may fail to reconnect in Windows 10, version 1809 |
3 | 3 | description: An article provides a workaround to resolve mapped network drives not working in Windows 10, version 1809. |
4 | | -ms.date: 04/14/2025 |
| 4 | +ms.date: 04/15/2025 |
5 | 5 | manager: dcscontentpm |
6 | 6 | audience: itpro |
7 | 7 | ms.topic: troubleshooting |
@@ -72,48 +72,45 @@ All workarounds should be executed in standard user security context. Executing |
72 | 72 | > [!NOTE] |
73 | 73 | > This workaround works only for the device that has network access at logon. If the device has not established a network connection by the time of logon, the startup script won't automatically reconnect network drives. |
74 | 74 |
|
75 | | -1. Copy the script file (MapDrives.cmd) to the following location: |
76 | | - %ProgramData%\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp |
77 | | -2. Copy the script file (MapDrives.ps1) to the following location: |
78 | | - %SystemDrive%\\Scripts\\ |
79 | | -3. A log file (StartupLog.txt) will be created in the %TEMP%\\ folder. |
80 | | -4. Log off, and then log back on to the device to open the mapped drives. |
| 75 | +1. Copy the script file **MapDrives.cmd** to the following location: |
| 76 | + **%ProgramData%\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp** |
| 77 | +2. Copy the script file **MapDrives.ps1** to the following location: **%SystemDrive%\\Scripts\\**. |
| 78 | +3. A log file **StartupLog.txt** is created in the **%TEMP%\\** folder. |
| 79 | +4. Sign out, and then sign in to the device to open the mapped drives. |
81 | 80 |
|
82 | 81 | #### Workaround 2: Create a scheduled task |
83 | 82 |
|
84 | 83 | > [!NOTE] |
85 | 84 | > A PowerShell window flashes up when the scheduled task runs. |
86 | 85 |
|
87 | | -1. Copy the script file **MapDrives.ps1** to the following location: |
88 | | - **%SystemDrive%\\Scripts\\** |
| 86 | +1. Copy the script file **MapDrives.ps1** to the following location: **%SystemDrive%\\Scripts\\**. |
89 | 87 | 2. In **Task Scheduler**, select **Action** > **Create Task**. |
90 | | -3. On the **General** tab in the **Create Task** dialog box, type a name (such as **Map Network Drives**) and description for the task. |
| 88 | +3. On the **General** tab in the **Create Task** dialog, type a name (such as **Map Network Drives**) and description for the task. |
91 | 89 | 4. Select **Change User or Group**, select a local user or group (such as **LocalComputer\\Users**) and then select **OK**. |
92 | 90 | 5. On the **Triggers** tab, select **New**, and then select **At log on** for the **Begin the task** field. |
93 | 91 | 6. On the **Actions** tab, select **New**, and then select **Start a program** for the **Action** field. |
94 | 92 | 7. Type **Powershell.exe** for the **Program/script** field. |
95 | 93 | 8. In the **Add arguments (optional)** field, type the following: |
96 | 94 | **-windowstyle hidden -command .\\MapDrives.ps1 >> %TEMP%\\StartupLog.txt 2>&1** |
97 | | -9. In the **Start in (optional)** field, type the location (**%SystemDrive%\\Scripts\\**) of the script file. |
| 95 | +9. In the **Start in (optional)** field, type the location of the script file: **%SystemDrive%\\Scripts\\**. |
98 | 96 | 10. On the **Conditions** tab, select the **Start only if the following network connection is available** option, select **Any connection**, and then select **OK**. |
99 | | -11. Log off, and then log back on to the device to run the scheduled task. |
| 97 | +11. Sign out, and then sign in to the device to run the scheduled task. |
100 | 98 |
|
101 | 99 | #### Workaround 3: Create a scheduled task for VPN connection Event ID 20225 |
102 | 100 |
|
103 | 101 | > [!NOTE] |
104 | 102 | > Event ID 20225 indicates that a virtual private network (VPN) connection is successfully established. |
105 | 103 |
|
106 | | -1. Copy the script file **MapDrives.ps1** to the following location: |
107 | | - **%SystemDrive%\\Scripts\\** |
| 104 | +1. Copy the script file **MapDrives.ps1** to the following location: **%SystemDrive%\\Scripts\\**. |
108 | 105 | 2. In **Task Scheduler**, select **Action** > **Create Task**. |
109 | | -3. On the **General** tab in the **Create Task** dialog box, type a name (such as **Map Network Drives**) and description for the task. |
| 106 | +3. On the **General** tab in the **Create Task** dialog, type a name (such as **Map Network Drives**) and description for the task. |
110 | 107 | 4. Select **Change User or Group**, select a local user or group (such as **LocalComputer\\Users**) and then select **OK**. |
111 | 108 | 5. On the **Triggers** tab, select **New**, and then select **On an event** for the **Begin the task** field. |
112 | 109 | 6. Select **Application** from the **Log** dropdown list, type **RasClient** in the **Source** field, and type **20225** in the **Event ID** field. Then, select **OK**. |
113 | 110 | 7. On the **Actions** tab, select **New**, and then select **Start a program** for the **Action** field. |
114 | 111 | 8. Type **Powershell.exe** for the **Program/script** field. |
115 | 112 | 9. In the **Add arguments (optional)** field, type the following: |
116 | 113 | **-windowsstyle hidden -command .\\MapDrives.ps1 >> %TEMP%\\StartupLog.txt 2>&1** |
117 | | -10. In the **Start in (optional)** field, type the location (**%SystemDrive%\\Scripts\\**) of the script file. |
| 114 | +10. In the **Start in (optional)** field, type the location of the script file: **%SystemDrive%\\Scripts\\**. |
118 | 115 | 11. On the **Conditions** tab, select the **Start only if the following network connection is available** option, select **Any connection**, and then select **OK**. |
119 | | -12. Log off, and then log back on to the device to run the scheduled task. |
| 116 | +12. Sign out, and then sign in to the device to run the scheduled task. |
0 commit comments