Batch IF Wildcards 1*

March 27, 2015 at 11:21:05
Specs: Windows 64
I am sure this is an easy question or and Impossible one. This is what I want to work.
set /p cmd=-:
if %cmd%==1* goto B1
call %cmd%
goto A1
call "%cmd%"
goto A1

The if statement does not seem to work. I want the batch to call on windows commands if any command does not start with 1 <--- This works.
The second part is, I want the batch to call on custome batch files if the input starts with 1, after the 1 would be the batch file ex: 1Hello World.bat
My if statement does not seem to work. I need help with that.

message edited by J1N5

See More: Batch IF Wildcards 1*

Report •

March 27, 2015 at 23:06:17
[1] Never use the name of an existing command or a reserved word. Including: cmd, dir, copy, aux, prn, con etc

[2] Wildcard if is NG.


M2 Get custom script or take private lessons

Report •

March 28, 2015 at 00:03:38
The only way for this batch file to work as a custome command prompt set /p needs to be cmd if it's Set /p T=-: The windows command won't work as a normal Command prompt. I'm sorry but I need an example for NG.

message edited by J1N5

Report •
Related Solutions

Ask Question