%~dp0 is the variable you want.
It outputs the drive and path of the batch file.
EX1: C:\mydir\myfile.bat becomes C:\mydir\
%SetupApp% /VERYSILENT /PORTABLE /DIR="%~dp0\wt_portable"
exitWill create a new directory in the directory where you have the
wt_portableand run the
WinaeroTweaker-0.17.0.0-setup.exeto create a portable extraction of all files.
Here’s a MS reference, it works in thing other than Batch; like VBS SCCM, PS, shortcuts too.