# [SOLVED] Shares with spaces!



## richardbruce (Nov 29, 2007)

Okay...my predecessor very kindly created a pile of shared folders with spaces in the names, now I want to script logons for users but I can't get the shares with spaces in their names to map using either NET USE in a batch file or MapNetworkDrive in a VBS script. Any ideas (short of rename the shares please there are WAY too many!)


----------



## loesch8102 (Jun 9, 2007)

*Re: Shares with spaces!*

Surround the share name with quotes.

Example:
net use x: "\\server\share name"
net use /persistent:yes --gotta throw this in there :wink:


----------



## richardbruce (Nov 29, 2007)

*Re: Shares with spaces!*

Cheers, I was trying that but for some weird reason although it works OK from a command prompt it didn't seem to work via a batch file. I'll give it another go!


----------



## alambert (Dec 14, 2007)

*Re: Shares with spaces!*

Assuming the share name matches the user name…

Maybe

net use x: "\\server\%username%"

Alan
http://www.thelamberts.com


----------



## richardbruce (Nov 29, 2007)

*Re: Shares with spaces!*

I must have been having a real off day, it works fine by putting the share in quotes, I though that should work so it did my head in when it didn't (of course I could jus have been typing the share name totally wrong!

Cheers guys


----------

