the 'getpath' command

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hala

    #1

    the 'getpath' command

    hi,

    I am trying to make my vb program find the path of the msn messenger
    application (I want this to be done automatically on which ever computer it
    is downloaded).
    The code I use is returning the wrong path: that of the vb executable
    itself.
    Here's my code:

    Dim fso
    Dim newpath As String
    Set fso = CreateObject("S cripting.FileSy stemObject")
    newpath = fso.GetAbsolute PathName("MSNMS GR.EXE")
    Print newpath 'to check if it's working

    any suggestions?
    Thanks
    Hala


  • Suzette

    #2
    Re: the 'getpath' command

    Perhaps it's because the executable and the messenger are in different
    subdirectories. The problem is GetAbsolutePath Name can only look up or down
    the branch of the directory tree it's starting at. Try changing to the root
    path before looking for messenger.

    Sue

    "hala" <treespecs@yaho o.com> wrote in message
    news:bjt710$bdf $1@charm.magnus .acs.ohio-state.edu...[color=blue]
    > hi,
    >
    > I am trying to make my vb program find the path of the msn messenger
    > application (I want this to be done automatically on which ever computer[/color]
    it[color=blue]
    > is downloaded).
    > The code I use is returning the wrong path: that of the vb[/color]
    executable[color=blue]
    > itself.
    > Here's my code:
    >
    > Dim fso
    > Dim newpath As String
    > Set fso = CreateObject("S cripting.FileSy stemObject")
    > newpath = fso.GetAbsolute PathName("MSNMS GR.EXE")
    > Print newpath 'to check if it's working
    >
    > any suggestions?
    > Thanks
    > Hala
    >
    >[/color]


    Comment

    • Geoff

      #3
      Re: the 'getpath' command

      Regardless of your problem the FSO is out if you want it to work on
      all machines, they could well have the sensible option of scripting
      disabled.
      So you might want to forget the FSO and read the registry yourself for
      the information your after
      HKEY_LOCAL_MACH INE\Software\Mi crosoft\Windows \CurrentVersion \App
      Paths\MSNMSGR.E XE

      Geoff

      "Suzette" <anon@worldnet. att.net> wrote in message news:<-WmdnbfTxu-cqv-iXTWJkQ@comcast .com>...[color=blue]
      > Perhaps it's because the executable and the messenger are in different
      > subdirectories. The problem is GetAbsolutePath Name can only look up or down
      > the branch of the directory tree it's starting at. Try changing to the root
      > path before looking for messenger.
      >
      > Sue
      >
      > "hala" <treespecs@yaho o.com> wrote in message
      > news:bjt710$bdf $1@charm.magnus .acs.ohio-state.edu...[color=green]
      > > hi,
      > >
      > > I am trying to make my vb program find the path of the msn messenger
      > > application (I want this to be done automatically on which ever computer[/color]
      > it[color=green]
      > > is downloaded).
      > > The code I use is returning the wrong path: that of the vb[/color]
      > executable[color=green]
      > > itself.
      > > Here's my code:
      > >
      > > Dim fso
      > > Dim newpath As String
      > > Set fso = CreateObject("S cripting.FileSy stemObject")
      > > newpath = fso.GetAbsolute PathName("MSNMS GR.EXE")
      > > Print newpath 'to check if it's working
      > >
      > > any suggestions?
      > > Thanks
      > > Hala
      > >
      > >[/color][/color]

      Comment

      • Rick Rothstein

        #4
        Re: the 'getpath' command

        > I am trying to make my vb program find the path of the msn messenger[color=blue]
        > application (I want this to be done automatically on which ever computer[/color]
        it[color=blue]
        > is downloaded).
        > The code I use is returning the wrong path: that of the vb[/color]
        executable[color=blue]
        > itself.
        > Here's my code:
        >
        > Dim fso
        > Dim newpath As String
        > Set fso = CreateObject("S cripting.FileSy stemObject")
        > newpath = fso.GetAbsolute PathName("MSNMS GR.EXE")
        > Print newpath 'to check if it's working
        >
        > any suggestions?[/color]

        Are you sure that is the filename you want to search for. I don't use
        Messenger myself, but the executable name seems to be msmsgs.exe on my
        system. (Or is "msn messenger" different than "Messenger" which came with my
        WinXP system?)

        Rick - MVP


        Comment

        Working...