I run below code in vc.
system("@echo off");
system("set a=3");
system("echo %a%");
system("pause");
but it display as ‘%a%’, but I require display as ‘3’.
How Can I make it?
Thanks very much for your help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Create the “tmp.bat” file:
and then call the
The thing is that system() call creates a “clean” environment where the “a” variable has not been set (in the “echo %a%” call).
To convert the sequence of commands into something “executable” one might use some special tool, not the “VC”.
Look for http://www.autoitscript.com/site/autoit/ and similar tools.