Re: Getting path...



"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@xxxxxxxxx> wrote in message
news:eK$GAQIXFHA.3996@xxxxxxxxxxxxxxxxxxxxxxx
> Vince <vincent@ wrote:
>
> > hi there!
> >
> > is there a way to get the absolute path of a running wsh script ?
>
> WScript.Echo WScript.ScriptFullName
> Set oFSO = CreateObject("Scripting.FileSystemObject")
> sScriptPath = oFSO.GetParentFolderName(WScript.ScriptFullName)
> WScript.Echo sScriptPath
>
>
> > another question, is it possible to develop graphical interfaces
> > using wsh or we have to migrate to VB?
>
> You could use an Internet Explorer object for the GUI, or switch
> to HTA:
>
>
http://groups.google.co.uk/group/microsoft.public.scripting.wsh/msg/aaf39e1e
72537063?dmode=source&hl=en
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx

Or:

Dim sPath
sPath = WScript.ScriptFullName
sPath = Left(sPath,InStrRev(sPath,"\"))
WScript.Echo sPath


.



Relevant Pages

  • Re: change part of the PATH variable via scripting
    ... >> remotely via scripting and without 3rd party compiled software. ... > oReg.GetExpandedStringValue HKLM, sKeyPathEnv, sValueName, sPath ...
    (microsoft.public.scripting.vbscript)
  • Re: Getting path...
    ... is there a way to get the absolute path of a running wsh script? ... Set oFSO = CreateObjectsScriptPath = oFSO.GetParentFolderNameWScript.Echo sScriptPath ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter/default.mspx. ...
    (microsoft.public.scripting.wsh)
  • Re: Getting path...
    ... is it possible to develop graphical interfaces ... >> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ... > Dim sPath ... > sPath = WScript.ScriptFullName ...
    (microsoft.public.scripting.wsh)
  • Re: mapping drive using VB script
    ... is better for scripting questions... ... ' get user name, to be used in map path ... sUser = oNetwork.UserName ... oNetwork.MapNetworkDrive sDrive, sPath, False, sCredUser, sCredPswd ...
    (microsoft.public.windows.server.general)
  • Re: copy files
    ... is there something in vbscript so i can copy files from a "unknown" Folder to a defined location??? ... Set oFSO = CreateObjectsScriptPath = oFSO.GetParentFolderNameWScript.Echo sScriptPath ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: ...
    (microsoft.public.scripting.vbscript)

Loading