The special path

Returns the path of the currently running script:

// File: path.w_js (JScript)
var exe  = Window.EngineFullName
var w_js = Window.ScriptName

   var shell=new ActiveXObject("WScript.Shell");
       shell.Popup(exe + "\n" + w_js,0,"Path",16);

   Window.Close(); 
'VBScript
exe  = Window.EngineFullName
w_js = Window.ScriptName

Dim shell
Set shell=CreateObject("WScript.Shell")
    shell.Popup exe & vbCr & w_js,0,"Path",16

Window.Close
Notes:
  1. Run its (double click), Window.ScriptName == Full Path
  2. Run its (from command line: engine.exe path.w_js): Window.ScriptName == Offset Path
content
The new scripting host. It is not wscript.exe!
JScript and VBScript are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.