|
| |||||||||
| Tags: current directory, vb script |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| How to make use of VB Script to get Current Directory?
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 |
|
#2
| ||||
| ||||
| Re: How to make use of VB Script to get Current Directory?
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) |
|
#3
| ||||
| ||||
| Re: How to make use of VB Script to get Current Directory?
Hi, Do this: Dim sCurPath CurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".") I hope this solve your problem. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How to make use of VB Script to get Current Directory?" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can I create shell script which find out who the active, current user is? | mANICKAVASAN | Windows Software | 4 | 20-10-2010 12:56 PM |
| Get latest updated file from your Current Working Directory | REDBULL | Software Development | 4 | 10-07-2010 03:38 PM |
| “No item match the current search” for Active Directory printer for some domain users | zillah | Active Directory | 2 | 08-12-2009 07:38 PM |
| Retrieving the current directory in batch | Jacques25 | Software Development | 3 | 16-07-2009 12:36 AM |
| How to get current directory | Scott2580 | Software Development | 3 | 11-10-2008 04:40 PM |