This is how I setup my network maps automatically when I log into Windows. It was taken from my previous post on Online Backups for Windows Home Server.
- Open your C: drive (or where ever else you'd like to create the batch file).
- Create a new batch file and call it whatever you like. I went with "mount.bat". You can do this quickly by creating a text file and then changing the extension from .txt to .bat, assuming you have the option switched to see extensions.
- Edit the batch file and add the following code:
echo %date% %time% : "%cd%\mount.bat" >> c:\mount.log
timeout /t 10
echo "Mounting K with \\servername\directoryname" >> c:\mount\mount.log
net use K: \\servername\directoryname /USER:servername\username password /persistent:no >> c:\mount.log 2>&1 2>&1
- You'll want to edit the "echo" and "net use" lines so that they match your server name, directory name and administrator's user name. This is where you specify the exact location of the drives you want to mount.
- Then you'll want to change "password" to the actual password for you administrator user.
- Copy and paste the "echo" line as many times as you'd like to mount as many drives as you'd like. Just remember to repeat the previous steps for each of the lines otherwise you'll be mounting the same drive over and over again!
- Save and close your mount.bat file.
- Create a task in Windows Scheduler (found in C:\Windows\Tasks) to run your new mount.bat file when the computer starts.
- Double click on Add Scheduled Task
- Click next and browse to your mount.bat file and open it
- You can keep the default name of the schedule but set it to run "When my computer starts" and click next.
- Click OK or Apply and when you restart your computer all your drives will be mounted.
That's all there is to it. Now when you log on to your computer you will have a small DOS window pop up and mount your drives. Feel free to change the /t 10 to any amount of time you would like. The lower the value the quicker the DOS window will disappear.