Space in commands?

February 9, 2011 at 23:18:16
Specs: Windows 7
I want to put some space in my commands.
Like this:
@echo off
:A
set /P command= What do you want to do?
if /I %command%==ping>yahoo (
ping www.yahoo.com
pause
)

How do I put some space between words with ">".
I tried doing "ping yahoo" but it just closes.
Thanks in advance, eXe


See More: Space in commands?

Report •


#1
February 10, 2011 at 05:49:16
Some special characters has to be escaped so;

Your input have to be: ping^>^yahoo

@echo off
:A
set /P command= What do you want to do?
if /I %command%==ping^>^yahoo (
ping www.yahoo.com
pause
)

Or ..

:A
set /P command= What do you want to do?
if /I "%command%"=="ping yahoo" (
ping www.yahoo.com
pause
)

Regards,


Happy is ONE who says I am an OttoMAN.


Report •
Related Solutions


Ask Question