/ Published in: DOS Batch
URL: http://www.ss64.com/nt/syntax-args.html
I'm always forgetting the syntax for this, and finding it is hard because the key words apply to so many different uses that aren't this one
Expand |
Embed | Plain Text
Comments
Subscribe to comments
You need to login to post a comment.

Sorry dude, syntax is wrong, copied it, made it one line, replaced foobar.exe with notepad.exe, entered it, got an error message:
%%f was unexpected at this time.
use double percent (%%f) when in batch file, single (%f) when a command line. So for command line use it would be:
for %f in (notepad.exe) do if exist "%~dp$PATH:f" echo %f located at "%~dp$PATH:f"