|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello,
I'm having an issue with having a focus on the Ruby invoked console window on Windows platform when I start the process from one of the Scheduled Tasks. I have a Ruby script that gets kicked off by Scheduled Task. So the Run command looks like this: C:\ruby\bin\ruby.exe D:\Temp\HelloRuby.rb Now when I right click on the scheduled task and choose Run, the console window doesn't have the focus. I looked for ways to set the focus on the console window using kernel32 and stuff, but I haven't been able to find a solution. Does anyone know how best I can solve this problem? TIA |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
require 'win32ole'
wsh = WIN32OLE.new('WScript.Shell') wsh.AppActivate("name of the window") I am not sure I understood your question 100% , but if I am ok with 50% It may you. -ronnie. -- Posted via http://www.ruby-forum.com/. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Ah, that's cool. I never thought of using WSCript.Shell. Thanks!
On Mar 11, 11:06am, Rodrigo Bermejo <rodrigo.berm...@ps.ge.com> wrote: > require 'win32ole' > wsh = WIN32OLE.new('WScript.Shell') > wsh.AppActivate("name of the window") > > I am not sure I understood your question 100% , but if I am ok with 50% > It may you. > > -ronnie. > -- > Posted viahttp://www.ruby-forum.com/. |
|
![]() |
| Outils de la discussion | |
|
|