Re: Capture window caption of "this" program in XO Pro?
- From: "Paul Randall" <paulr90@xxxxxxx>
- Date: Thu, 12 Feb 2009 10:12:55 -0700
I agree that it is much better to do things properly by using a command
prompt. I disagree on the method of navigating to the folder containing the
script to be executed.
My lazy old fingers don't want to type that long 'cscript //nologo
"%UserProfile%\...\FindTasks.vbs" '; they usually screw it up once or twice.
It is much easier to just right click in the white space of the folder that
FindTasks.vbs resides in, and choose CMD Prompt, which opens a cmd prompt
navigated to the proper folder. Then I just type
cscript //nologo "FindTasks.vbs".
The "s are only needed if the file name contains spaces.
The tool to add the "CMD Prompt" to the context menu of the white space of a
folder window is available at:
http://www.roggel.com/NGNeer/BackgroundCMD/index.shtml
I have used in on my WXP SP2 system for about two months with no apparent
problems.
Note that this is completely different from the 'command prompt here'
context menu item commonly found elsewhere.
-Paul Randall
"Pegasus (MVP)" <I.can@xxxxxxxxxx> wrote in message
news:e3RL41SjJHA.4860@xxxxxxxxxxxxxxxxxxxxxxx
If you launch console commands from the Start/Run box then you're
punishing yourself because you'll see the messages flashing by, nothing
else. Much better to do things properly by using a Command Prompt:
1. Click Start / Run
2. Type the letters cmd
3. Click the OK button.
4. Type this command:
cscript //nologo "%UserProfile%\Desktop\New Folder\FindTasks.vbs"
5. Press the Enter button on your keyboard.
"Ed from AZ" <prof_ofwhat@xxxxxxxxx> wrote in message
news:4acf32c0-a546-4495-a2a2-baecfef0b338@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi, Pegasus. Thanks for responding.
I copied your code and saved it into a script file named
FindTasks.vbs.
I invoked it from Start >> Run using
cscript // C:\Documents and Settings\MyUserName\Desktop\New Folder
\FindTasks.vbs
I think it worked, because I saw a Command Prompt window flash up on
the screen very briefly. I do have Outlook open at the time and the
window is open. But nothing stayed on the screen long enough to see
what it was! How do you keep the Echo open long enough to read it?
(And why invoke a new Word process?)
Ed
On Feb 11, 4:18 pm, "Pegasus \(MVP\)" <I....@xxxxxxxxxx> wrote:
"Ed from AZ" <prof_ofw...@xxxxxxxxx> wrote in
messagenews:5d86d454-c1e0-4247-8f89-485ad5763c33@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm an absolute novice at scripting. I'd like to see if a simple
script could capture the caption I see in the top-most colored border
of the window of a certain program. For instance, my Outlook caption
is "Inbox - Microsoft Outlook", and my IE window has
"microsoft.public.scripting.vbscript | Google Groups - Windows
Internet Explorer".
If I feed the script the program name, can this be accomplished? My
ultimate goal is to parse this string for a coule of elements to build
some strings.
Any pointers are greatly appreciated.
Ed
Here is something to get you started:
Set cTasks = CreateObject("Word.Application").Tasks
For Each oTask In cTasks
If InStr(1, oTask, "Outlook", 1) then WScript.echo oTask.name
Next
The script will show you the name of each process that is currently
running
and that has the word "Outlook" it its name. You should invoke the script
with cscript.exe.
.
- Follow-Ups:
- Re: Capture window caption of "this" program in XO Pro?
- From: Stefan Kanthak
- Re: Capture window caption of "this" program in XO Pro?
- From: Pegasus \(MVP\)
- Re: Capture window caption of "this" program in XO Pro?
- References:
- Capture window caption of "this" program in XO Pro?
- From: Ed from AZ
- Re: Capture window caption of "this" program in XO Pro?
- From: Pegasus \(MVP\)
- Re: Capture window caption of "this" program in XO Pro?
- From: Ed from AZ
- Re: Capture window caption of "this" program in XO Pro?
- From: Pegasus \(MVP\)
- Capture window caption of "this" program in XO Pro?
- Prev by Date: Re: Problem using SUM with ADO object
- Next by Date: Re: Capture window caption of "this" program in XO Pro?
- Previous by thread: Re: Capture window caption of "this" program in XO Pro?
- Next by thread: Re: Capture window caption of "this" program in XO Pro?
- Index(es):