Hello,
How can i use VBScript to get the current directory? so if i run test.vbs in C:\data
I want to figure out that I am running in C:\data from test.vbs.
Any ideas?
Thanks
Hello,
How can i use VBScript to get the current directory? so if i run test.vbs in C:\data
I want to figure out that I am running in C:\data from test.vbs.
Any ideas?
Thanks
here you will get some useful script that would get the current directory your script is running from. This is great for referencing other files.
http://leereid.wordpress.com/2008/03...ory-or-folder/
Pretty simple one to follow, it grabs the script name (with path), finds the length, grabs the script name by itself, finds the length, subtracts and you’re left with the path. Too easy, but really useful.
Very good, however this is more simpler:
Set oShell = CreateObject(”WScript.Shell”)
Set ofso = CreateObject(”Scripting.FileSystemObject”)
oShell.CurrentDirectory = oFSO.GetParentFolderName(Wscript.ScriptFullName)
Hi,
Do this:
Dim sCurPath
CurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
I hope this solve your problem.
Bookmarks