Skip navigation

JSI Tip 0758. Undocumented IF ELSE.

Windows NT supports the IF test (TrueCommand) ELSE (FalseCommand) syntax.

Pseudo code example:

if "%UserStatus%"=="Helped" (goto ThankYou) else (goto WhyNot)

Other examples:

if not exist c:\boot.ini (@echo don't reboot) else (shutdown.exe)

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish