I nabbed this one from Lifehacker. Instead of having to hard code paths in batch scripts you can use the variable %~dp0 to signify the working directory of the script itself. Now, I usually try not to be a zealot and bash on windows much especially since I started working at a computers that is very windows centric, but damn man! One of windows greatest weaknesses is lack of a really good command line and ‘%~dp0′ is a perfect example of that. Though I will be using that variable in scripts to come
If you use “%~dp0″ (sans quotes) in a batch file, this will point to the batch file’s path. For example :
SET MAC=00:00:00:00:00:00
%~dp0mc-wol.exe %MAC%