June 10, 2008

WinTask - Getting the Path to Your Script

Command$(0) returns the full path and file name of your script.

So this:
Left$(Command$(0),InstrRev(Command$(0),""))
will extract the path to your script from Command$(0).

See for yourself:
msgbox(Left$(Command$(0),InstrRev(Command$(0),"")))