From Which Directory Do NS7 VBScript Tasks Run?
Just a short FYI article.
Being curious about where NS7 VBScript tasks run, I created a simple script to run the following command, which shows the complete path of the running script:
MsgBox(WScript.ScriptFullName)
Notice in the following image that this script ran from the c:\windows\temp\ directory.
I think you are looking at your answer
Your script seems to have fetched the answer for you. With a few lines of code you can easily change the directory if needed. Good find though, I am sure this will answer several admins questions.
You can also get the script directory
You can use the following script to get script full path along with the script directory.
'============================================
Dim ScriptDir
Set fso = CreateObject("Scripting.FileSystemObject")
ScriptDir = fso.GetParentFolderName(WScript.ScriptFullName)
If Right(ScriptDir,1) <> "\" Then ScriptDir = ScriptDir & "\"
MsgBox "Script directory: " & ScriptDir & VbCrLf & "Script full path: " & WScript.ScriptFullName
'============================================
Would you like to reply?
Login or Register to post your comment.