Batch command issue. Quick Question.

...custom / ...custom
April 29, 2009 at 15:57:49
Specs: Windows Vista 64-Bit, 16GBs
I am making a batch file that makes a new batch file and some of the commands I need to get to the other file are "set" commands. In those set commands I'm setting things equal to variables (IN %...%).


echo set 123=%abc%  >>C:\path...\filename.filetype

My result in the file created by the batch file are just simply:

set 123=

Something when I was trying to troubleshoot:

Any variation or placment if "^" doesn't help.

Also, when I type this command into CMD it works like a charm. What's up, anyone have a clue?

See More: Batch command issue. Quick Question.

Report •

April 29, 2009 at 16:39:13
Yep. I abc is not defined you get:

set 123=

in th file

If at first you don't succeed, you're about average.


Report •

April 29, 2009 at 16:59:04
Still, whether or not it is defined doesn't matter. This is because I would like it to be itself (%abc%). A variable that isn defined is itself(which is =[nothing]).

Open CMD >
Type "echo %abc%" >
Hit [Enter] >
CMD will respond "%abc%"

I have tried it while being set, and it makes no differance. But again, I want it to be itself, therefore I shouldn't have to set it to anything.

Report •

April 29, 2009 at 17:35:24
Use double %% to prevent translation:
echo set 123=%%abc%%  >>C:\path...\filename.filetype

Report •

Related Solutions

April 29, 2009 at 17:50:36
Ah, Thank You. I don't know why I didn't think of that. :-)

Report •

Ask Question