windows - How to identify user input help (/?) in batch file -
usually in of batch command, uses /?
description or hel of particular command. there way identify user asking entering /?
argument (mybatchfilename /?
)
i have tried if %1==/? goto help
. seems ?
has special meaning in batch command.
any help?
to fix problem, can put quotes (") around if parameters. so:
if "%1" == "/?" goto
this works , fixes problem. working example? here go:
@echo off if "%1" == "/?" goto :main echo no here. echo doing stuff exit /b 1 :help echo file helping you... timeout 1 >nul echo kidding. exit /b 0
Comments
Post a Comment