Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBS pull window program

Status
Not open for further replies.

6661984

Technical User
Sep 19, 2011
7
US
Hello

I need your help, i am trying to write code to start application (exe)already done that, but i need to make sure that cursor is placed in this application or make sure that proram window is active. Do you know how i can handle this.

Please advise
Thank you
 
already done that
Which code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "SapLogon.exe"
wscript.Sleep 9000
WshShell.SendKeys "(^f)" WshShell.Sendkeys "r/3"
WshShell.Sendkeys "{ENTER}"
wscript.Sleep 6000
when i run this script from Task scheduler part sendkeys (^f)
should go to application filter but its not working because window is not active
 
What about this ?
WshShell.Run "SapLogon.exe"[!], 3[/!]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
its not working its opening Recycle Bin :) in windows
 
Maybe its something related with Microsoft task scheduler set up, because when i just run script manually it works.
 
The scheduled job should interact with the desktop, doesn't it ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
its not working, sendkeys ctrl + F should go to application not to desktop ;/
 
it works when i left clik on saplogon window before sendkeys ctrl+f pls advise
 
I'd try the AppActivate method before each SendKeys call.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
so it should be WshShell.AppActivate "SapLogon.exe"
or WshShell.AppActivate "SapLogon" ?
 
You have to use the saplogon's window title.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top