Re: Getting path...



"Al Dunbar [MS-MVP]" <alan-no-drub-spam@xxxxxxxxxxx> wrote in message
news:OIWzf1OXFHA.3572@xxxxxxxxxxxxxxxxxxxxxxx
>
> "McKirahan" <News@xxxxxxxxxxxxx> wrote in message
> news:joKdnZ3ID5E2MhHfRVn-qw@xxxxxxxxxxxxxx
> > "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
>
> Or:
>
> Dim sPath
> sPath = WScript.ScriptFullName
> sPath = FSO.getFileName(sPath)
> WScript.Echo sPath
>
> /Al

That requires:
Set FSO = CreateObject("Scripting.FileSystemObject")

And it returns the filename not the path.


.



Relevant Pages

  • Re: Reference dynamic filename
    ... Dim sPath As String ... any way to reference this in macros 2, 3, 4, etc without the need to ...
    (microsoft.public.excel.programming)
  • Re: Strange problem with PDW
    ... sSubFolder As String = "\horseshowtime.com") As String ... Dim sPath As String: sPath = Space$ ... If SHGetFolderPath(hWndOwner, lngCSIDL, 0&, SHGFP_TYPE_CURRENT, ...
    (microsoft.public.vb.general.discussion)
  • Re: Strange problem with PDW
    ... sSubFolder As String = "\horseshowtime.com") As String ... Dim sPath As String: sPath = Space$ ... If SHGetFolderPath(hWndOwner, lngCSIDL, 0&, SHGFP_TYPE_CURRENT, ...
    (microsoft.public.vb.general.discussion)
  • Question about type library?
    ... declaration. ... Private Function PathFromPidlAs String ... Dim sPath As String ...
    (microsoft.public.vb.general.discussion)
  • Re: Recognize pipes "|" in when opening a delimited file in Excel
    ... Dim sPath As String ... Dim sFile As String ...
    (microsoft.public.excel.misc)

Loading