Hello,

how can I get the current path of the running vbs-Script?

Thank You
Joachim

RE: Current Path by RemS

RemS
Tue May 15 06:36:01 CDT 2007

"Joachim Hofmann" wrote:

> Hello,
>
> how can I get the current path of the running vbs-Script?
>
> Thank You
> Joachim
>


scriptPath = Left(WScript.ScriptFullName, _
Len(WScript.ScriptFullName) _
- (Len(WScript.ScriptName)+1) )


wscript.echo "Path of the script file: " & scriptPath & _
vbnewline & _
"Path of the script host: " & WScript.Path


\RemS

RE: Current Path by Irfan

Irfan
Tue May 15 06:56:08 CDT 2007

hi ... if you know the name of your vbs file then this will work... just
enter the name of your file where it says findme.vbs.


Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("findme.vbs")
Wscript.Echo "Absolute path: " & objFSO.GetAbsolutePathName(objFile)
Wscript.Echo "Parent folder: " & objFSO.GetParentFolderName(objFile)
Wscript.Echo "File name: " & objFSO.GetFileName(objFile)
Wscript.Echo "Base name: " & objFSO.GetBaseName(objFile)
Wscript.Echo "Extension name: " & objFSO.GetExtensionName(objFile)


"Joachim Hofmann" wrote:

> Hello,
>
> how can I get the current path of the running vbs-Script?
>
> Thank You
> Joachim
>

Re: Current Path by D

D
Thu May 17 17:43:23 CDT 2007

Hi Joachim,


Dim go_fso
Dim gs_script_spec, gs_script_path, gs_script_name

Set go_fso = CreateObject( "Scripting.FileSystemObject" )

gs_script_spec = Wscript.ScriptFullName
gs_script_path = go_fso.GetParentFolderName( gs_script_spec )
gs_script_name = go_fso.GetBaseName( gs_script_spec )


Regards,
Dave.



"Joachim Hofmann" <speicher@freenet.de> wrote in message
news:%23PA0u3tlHHA.4684@TK2MSFTNGP03.phx.gbl...
> Hello,
>
> how can I get the current path of the running vbs-Script?
>
> Thank You
> Joachim