When I log into a new computer, I don’t like having to do a whole lot of configuration. Net use command is the command line tool for mapping shared drives and printers. You can combined it with a batch script to map shared storage drives and printers. Now you have a really efficient tool at your disposal. Here is a sample of one of my scripts. If you would like to try and make your own batch script to automatically map a shared drive or printer with a click of an icon on your desktop. Open up your notepad app and copy / paste the following script. Once you are done editing the script in notepad app – Save it as a “
- Swap out the placeholder with your share’s IP address (In example:
- If your share has spaces in its name use “
- Add as many shares and printers as you want by adding more
Net Uselines in the script.
Shared Drive Mapping Sample
title S Drive Automatic Mapping.
echo Creating new S: Drive Mapping...
net use S: \\yourserver.local\share
Shared Printer Mapping using Net Use command
echo Mapping YourLocation Printer and Copier...
rundll32 printui.dll PrintUIEntry /in /n \\yourserver.local\PrinterName\
echo Mapping Maintenance Control Printer and Copier...
Net Use LPT1 \\yourserver.local\PrinterName\ /Persistent:Yes