How To Change a Drive Letter Using a Batch File

Windows XP

Accessing files from a network can be a tedious task, having to open and leaf through hierarchies of folders just to locate a certain program. Creating a drive letter for that specific shared program will make it easier to access on your computer. We can use a batch file to assign a drive letter for that network file or program. A batch file is a text file that uses a ‘.bat’ file name extension and which contains a command that will be read by the ‘Command Prompt’. Read on to learn how to change a drive letter in XP using a batch file.

  1. Create a new batch file and save it on your computer. To create a new batch file, we will be using Notepad. Go to ‘Start’, then ‘Programs’, highlight ‘Accessories’ and click on ‘Notepad’. You can also right click directly on the desktop, choose ‘New’ from the dropdown that will appear, and click on ‘Text Document’. Using save will give it a ‘.txt’ file name extension, and since the batch file has to have a ‘.bat’ file name extension, we will be using ‘Save As’ instead. Go to ‘File’ from Notepad’s menu bar and click ‘Save As’. Indicate the file name and attach ‘.bat’. Under the ‘Save as type’ section, make sure you select ‘All Files’. Hit ‘Save’ once you are done naming the batch file.
  2. Type in the command that will change the drive letters on the Notepad. Key in ‘net use /delete <drive name that will be replaced>’. On the next line type in ‘net use <drive letter you will be using for this mapping> \\<name of the server>\<name of the share>. Go to ‘File’ and click ‘Save’ or simply hit ‘Ctrl+S’ on the keyboard and close the Notepad.
  3. Open the batch file so that Command Prompt can run it and complete the changing of the drive letter. Double click on the Notepad batch file that we have created in Step 2. The ‘DOS’ screen will flash and read the command on the batch file. When it’s done, the DOS screen will disappear.
  4. Double check in My Computer if the drive letter was successfully created. Open ‘My Computer’ and you should be able to see there the drive letter that was specified in Step 2. If it did not work, check the command you typed in the batch file and make sure that everything is in order, including the spelling, and repeat Step 3.

Now that you have successfully designated a drive letter for all shared documents and programs in the network, accessing files will be much easier and faster.


Share this article!

Follow us!

Find more helpful articles: