Avatar of SpaceCoastLife
SpaceCoastLife asked on

How to run a logo script?

Attempting to run a logon script in windows 10 which is new territory for me insofar as acceptable characters. For example, the first one runs fine, the 2nd one does not. Why?

Net Use M: \\\video /user:admin AS3145florida   Maps

Net Use M: \\\video /user:admin ^7dUff2*!           Errors
Windows Networking

Avatar of undefined
Last Comment
Steve Knight

8/22/2022 - Mon

because the 2nd one having invalid symbols that are not acceptable at Windows command line due to history reason.

i know the actual password might be correct, but the ^, *,  and ! symbols can't be accepted here.

you have to change the password if you do need to use command line to map the drive here. :-)

are those 3 the only ones I need to change?

yes, letters and numbers are all acceptable.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes

Really? There are no allowable special characters in windows?

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

ahhh. Makes sense. Thanks for the help.

thanks for accepting my answer.

sorry for the typos as i was typing the message using my phone, but i guess you did get what i meant. :-)
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.

Sorry, but that answer is incorrect.
These characters may be invalid for a filename, but not for a password.
The issue here is that the caret ^ is the escape character in Batch, so the string that's actually passed to net.exe as password is "7dUff2*!".
All you have to do is enclose the argument in double quotes:
net.exe use M: \\\video /user:admin "^7dUff2*!"

Open in new window


thanks for correcting me oBdA.

i just tested, yes, using double quotes: is the way to enter a password with symbols.

hence the old DOS limitation doesn't apply here for passwords in a Command Prompt window in Windows, though the other DOS limitation may still apply e.g. special device names such as CON or PRN can't be used as a file name.
Steve Knight

And to add another comment here.... seriously, passwords in plain text in a batch file login script that by definition anyone can read and even see scroll over their screen?!!!!  I presume maybe pointing at a simple NAS share that isn't integrated with your AD?

If you really can't use AD accounts, I would suggest getting credentials added as one-off to the user's profiles e.g.

cmdkey /add:\\server\share /user:username /pass:password

then can map the drive using the saved credentials with

net use n: \\server\share

or if you really have to storing the password partially hidden as part of the batch file using ADS -- this is still readable if you know how:  http://scripts.dragon-it.co.uk/links/batch-password1

Your help has saved me hundreds of hours of internet surfing.