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
Solved

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

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

790 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