I have a network drive already mapped. But I want to create a batch file that starts after the startup is complete and reconnect to the mapped network drives.
So far I have seen commands like:
net use Z: \\myserver\folder_name
But I think it maps a network drive. However I have already created a mapped network drive before. I want to connect to it.
Why I am not using reconnect at logon:
I have to connect to a VPN manually. Only after that will I be able to connect to the mapped network drive manually. Hence I am writing a batch file which connects to the mapped network drive, among other things like starting a few essential programs.
System Information:
Windows 7 Enterprise
Added Note:
In the link mentioned above "Can a mapped network drive be reconnected from the command line?" I see a somewhat working solution by Claus Melander. However the part where I am supposed to assign a title to the opened Windows Explorer window does not work. Because the opened window does not have the title I have specified.
REM Reconnect to mapped network drives
REM Y drive
REM Opens an Explorer window looking at Y: forcing a reconnect
start "Y_DRIVE" /MIN explorer Y:\
REM Wait for 5 seconds to allow it to reconnect, Ignore key presses and wait specified time during this time.
TIMEOUT /T 5 /NOBREAK
Taskkill /fi "windowtitle eq Y_DRIVE"
However, If I jump to a sub folder of the mapped drive, the statement to kill the application by filtering based on window title seems to work.
I am looking for a more elegant solution at this point.