Hi,
Just wondering if there is a way to have input from a command line to a script for when it is run
so say in the batch file there is a SET /P option=select option:
but is there a way that the variable can be set when the script is run so something like:
C:\batfile.bat 2
input variables
Moderator: DosItHelp
Re: input variables
Arguments come in as %1, %2 ... %9.
Perhaps that is what you're looking for:
Either the batch file was called with an argument or the user will be prompted for an input.
Regards
aGerman
Perhaps that is what you're looking for:
Code: Select all
@echo off
if "%~1"=="" (
set /p "option=select option: "
) else (
set "option=%~1"
)
Either the batch file was called with an argument or the user will be prompted for an input.
Regards
aGerman
Re: input variables
WOW worked treat! Thank you.
I have only just started teaching myself but this will help me loads!
Thank you again
I have only just started teaching myself but this will help me loads!
Thank you again