Windows Vista Forums

Re: Get display name of execuatable
  1. #1


    Auric__ Guest

    Re: Get display name of execuatable

    On Wed, 27 Jan 2010 13:31:35 GMT, Mark wrote:

    > Suppose that I have an executable, word.exe, which isn't currently
    > running. I know the path to the executable, C:\Applications\word.exe for
    > example.
    >
    > Now I would like to know the name of this exectuable, as it is displayed
    > in the start menu and in application lists and windows, i.e. Microsoft
    > Word.
    >
    > How could I do this with VBScript? I have been searching the 'net, but
    > haven't found an answer yet.
    The start menu is just a bunch of shortcuts. Their names are arbitrary. Aside
    from inspecting the .lnk file, you can't associate its name with the app. For
    instance, Word is installed on the start menu as "Microsoft Word", but I
    rename it to just "Word".

    (As for the rest, I dunno. Someone else might.)

    --
    Crazy, but that's how it goes.



      My System SpecsSystem Spec

  2. #2


    mayayana Guest

    Re: Get display name of execuatable

    Strange. I see your response but I don't
    see the original post.

    To the OP:

    As Auric_ said, there isn't any standard. You can
    enumerate the .lnk files in the Start Menu to match
    the file name with the target path.

    You can enumerate the Registry key:
    HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall
    and *try* to match the DisplayName value with the
    parent folder in the uninstall string, but that's somewhat
    far-fetched.

    You can enumerate open windows to get title bar text,
    but for that the program must be open, and most programs
    have changeable title bar text. (For instance, IE will typically
    show "Microsoft Internet Explorer" plus the current location,
    which changes. But even the first part can be eliminated. If
    you clandestinely opened IE on my PC in order to get the
    title text you'd get "about:blank", because I erased the
    title bar Registry setting and use a blank page for the
    homepage.)

    There just isn't any list anywhere. If it were me I think
    I'd try the following: Walk the Start Menu and match file
    names to targets. As a secondary method, taking the
    path of the executable, find "Program Files". Then take the
    name of the next folder down. That method won't always
    work, but it's not bad. Most software uses a descriptive,
    relevant folder name. (But not all. I think Adobe, for
    instance, puts all of their software in a folder named "Adobe")

    >

    > > Suppose that I have an executable, word.exe, which isn't currently
    > > running. I know the path to the executable, C:\Applications\word.exe for
    > > example.
    > >
    > > Now I would like to know the name of this exectuable, as it is displayed
    > > in the start menu and in application lists and windows, i.e. Microsoft
    > > Word.
    > >
    > > How could I do this with VBScript? I have been searching the 'net, but
    > > haven't found an answer yet.
    >
    > The start menu is just a bunch of shortcuts. Their names are arbitrary.
    Aside

    > from inspecting the .lnk file, you can't associate its name with the app.
    For

    > instance, Word is installed on the start menu as "Microsoft Word", but I
    > rename it to just "Word".
    >
    > (As for the rest, I dunno. Someone else might.)
    >
    > --
    > Crazy, but that's how it goes.


      My System SpecsSystem Spec

  3. #3


    Csaba Gabor Guest

    Re: Get display name of execuatable

    On Jan 27, 3:53 pm, "mayayana" <mayaXXy...@newsgroup> wrote:

    > Strange. I see your response but I don't
    > see the original post.
    >
    > To the OP:
    >
    > As Auric_ said, there isn't any standard. You can
    > enumerate the .lnk files in the Start Menu to match
    > the file name with the target path.
    >
    > You can enumerate the Registry key:
    > HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall
    > and *try* to match the DisplayName value with the
    > parent folder in the uninstall string, but that's somewhat
    > far-fetched.
    >
    > You can enumerate open windows
    How exactly would you enumerate the open windows from
    VBScript, which the OP listed as a requirement (at the end
    of this post). All I can think of by way of window enumeration
    is enumerating all IE/Explorer windows through
    CreateObject("Shell.Application").windows.

    And of just as must interest would be... Is there any way
    to enumerate all COM objects? Or even all COM objects of
    a given type (such as Excel.Application)?

    > to get title bar text,
    > but for that the program must be open, and most programs
    > have changeable title bar text. (For instance, IE will typically
    > show "Microsoft Internet Explorer" plus the current location,
    > which changes. But even the first part can be eliminated. If
    > you clandestinely opened IE on my PC in order to get the
    > title text you'd get "about:blank", because I erased the
    > title bar Registry setting and use a blank page for the
    > homepage.)
    I know you've mentioned the registry key for setting IE's
    title bar, but would you mentioned it again, please.

    > There just isn't any list anywhere. If it were me I think
    > I'd try the following: Walk the Start Menu and match file
    > names to targets. As a secondary method, taking the
    > path of the executable, find "Program Files". Then take the
    > name of the next folder down. That method won't always
    > work, but it's not bad. Most software uses a descriptive,
    > relevant folder name. (But not all. I think Adobe, for
    > instance, puts all of their software in a folder named "Adobe")
    >

    > > > Suppose that I have an executable, word.exe, which isn't currently
    > > > running. I know the path to the executable, C:\Applications\word.exe for
    > > > example.
    >

    > > > Now I would like to know the name of this exectuable, as it is displayed
    > > > in the start menu and in application lists and windows, i.e. Microsoft
    > > > Word.
    >

    > > > How could I do this with VBScript? I have been searching the 'net, but
    > > > haven't found an answer yet.

      My System SpecsSystem Spec

  4. #4


    mayayana Guest

    Re: Get display name of execuatable

    Sorry about this difficult-to-read post.
    It's my 3rd attempt to get past Microsoft's
    daffy filter. For some reason it keeps blocking
    this post.
    --------------

    T.r.y.i.n.g. a. s.e.c.o.n.d. t.i.m.e. t.o. p.o.s.t. t.h.i.s.. T.h.e.
    M.S. s.e.r.v.e.r.
    i.s. a.c.t.i.n.g. u.p. a.g.a.i.n..
    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.

    >. H.o.w. e.x.a.c.t.l.y. w.o.u.l.d. y.o.u. e.n.u.m.e.r.a.t.e. t.h.e.
    o.p.e.n. w.i.n.d.o.w.s. f.r.o.m.

    >. V.B.S.c.r.i.p.t.,. w.h.i.c.h. t.h.e. O.P. l.i.s.t.e.d. a.s. a.
    r.e.q.u.i.r.e.m.e.n.t. (.a.t. t.h.e. e.n.d.

    >. o.f. t.h.i.s. p.o.s.t.).. A.l.l. I. c.a.n. t.h.i.n.k. o.f.
    b.y. w.a.y. o.f. w.i.n.d.o.w. e.n.u.m.e.r.a.t.i.o.n.

    >. i.s. e.n.u.m.e.r.a.t.i.n.g. a.l.l. I.E./.E.x.p.l.o.r.e.r.
    w.i.n.d.o.w.s. t.h.r.o.u.g.h.

    >.
    C.r.e.a.t.e.O.b.j.e.c.t.(.".S.h.e.l.l..A.p.p.l.i.c.a.t.i.o.n.".)..w.i.n.d.o.
    w.s..

    >.
    N.o.t. e.x.a.c.t.l.y. f.r.o.m. V.B.S.c.r.i.p.t.. I. t.h.i.n.k.
    y.o.u.'.r.e. r.i.g.h.t. t.h.a.t.
    o.n.l.y. I.E./.E.x.p.l.o.r.e.r. w.i.n.d.o.w.s. c.a.n. b.e.
    e.n.u.m.e.r.a.t.e.d. w.i.t.h.
    s.t.r.a.i.g.h.t. s.c.r.i.p.t..

    T.h.e.r.e.'.s. a. c.o.m.p.o.n.e.n.t. h.e.r.e. w.i.t.h.
    f.u.n.c.t.i.o.n.s. t.o. e.n.u.m.e.r.a.t.e.
    w.i.n.d.o.w.s. a.n.d. t.h.e.i.r. t.i.t.l.e.s.:.

    http://www.jsware.net/jsware/scripts.php5#jssys

    T.h.e.r.e.'.s. a.l.s.o. t.h.i.s.:.

    http://www.jsware.net/jsware/scripts.php5#jsaa

    j.s.A.A..d.l.l. i.s. a. C.O.M. w.r.a.p.p.e.r. f.o.r. A.c.t.i.v.e.
    A.c.c.e.s.s.i.b.i.l.i.t.y..
    I.t. a.l.l.o.w.s. y.o.u. t.o. e.n.u.m.e.r.a.t.e. w.i.n.d.o.w.s. a.n.d.
    s.t.e.p. d.o.w.n.
    i.n.t.o. e.a.c.h. w.i.n.d.o.w.,. e.n.u.m.e.r.a.t.i.n.g. b.u.t.t.o.n.s.
    a.n.d. t.h.e.i.r.
    t.e.x.t.,. t.h.e. c.o.n.t.e.n.t. o.f. t.e.x.t.b.o.x.e.s.,. e.t.c..
    I.t. a.l.s.o. p.r.o.v.i.d.e.s. t.h.e.
    a.b.i.l.i.t.y. t.o. d.o. t.h.e. d.e.f.a.u.l.t. a.c.t.i.o.n. f.o.r.
    a.n.y. s.u.b.-.w.i.n.d.o.w..
    F.o.r. i.n.s.t.a.n.c.e.,. i.f. t.h.e.r.e.'.s. a. m.s.g.b.o.x. o.p.e.n.
    y.o.u. c.a.n. r.e.a.d. t.h.e.
    t.i.t.l.e.,. t.h.e. c.a.p.t.i.o.n.,. a.n.d. t.h.e. b.u.t.t.o.n.
    c.a.p.t.i.o.n.s.. T.h.e.n. y.o.u.
    c.o.u.l.d. a.l.s.o. c.l.i.c.k. o.n.e. o.f. t.h.e. b.u.t.t.o.n.s.
    p.r.o.g.r.a.m.m.a.t.i.c.a.l.l.y..
    (.T.h.e. d.o.w.n.l.o.a.d. h.a.s. s.a.m.p.l.e.s. t.h.a.t. u.s.e.
    S.A.P.I. t.o. s.p.e.a.k.
    d.e.s.c.r.i.p.t.i.o.n.s. o.f. o.p.e.n. w.i.n.d.o.w.s..).

    F.o.r. a.n.y.o.n.e. n.o.t. f.a.m.i.l.i.a.r. w.i.t.h. A.A.:. I.t.
    w.a.s. a.d.d.e.d. t.o.
    W.i.n.d.o.w.s. a.s. f.a.r. b.a.c.k. a.s. W.i.n.9.8.,. w.i.t.h. t.h.e.
    l.i.b.r.a.r.y.
    o.l.e.a.c.c..d.l.l.. T.h.e. i.d.e.a. w.a.s. t.o. p.r.o.v.i.d.e. a.n.
    A.P.I. f.o.r.
    s.c.r.e.e.n. r.e.a.d.e.r.s. f.o.r. t.h.e. b.l.i.n.d. a.n.d.
    s.i.m.i.l.a.r. ".a.c.c.e.s.s.i.b.i.l.i.t.y.".
    n.e.e.d.s.. U.n.f.o.r.t.u.n.a.t.e.l.y.,. A.A. i.s. a.
    c.o.n.f.u.s.i.n.g.,. a.w.k.w.a.r.d.
    s.y.s.t.e.m. t.h.a.t. w.a.s. n.e.v.e.r. r.e.a.l.l.y. f.i.n.i.s.h.e.d..
    A.n.d. i.t. d.e.p.e.n.d.s.
    t.o. s.o.m.e. e.x.t.e.n.t. o.n. c.o.-.o.p.e.r.a.t.i.o.n. f.r.o.m.
    s.o.f.t.w.a.r.e. d.e.s.i.g.n.e.r.s..
    (.F.o.r. i.n.s.t.a.n.c.e.,. a. G.U.I. t.h.a.t.'.s. j.u.s.t. a.
    ".s.k.i.n.". i.s. u.n.l.i.k.e.l.y. t.o.
    b.e. v.i.s.i.b.l.e. t.o. A.A.. I.t. w.o.r.k.s. b.e.s.t. w.i.t.h.
    s.t.a.n.d.a.r.d. W.i.n.d.o.w.s.
    c.o.m.p.o.n.e.n.t.s. -.-. b.u.t.t.o.n.s.,. l.i.s.t.b.o.x.,.
    t.e.x.t.b.o.x.,. e.t.c..). E.x.i.s.t.i.n.g.
    s.c.r.e.e.n. r.e.a.d.e.r.s. h.a.v.e. t.o. u.s.e. a.
    c.o.m.b.i.n.a.t.i.o.n. o.f. A.A. a.n.d.
    v.a.r.i.o.u.s. h.a.c.k.s. i.n. o.r.d.e.r. t.o. w.o.r.k.. B.u.t. I.
    h.a.d. o.c.c.a.s.i.o.n. t.o.
    w.o.r.k. w.i.t.h. A.A. a.t. o.n.e. p.o.i.n.t. a.n.d. e.n.d.e.d. u.p.
    w.r.i.t.i.n.g. c.o.d.e.
    f.o.r. a. l.o.t. o.f. t.h.e. f.u.n.c.t.i.o.n.a.l.i.t.y.. M.o.r.e.
    r.e.c.e.n.t.l.y. I. d.e.c.i.d.e.d.
    t.o. p.u.t. t.h.a.t. w.o.r.k. i.n.t.o. a. C.O.M. D.L.L. s.o.
    t.h.a.t. s.c.r.i.p.t.e.r.s. c.o.u.l.d.
    u.s.e. i.t.. T.h.e. r.e.s.u.l.t. i.s. j.s.A.A.. A.A. i.s. s.t.i.l.l.
    a. f.a.i.r.l.y. c.o.m.p.l.e.x.
    s.y.s.t.e.m. w.h.e.n. u.s.e.d. t.h.r.o.u.g.h. j.s.A.A.,. b.u.t.
    i.t.'.s. s.c.r.i.p.t.-.a.c.c.e.s.s.i.b.l.e.
    a.n.d. j.s.A.A. h.i.d.e.s. a. l.o.t. o.f. t.h.e. m.e.s.s..


    I. t.h.i.n.k. A.u.t.o.I.t. c.a.n. a.l.s.o. e.n.u.m.e.r.a.t.e.
    w.i.n.d.o.w.s..

    W.M.I. h.a.s. W.i.n.3.2._.P.r.o.c.e.s.s.. Y.o.u. c.a.n. g.e.t.
    E.X.E. n.a.m.e.
    a.n.d. p.a.t.h. w.i.t.h. t.h.i.s.:.

    Set WMI = GetObject("WinMgmts:")
    Set Procs = WMIExecQuery("Select * from Win32_Process")
    For Each Proc in Procs
    s1 = s1 & Proc.Caption & " - " & Proc.ExecutablePath & vbCrLf
    Next
    Set Procs = Nothing
    Set WMI = Nothing
    MsgBox s1

    B.u.t. I. d.o.n.'.t. t.h.i.n.k. i.t. s.p.e.c.i.f.i.c.a.l.l.y.
    d.e.a.l.s. w.i.t.h. w.i.n.d.o.w.s..

    >. A.n.d. o.f. j.u.s.t. a.s. m.u.s.t. i.n.t.e.r.e.s.t. w.o.u.l.d.
    b.e.... I.s. t.h.e.r.e. a.n.y. w.a.y.

    >. t.o. e.n.u.m.e.r.a.t.e. a.l.l. C.O.M. o.b.j.e.c.t.s.?. O.r.
    e.v.e.n. a.l.l. C.O.M. o.b.j.e.c.t.s. o.f.

    >. a. g.i.v.e.n. t.y.p.e. (.s.u.c.h. a.s.
    E.x.c.e.l..A.p.p.l.i.c.a.t.i.o.n.).?.

    >.
    Y.o.u. m.e.a.n. a.l.l. r.e.g.i.s.t.e.r.e.d. C.O.M. o.b.j.e.c.t.s.?.
    T.h.a.t. c.a.n.
    b.e. d.o.n.e. b.y. e.n.u.m.e.r.a.t.i.n.g. H.K.C.R. k.e.y.s.. B.u.t.
    I. g.u.e.s.s.
    y.o.u. p.r.o.b.a.b.l.y. m.e.a.n. a.l.l. l.o.a.d.e.d. C.O.M.
    o.b.j.e.c.t.s.?.
    E.n.u.m.e.r.a.t.i.n.g. l.o.a.d.e.d. C.O.M. o.b.j.e.c.t.s. w.o.u.l.d.
    r.e.q.u.i.r.e.
    g.e.t.t.i.n.g. a.l.l. o.f. t.h.e. l.i.b.r.a.r.i.e.s. l.o.a.d.e.d. b.y.
    e.a.c.h. p.r.o.c.e.s.s..
    I. k.n.o.w. t.h.a.t.'.s. p.o.s.s.i.b.l.e. b.u.t. I. d.o.n.'.t.
    k.n.o.w. h.o.w.
    t.o. d.o. i.t. o.f.f.h.a.n.d.,. m.u.c.h. l.e.s.s. h.o.w. t.o.
    m.a.k.e. i.t.
    a.v.a.i.l.a.b.l.e. t.o. s.c.r.i.p.t..
    I.f. y.o.u. m.e.a.n. t.o.p.-.l.e.v.e.l. w.i.n.d.o.w.s. -.-.
    a.p.p.l.i.c.a.t.i.o.n.
    o.b.j.e.c.t.s. -.-. I. d.o.n.'.t. k.n.o.w. h.o.w. o.n.e. w.o.u.l.d.
    t.e.l.l. t.h.a.t. a.n.
    o.p.e.n. w.i.n.d.o.w. i.s. p.a.r.t. o.f. a. p.r.o.c.e.s.s. w.i.t.h.
    a. C.O.M.
    i.n.t.e.r.f.a.c.e..

    >.
    >. I. k.n.o.w. y.o.u.'.v.e. m.e.n.t.i.o.n.e.d. t.h.e. r.e.g.i.s.t.r.y.
    k.e.y. f.o.r. s.e.t.t.i.n.g. I.E.'.s.

    >. t.i.t.l.e. b.a.r.,. b.u.t. w.o.u.l.d. y.o.u. m.e.n.t.i.o.n.e.d.
    i.t. a.g.a.i.n.,. p.l.e.a.s.e..

    >.
    Software\Microsoft\Internet Explorer\Main\Window Title

    I. s.e.t. i.t. i.n. b.o.t.h. H.K.L.M. a.n.d. H.K.C.U. t.o. b.e.
    t.h.o.r.o.u.g.h.. I. k.n.o.w.
    t.h.a.t. a.p.p.l.i.e.s. t.o. I.E. 5./.6.. I. a.s.s.u.m.e. i.t.
    s.t.i.l.l. a.p.p.l.i.e.s. t.o. I.E.
    7./.8. b.u.t. I. d.o.n.'.t. t.h.i.n.k. I.'.v.e. a.c.t.u.a.l.l.y.
    t.r.i.e.d. i.t..




      My System SpecsSystem Spec

Re: Get display name of execuatable problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Solved Display pic GingerFox Chillout Room 12 28 Oct 2008
Display Bob Pearce - Australia Vista General 0 11 Aug 2008
Black display in preview display windows movie maker juanggp Vista music pictures video 1 13 Nov 2007
Vista Business wont retain my display settings (on multiple display setup) Jim Lally Vista General 0 27 Jun 2007
display wizard gone in vista nvidia display drivers smithy Vista General 4 13 May 2007