login.cmd file not working

I have a network running Server 2003 Enterprise with about 15 client workstations. There was a login.cmd file that created a network share when users logged onto the domain ( net use s:\\<servername>\APPL). The owner decided he wanted the files in a different place so we created a new network share and adapted the login.cmd file to ( net use s:\<servername>\user%20shared%20folders). Before there were only 5 machines on the domain. Now, as we try to add the remaining 10 computers, the login.cmd file is not creating the network share. I have directed to output of the .cmd file to a log, but when I open it, it is just empty. Any help would be greatly appreciated.
fenski4435IT ConsultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oBdACommented:
Your path is wrong, and you should delete the old mapping first.
Use the following (the 2>&1 will redirect stderr to stdout as well (and stdout is redirected to the log file):



net use S: /delete
net use S: "\\<servername>\user shared folders" >"%Temp%\LogFile.txt" 2>&1

Open in new window

0
fenski4435IT ConsultantAuthor Commented:
This works as long as the folder is named one word (Folders). As soon as I put the spaces in the "user shared folders" it no longer works and I get a failure in the log file which I have attached
logfile.txt
0
oBdACommented:
That's why there are quotes around the path in the example I posted ...
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

fenski4435IT ConsultantAuthor Commented:
So, you are telling me the quotes need to be there?
0
oBdACommented:
Yes. They're required for any command line program when working with paths with spaces in it.
The program (net.exe, in this case) can't read your mind. It breaks the command line into tokens at each space that's not enclosed in quotes.
with a command line like
net use S: \\<servername>\user shared folders
net.exe would read S: as drive letter, \\<servername>\user as share, and have no idea at all what to do with "shared" and "folders", neither being valid options.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fenski4435IT ConsultantAuthor Commented:
Ok. Sorry for being so ignorant. I will try this to make sure it works.
0
fenski4435IT ConsultantAuthor Commented:
Thanks a lot for your help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.