This sample code stores the directory path where the script was started in a variable.
It’s usefull because you can move the script wherever you want (even UNC locations) and the paths remains correct.

1
2
3
4
Option Explicit
Dim strSourcePath
strSourcePath = Left(WScript.ScriptFullName,Len(WScript.ScriptFullName) _
 - Len(WScript.ScriptName))

The returned String contains already a trailing slash () so you just have to add the rest of the path or the exe
e.g
strSourcePath & "foo.exe" and not strSourcePath & "\foo.exe"