uncle_ho
asked on
Return physical path in VBScript
I have run into a memory error in a few different circumstances making a FileSystemObject GetParentFolderName call. I think it may be running into problems because I am passing the function a virtual path and not a physical path. Is there a way in VBScript to find the physical path from a virtual one? This is a stand-alone vbs script file (not in an ASP page) so I cannot use Server.MapPath(). Any equivalents that will work in a similar manner?
Thanks.
Thanks.
That is, change the current directory to your virtual one, then call CurrentDirectory() and see what comes back...
ASKER
How can the current directory be changed to the virtual one? The script will be running in a different directory than the one I am referencing via the virtual path. Won't the CurrentDirectory call always return the path of the directory in which the script is running?
Thanks for your ideas.
Thanks for your ideas.
Explain what you mean by a "virtual path" please...
ASKER
Sorry if I wasn't being clear. I need to return a physical path from a UNC path to a virtual directory.
E.g.:
\\server_name\virtual_dir\ some_clien t_folder\ ---> H:\data\some_client_folder \
E.g.:
\\server_name\virtual_dir\
Let me see if I understand you correctly?
You want to get the actual path for a share on the machine that is sharing it out?
You want to get the actual path for a share on the machine that is sharing it out?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I think this will work for me. I have added a where clause to the query to specify the share name I need the physical path for.
Thanks for the help.
Thanks for the help.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/a36f684c-efef-4069-9102-21b3d1d55e9e.asp
Dim WshShell
Set WshShell = WScript.CreateObject("WScr
WScript.Echo WshShell.CurrentDirectory