Solved

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

Posted on 2004-09-15
6
2,229 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Suggested Solutions

Title # Comments Views Activity
Combine multiple text files into one file 4 69
CMD shell elevation.js 4 80
Batch Script for opening the DOS prompt and run a command 9 128
file size 9 58
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

737 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