Creating Batch File to Map Network Drive
If you want to save time by creating a batch file that when you click on it it will automatically map the drive for you. Or if the map network drive keep disconnecting every time you restart your computer, then you can put the batch file in the start up folder so that it run every log in.
- Open Notepad
- net use S: \\Network path /persistent:yes (The Network path is the path where you want to mapped to)
- If you want to mapped multiple drive just keep repeating step 2 and 3
- You can add "pause" word at the end of the file to see the results of the batch file
- Click File and select Save As
- Navigate to where you want to save it
- Name it and make sure at the end of the name you add .bat as extension file.
- Click OK
- Now navigate to where you save it and click on it
- A command prompt should appear
- Then Press any key to exit
I'm always add the line: net use S: /DELETE /YES to delete any network parth linked to the letter. (In this case S:)
It should looks something like this:
net use S: /DELETE /YES
net use S: "\\server_name\folder_name" /PERSISTENT:YES
net use R: /DELETE /YES
net use R: "\\server_name\folder_name" /PERSISTENT:YES
net use T: /DELETE /YES
net use T: "\\server_name\folder_name" /PERSISTENT:YES
Example:
(servers name have been removed)
No hay comentarios:
Publicar un comentario