run time change in .bat file

March 19, 2011 at 22:07:43
Specs: Windows Vista
i want edit .bat file at run time
e.g. if code is like
xcopy c: d:
if user enter e: instant d:
then .bat file code automatically change like
xcopy c: e:
user can give input using combo box
any code in java,C,C++ ?
thanks in adv

See More: run time change in .bat file

Report •


#1
March 20, 2011 at 07:59:30
In a batch script you can prompt the user to enter anything by coding

set /P VarName=Prompt Message

e.g. in the case you posted

set /P ToDrive=Enter Destination Drive^>
xcopy C: %ToDrive%

Obviously it is a good rule to check what is entered to avoid unwanted surprises.

Report •

#2
March 21, 2011 at 02:16:35
i want edit .bat file at run time
e.g. if code is like
xcopy c: d:
if user enter e: instant d:
k: instant c:
then .bat file code automatically change like
xcopy k: e:

Report •
Related Solutions


Ask Question