scripting - How to get a prompt for information using a batch file? -
i have .bat file named runrda.bat
contains:
@echo off rda -v %1 -i "c:\me\rda-tools-1.7.0.ra1\input" -o "c:\me\rda-tools-1.7.0.rc1\output"
which can run navigating following folder example:
c:\rda>
and entering command
c:\rda>runrda 848
so batch file takes input number , runs command.
as can see requires step of navigating specific folder c:\rda
before running .bat file. wondering if there way double click open .bat file when cmd opens need enter input number , hit enter, without having navigate mentioned directory, therefore eliminating navigation step.
if can understand target, next code snippet lead solution:
@echo off setlocal set "param=%1" if not defined param set /p "param=please enter input number: " if not defined param goto :donothing pushd c:\rda rda -v %param% -i "c:\me\rda-tools-1.7.0.ra1\input" -o "c:\me\rda-tools-1.7.0.rc1\output" echo done %param% popd goto :donext :donothing echo no input number defined! :donext pause
resources (required reading):