1.

Solve : How to assign a DOS command to a variable and then execute it??

Answer»

My system is running in Windows XP SP2

In my batch file, I need to ASSIGN a DOS command LIKE copy to a variable.
Later on depending on user input, I will execute the variable which has the correct command.

For example,

set x=copy a.txt b.txt
.
.
.
if some condition is TRUE set x=echo User is right

How do I execute the command in the variable "x"?

PLEASE help.
Thanks.Put %x% on line by itself. Should FIX you right up.

Thanks. That did the trick.



Discussion

No Comment Found