Summary
This short tutorial will get network drives to map quickly.The Tutorial
Start by copying this base script into TextPad (or your text editor of choice):@echo offEdit the "net use" lines to the folder that needs to be mapped. The drive letter, domain, and folder needs set. "/USER %UserName%" doesn't need edited.
cls
echo == Initiating system instance variables...
echo. -- Setting the variables...
set Drives=0
set UserName=
set /P UserName=Username: %=%
echo.
echo. -- Running
:: Here you will need to set each of the drives you want to get setup by this script
:: Edit each SUBDOMAIN, DOMAIN, FOLDER, and the drive letter to your needs.
:: /USER:%UserName% should remain as it is
Set /A Drives+=1
echo. Adding drive %Drives%
net use s: \\SUBDOMAIN1.DOMAIN1.com\FOLDER2 /USER:%UserName%
Set /A Drives+=1
echo. Adding drive %Drives%
net use t: \\SUBDOMAIN2.DOMAIN2.com\FOLDER2 /USER:%UserName%
:: Repeat the above three lines for as many map drives as needed.
echo. -- Cleaning up...
set UserName=
set Drives=
echo. ++ Done.
echo.
pause
The set of three lines "Set, echo, net" may be repeated for as many files as you need.
No comments:
Post a Comment