I'm using this:
if not "%~0" == %0 echo Interactive!
Explanation: Interactive %0 / %~0 gives the string %0 and %~0 respectivly. So not == it true! From a batch/cmd file %0 gives the Path with "" %~0 without. So the comparision with the extra "" around %~0 is exactly %0.