[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

04/16/2009 at 09:22AM PDT, ID: 24328641
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

set batch file variables containing special characters

Asked by damoncf1234 in MS DOS, Windows Batch Scripting, Automation

Tags: batch file set variables containing special characters

Hello,

I'm working on a set of batch files that automate the "post-workstation imaging" tasks.  Currently, I have a series of 3 batch files --  They are 99% functional -- the issue I'm running into is with users who have special characters in their passwords  (like the & symbol).  I'll use the following lines to prompt the user for their admin credentials:

set /p adun="Type your admin username: DA\"
%gctmp%\conset /ph adpw=Type your admin password:

I then use the %adun% and %adup% variables to query active directory using dsquery/dsget, and later to add machines to the domain using netdom and move them to the correct ou using dsmove.  Of course when I do this, and the user has a special character in their password (like the & ), it cuts off everything from the "&" back.  

I've found if I set a variable using quotes, it works fine, but the variable is being set from the user's input, and short of asking them to "surround your password with quotes if it contains special characters", is there another way to do this?  

Of course, if the user's password doesn't contain any special characters, the scripts run fine, but our passwords must contain at least 2 special characters...

Also, a side-note:  I'm using the conset program to set the adpw variable so the user's passowrd is not echoed back to them (or anyone else looking over their shoulder), but it appears to work the same way as the set command.  

Thanks.
 
[+][-]04/16/09 10:02 AM, ID: 24159888

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS DOS, Windows Batch Scripting, Automation
Tags: batch file set variables containing special characters
Sign Up Now!
Solution Provided By: Qlemo
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04/16/09 09:28 AM, ID: 24159551

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/16/09 09:54 AM, ID: 24159801

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/16/09 10:35 AM, ID: 24160232

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/16/09 10:56 AM, ID: 24160422

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04/16/09 12:53 PM, ID: 24161865

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/16/09 03:27 PM, ID: 24163366

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04/16/09 04:45 PM, ID: 24163873

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091028-EE-VQP-86 - Hierarchy / EE_QW_3_20080625