Re: Application/popup focus
From: Philippe L. Balmanno (PBalmanno_at_sandiego.gov)
Date: 02/16/05
- Next message: tony: "mapping same drive for user of more than one group"
- Previous message: Gerry Hickman: "Re: Help in WMI in ASP.net application"
- In reply to: Philippe L. Balmanno: "Application/popup focus"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Feb 2005 15:30:30 -0800
Sorry the first post was using Internet and I got an error so I thought it
didn't make it.
"Philippe L. Balmanno" <PBalmanno@sandiego.gov> wrote in message
news:%238nJo6HFFHA.1836@tk2msftngp13.phx.gbl...
> Only the second script I've ever attempted to write for the office.
> Usually, I do SQL & PLSQL.
>
> Is there a way to keep focus on an application run from a script?
>
> Here is the script I have:
>
> /** Script: CleanUp.wsh
> *
> * Purpose: Calls Clnmgr and start cleanup.
> *
> *
> **/
>
> // Title of Disk Cleanup MMC
> var appTitle = "Disk Cleanup"; // Application's Title
> var WshShell = WScript.CreateObject("WScript.Shell");
> WshShell.Run("%systemroot%\\system32\\cleanmgr.exe /D %c");
> WScript.Sleep(100); // Wait some more
> WshShell.AppActivate(appTitle); // Activate application
> WScript.Sleep(100); // Wait a fraction before next step
>
> //Handle Popup and start the program -- here is where it stalls the popup
> looses focus
> WshShell.SendKeys("{TAB}"); // Tabs to choose ok action
> WshShell.SendKeys("{TAB}"); // Tabs to choose ok action
> WScript.Sleep(500); // Wait some more
> WshShell.SendKeys("{ENTER}"); // Action chosen is enter to start
> cleanup
>
>
- Next message: tony: "mapping same drive for user of more than one group"
- Previous message: Gerry Hickman: "Re: Help in WMI in ASP.net application"
- In reply to: Philippe L. Balmanno: "Application/popup focus"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|