I have a usb frive with an Install.cmd and a format.cmd
I want to create a batch file to run a cmd on the same flash drive depending on what key is pressed.
below is what I have so far.
set /p f=Type y/n for option:
IF "%f%=="y" Call Install.cmd
IF "%f%=="n" Call format.cmd
am I missing somthing such as an else command?
when ran I get an invalid syntax error when y or n is entered.
Thnaks for the help
y/n option to call another .cmd
Moderator: DosItHelp
-
- Posts: 24
- Joined: 06 May 2014 09:55
- Location: North West Indiana
Re: y/n option to call another .cmd
You are missing quotes that surround %f%
-
- Posts: 24
- Joined: 06 May 2014 09:55
- Location: North West Indiana
Re: y/n option to call another .cmd
Thanks...I can't believe I missed that.
Re: y/n option to call another .cmd
wchristner wrote:Thanks...I can't believe I missed that.
Oh trust me. I have done worse.
Code: Select all
%somvar&
Could not figure it out until someone pointed it out too me.