Piping, Pinging, setting the path, echoing.... all the good stuff...
Here's an example of using a batch program to stop an application (CALC.exe in this case) from being run twice on the one machine.
@ECHO Off
IF EXIST C:\%COMPUTERNAME%.txt GOTO RUNNING
ipconfig > C:\%COMPUTERNAME%.txt
ECHO PROGRAM STARTED...
CALC.EXE
ECHO PROGRAM FINISHED
IF EXIST C:\%COMPUTERNAME%.txt DEL C:\%COMPUTERNAME%.txt
GOTO END
:RUNNING
ECHO FILE IS ALREADY RUNNING
:END
This example used the following:
- @
- ECHO
- ENVIRONMENT VARIABLES (%COMPUTERNAME%)
- IF
- EXIST
- GOTO
- REDIRECTION (>)
- DEL
- LABELS (:)