A simple Batch File script

If you read this post, that's mean the "End of Days" is a HOAX! Moving on.

The batch file e.g. login.bat to automate the network drives assignment still working in the modern version of Windows Server 2008 or DataCenter. Just to remind me of this simple batch file, here's a simple code. I know you can get something similar if you search the Internet.

== This batch file will set up drive mappings for most user accounts. 

echo  H: \\KINGdotNET\HR
echo  J: \\KINGdotNET\Accounting
echo  M: \\KINGdotNET\Marketing
echo  O: \\KINGdotNET\Operations
echo  P: \\KINGdotNET\Proposal
echo  S: \\KINGdotNET\Shared Data
echo  U: \\KINGdotNET\data\users\%username%

ECHO Now setting the drive mappings for username: %username%

echo on
net use H: "\\KINGdotNET\HR" /persistent:YES
net use J: "\\KINGdotNET\Accounting" /persistent:YES
net use M: "\\KINGdotNET\Marketing" /persistent:YES
net use O: "\\KINGdotNET\Operations" /persistent:YES
net use P: "\\KINGdotNET\Proposal" /persistent:YES
net use S: "\\KINGdotNET\Shared Data" /persistent:YES
net use U: "\\KINGdotNET\data\users\%username%" /persistent:YES

The batch file should be located (saved) in the following folder:
%SystemRoot%\SYSVOL\sysvol\<domain DNS name>\scripts

Then add the login.bat to the user profile.

I hope this help.

If this helped you, please take the time to share this post by sharing using Google+, Facebook, or Twitter.

Post a Comment