Solved

escaping & and asterisk(*) characters in a batch file

Posted on 2004-09-15
6
2,276 Views
Last Modified: 2006-11-17
Hi All,
I have a dos script that I use to put a file on my ftp site...
it worked allright untill I changed my password and included & and * characters in it.Now I can remove those and make my script work. But I want to know how I can still  use it...can some one please let me know how I can escape such characters

USER userName myPass&*

above is the line that has my password in it(myPass&*)...

thanks allot
0
Comment
Question by:KhalidAli
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 96

Accepted Solution

by:
Lee W, MVP earned 25 total points
ID: 12070547
No idea if this will work, but if you add a ^ before each character...

example:

myPass^&^*

Piping commands through commands in a FOR batch file uses the carrots like that... don't know if it will work here for you.
0
 
LVL 9

Expert Comment

by:DrWarezz
ID: 12077216
Yeah, like leew said; adding the  ^  characters prevents DOS from processing the characters in front as commands, but instead, as char/string items.
So, that really should work.

Points to him :)
[r.D]
0
 
LVL 24

Expert Comment

by:SunBow
ID: 12078933
I'd login attach to server independent of script. Eliminate need to have password for commands.  Odds are good that I'd want to also run other commands, or maybe not, still wanting capability of getting a verfication file listing either for this transmission  or another one.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question