Solved

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

Posted on 2004-09-15
6
2,066 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now