scripting:api:wscript:script-name

ScriptName

Property of IWScript

Returns the file name of the currently running script

Read-Only Property of type BSTR

var sVal = WScript.ScriptName;
sVal = WScript.ScriptName
BSTR sVal;
HRESULT hr = WScript.get_ScriptName(&sVal);