Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


How to get the name of an application with VBScript

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61939
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> How to get the name of an application with VBScript
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 How to get the name of an application with VBScript - 6/27/2008 11:56:27 AM   
  Goldencat

 

Posts: 8
Score: 0
Joined: 11/10/2006
Status: offline
I'm having a problem with getting the name of running applications.  I can get the name of the process with WMI and Win32_Process, but I can't figure out any way to access the actual name of the application (such as "Mozilla Firefox" instead of the process name "firefox.exe").  If anyone knows how to do this, please help me out.
 
 
Post #: 1
 
 RE: How to get the name of an application with VBScript - 6/27/2008 1:49:30 PM   
  Rischip


Posts: 462
Score: 2
Joined: 3/26/2007
Status: offline
In the case of your example, firefox.exe is both the program name and process name. Mozilla Firefox is maybe the common name used by people, and definately the window title, but it's not the actual program name. So is it the Window title you are looking for?

_____________________________

Rischip
Author of - The Grim Linker

(in reply to Goldencat)
 
 
Post #: 2
 
 RE: How to get the name of an application with VBScript - 6/27/2008 3:40:31 PM   
  Goldencat

 

Posts: 8
Score: 0
Joined: 11/10/2006
Status: offline
Yeah, I mean the name that you get when you bring up the task manager and look under the 'Applications' tab.

(in reply to Rischip)
 
 
Post #: 3
 
 RE: How to get the name of an application with VBScript - 6/27/2008 4:08:29 PM   
  dm_4ever


Posts: 2366
Score: 38
Joined: 6/29/2006
From: Orange County, California
Status: offline
If you have Microsoft Word...you can see the name as it appears in the "applications" tab of task manager

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Goldencat)
 
 
Post #: 4
 
 RE: How to get the name of an application with VBScript - 6/29/2008 8:48:54 AM   
  yfki

 

Posts: 70
Score: 0
Joined: 12/12/2007
Status: offline
Looked all over, I think you might have to use Perl for this.

http://cpan.uwinnipeg.ca/search?query=win32%3A%3Aguitest&mode=dist


      

(in reply to dm_4ever)
 
 
Post #: 5
 
 RE: How to get the name of an application with VBScript - 6/30/2008 12:37:00 AM   
  Rischip


Posts: 462
Score: 2
Joined: 3/26/2007
Status: offline
Like DM said, if you have Word you can do this

Set Word = CreateObject("word.application")
For Each x In Word.Tasks
  wscript.echo x.Name
Next
Word.Quit
Set Word = Nothing

_____________________________

Rischip
Author of - The Grim Linker

(in reply to Goldencat)
 
 
Post #: 6
 
 RE: How to get the name of an application with VBScript - 7/1/2008 5:15:01 AM   
  Goldencat

 

Posts: 8
Score: 0
Joined: 11/10/2006
Status: offline
Thanks for the help so far. the Microsoft Word object does get what I'm looking for, but are you sure that there is no object that is built into Windows that can handle this?

(in reply to Rischip)
 
 
Post #: 7
 
 RE: How to get the name of an application with VBScript - 7/1/2008 10:42:11 AM   
  dm_4ever


Posts: 2366
Score: 38
Joined: 6/29/2006
From: Orange County, California
Status: offline
http://www.microsoft.com/technet/scriptcenter/topics/office/tasks.mspx

quote:

But WMI won’t let you get to this information, and neither will any other scripting object built into the operating system.


_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Goldencat)
 
 
Post #: 8
 
 RE: How to get the name of an application with VBScript - 7/2/2008 1:50:34 AM   
  Rischip


Posts: 462
Score: 2
Joined: 3/26/2007
Status: offline
I almost forgot another way to do it, which is part of XP, but not part of vbscript would be to shell [.RUN|.Exec] "Tasklist /FI ""WINDOWTITLE eq <WindowTitle>"""
You'll get something like this as output.\/ Using .Exec you can pipe that into your script using STDOUT.read

C:\>tasklist /FI "WINDOWTITLE eq VBScript Forum - Mozilla FireFox"

Image Name                   PID Session Name     Session#    Mem Usage
========================= ====== ================ ======== ============
firefox.exe                 3384 Console                 0    121,412 K

_____________________________

Rischip
Author of - The Grim Linker

(in reply to dm_4ever)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> How to get the name of an application with VBScript Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts