Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make a batch file run strings as commands?

I want to make a batch file to circumvent some cmd problems on my computer, but for that I need to be able to take String user input and run it as a command.

Basically what I want to be able to do is type in a command when the batch file asks for input, and have the computer run that command, similar to python's os module (class?)

like image 919
pipsqueaker117 Avatar asked Mar 27 '13 12:03

pipsqueaker117


1 Answers

Simply assign the string to a variable, then "execute" the variable as though it was a program

eg

set  myvar=ECHO Hello, World! %myvar% 
like image 87
Magoo Avatar answered Sep 29 '22 02:09

Magoo