Skip to main content

Batch File for automation.

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 N: \\KINGdotNET\Contracts
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 N: "\\KINGdotNET\Contracts" /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.


Popular posts from this blog

Alternative Social Networks

If you are planning to create your social network e.g. similar to Facebook. Here's a short list of alternative software's:

Open Source and Free​ - Wordpress (Open Source and Free) - (Open Source and Free)Commercial Social Networks software ($299 Stand Alone, $29/mo Cloud) (run with Joomla, need to know CMS) (very expensive, $399 for Standard) (from free to Commercial, I left my networks and they are selling it (I used this before, it's hard to maintain. I moved to NING but left too after it was sold to another company) (I don't recommend using this service, it's hard to export your data when it's time to move)Something to check when selecting your next soc…

Frequent Account Lockout in Active Directory

I have a user in Windows Pro 7, and Windows Server 2003 environment that is frequently account locked out. I tried many different scenarios to resolve this account lockout issue, from resetting his password, changing a new password, remove and re-join the domain, rebooting the workstation and active directory servers.

I tried to use the command prompt utility to run "rundll32.exe keymgrdll, KRShowKeyMgr" (case sensitive) to delete the account in Windows 7 password cache, and still no luck.

Still searching for answer ... Let me know if you encounter a similar issue in Windows Pro 7 and Windows Server 2003.

Continue reading updated post here:

Example of Out of Office Reply for Terminated Employee

This is a sample message that I used for terminated employees, unless HR staff specified a different message.
=== Example for KING.NET Employee === John Doe (employee or consultant) is no longer with KING.NET effective June 1, 2008 (termination date). For matters relating to "Project Name here" please direct your concerns to John Smith at (Manager or Supervisor). For all other matters, please direct your email to Mary Smith HR at
Please call our main office 703-345-6789 if you have other concerns.
Thank you.
=== end of message ===