*************************************************
file: currentdir.vbs (wsh sample in vbscript)
autor: (c) g. born
retrieving the current directory
*************************************************
option explicit
wscript.echo "script path: ", getpath(), vbcrlf, _
"current directory: ", currentdir()
wscript.quit terminate script.
function currentdir
dim fso
set fso = wscript.createobject("scripting.filesystemobject")
currentdir = fso.getabsolutepathname(".")
end function
function getpath
retrieve path to the script file
dim path
path = wscript.scriptfullname script file name
getpath = left(path, instrrev(path, "\"))
end function
*** end
