1.

Solve : %1 problem?

Answer»

hello,

i m trying to write a little batch file but i have a problem,
i will try to EXPLAIN it but i m not english so it s gonna be another problem !
well,

batch name: hello.bat

Quote


ECHO you have pressed %1


for the moment it's easy,
so hello.bat world will print " you have pressed world"

but i would like a kind of security showing " you have to write something like hello.bat test " if nothing is wrote after the batch name but i dont know how to do that.

i'm looking for something like

Quote

IF %1 == NULL echo "you have to write something like hello.bat test" else ( echo "you have pressed world %1")


thanks,

regards.

Try this

IF "%1"=="" echo "you have to write something like hello.bat test" else ( echo "you have pressed world %1")

Graham
perfect !!!

thanks a LOT!


Discussion

No Comment Found