Be aware that the currentScript... command only return the correct path in global script context.
If you use it in scripts that you include you have to store them in gloabl variables to access them.
Lets assume a script foo2.vbs in a subfolder lib
Option Explicit 'Forces the explicit declaration of all the variables in a script.
dim foo2path : foo2path = CurrentScriptPath
dim foo2Script : foo2Script = CurrentScriptName
function Foo2Pathinfo()
dim rv : rv = ""
rv = rv & "foo2 path: " & foo2path & VBCRLF
rv = rv & "foo2 script: " & foo2Script & VBCRLF
rv = rv & "foo2 curr path: " & CurrentScriptPath & VBCRLF
rv = rv & "foo2 curr script: " & CurrentScriptName & VBCRLF
Foo2Pathinfo = rv
end function
And a script using it
Option Explicit
scriptinclude currentscriptpath & "lib\foo2.vbs"
MsgBox "foo1 curr path: " & CurrentScriptPath & VBCRLF &_
"foo1 curr script: " & CurrentScriptName & VBCRLF &_
Foo2Pathinfo()
This will output
foo1 curr path: C:\temp\
foo1 curr script: foo1.vbs
foo2 path: C:\temp\lib\
foo2 script: foo2.vbs
foo2 curr path: C:\temp\
foo2 curr script: foo1.vbs
Where the last lines are potentially not what you expect.