Check if Windows batch variable starts with a specific string
to find batch file location use %0
(gives full patch to current batch file) or %CD%
variable which gives local directory
Use the variable substring syntax:
IF "%variable:~0,3%"=="ABC" [...]
If you need the path to the batch file without the batch file name, you can use the variable:
%~dp0
Syntax for this is explained in the help for the for
command, although this variable syntax extends beyond just the for
command syntax.