Batch file to map a drive when the folder name contains spaces

Posted by Santiago on Stack Overflow See other posts from Stack Overflow or by Santiago
Published on 2010-04-12T06:22:23Z Indexed on 2010/04/12 6:33 UTC
Read the original article Hit count: 234

Filed under:
|
|
|
|

I am trying to map a drive using a batch file. I have tried:

net use m: \Server01\myfolder /USER:mynetwork\Administrator "Mypassword" /persistent:yes

It works fine. The problem comes when I try to map a folder with spaces on its name:

net use m: \Server01\my folder /USER:mynetwork\Administrator "Mypassword" /persistent:yes

I have tried using quotes, using myfold~1 but nothing works.

An easy way would be renaming the folder but I have it mapped in more than 300 workstations so is not a very good idea.

PLEASE HELP!!!

© Stack Overflow or respective owner

Related posts about batch

Related posts about map