Last active
December 15, 2018 11:37
-
-
Save kohlerdominik/cc65e9182cc035af4804417708e164bc to your computer and use it in GitHub Desktop.
Reconnect a network from batch. Often this is necessary if you use network drives in a place where you have only wireless access, so when windows initializes the network is not ready yet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: HOW-TO :: | |
:: Copy this file to any directory in your computer | |
:: Adjust drive letter (dletter) and drive path (dpath) | |
:: Create a shortcut to the file | |
:: Change the run mode to minimized in shortcut properties | |
:: If you want to execute in on start: copy it to "shell:startup" (WIN+R) | |
:: Set the drive-letter and drive-path | |
SET dletter=Z: | |
SET dpath=\\192.168.1.1\dkohler | |
:connect | |
:: wait 15 seconds and try to connect | |
timeout /t 15 | |
net use %dletter% %dpath% | |
:: if the drive is not connected, jump back to :connect | |
dir %dletter% || goto connect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment