Map Network Drive by .bat file
open notepad and type following on the notepad
net use:<\\path to the file>
Example:
net use Z: \\fileserver\my_file
if you have spaces within the path please use double quotations around the path.
net use:"<\\path to the file>"
Example:
net use Z: "\\fileserver\my file"
Then save the notepad as MapDrive.bat
Send the .bat file to the user who want to map the drive. But be sure that he/she has permission to the network shared folder.
if you want to delete network mapped drive using cmd(command prompt) use following command
net use: /delete
Example:
net use Z: /delete
if you want to do it when system bootup put it into "startup" in MS Windows. But remember to add one more line into the .bat file to delete the .bat file after mapped the drive.
please add "del MapDrive.bat " into the end of batch file without quotes.
Hope this will help you.
net use
Example:
net use Z: \\fileserver\my_file
if you have spaces within the path please use double quotations around the path.
net use
Example:
net use Z: "\\fileserver\my file"
Then save the notepad as MapDrive.bat
Send the .bat file to the user who want to map the drive. But be sure that he/she has permission to the network shared folder.
if you want to delete network mapped drive using cmd(command prompt) use following command
net use
Example:
net use Z: /delete
if you want to do it when system bootup put it into "startup" in MS Windows. But remember to add one more line into the .bat file to delete the .bat file after mapped the drive.
please add "del MapDrive.bat " into the end of batch file without quotes.
Hope this will help you.
Comments
Post a Comment