Solved

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

Posted on 2004-09-15
6
2,124 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
6 Comments
 
LVL 95

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 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