giangnguyen Posted May 10, 2016 Share Posted May 10, 2016 I am needing a little bit of help with SchTsk (Task Scheduler). I am trying to set up a task that will run @AppDataDir & "\Gyazo\GyazoWin.exe" (In case you are wondering it is a screenshot tool, find out more at gyazo.com) when the process Javaw.exe is not running. Any idea? I have heard that Task Scheduler can do this, and I don't want an AutoIt script to be doing this. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 10, 2016 Moderators Share Posted May 10, 2016 (edited) 4 minutes ago, giangnguyen said: and I don't want an AutoIt script to be doing this. Then why are you asking in the AutoIt GH&S forum? Try a Windows Forum instead: https://social.technet.microsoft.com/Forums/en-US/home Edit: And as you don't want to use AutoIt to do this, I have moved the thread to a more appropriate forum. Edited May 10, 2016 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
giangnguyen Posted May 10, 2016 Author Share Posted May 10, 2016 3 minutes ago, JLogan3o13 said: Then why are you asking in the AutoIt GH&S forum? Try a Windows Forum instead: https://social.technet.microsoft.com/Forums/en-US/home Edit: And as you don't want to use AutoIt to do this, I have moved the thread to a more appropriate forum. What I meant is to use an AutoIt script to create it. Probably through Run(@Comspec & "something") but I haven't figured it out. So moving it back wouldn't do any harm Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 10, 2016 Moderators Share Posted May 10, 2016 Chalk it up to a language barrier, but in the future you may want to clarify your intent in your initial post. Otherwise people are left guessing (sometimes incorrectly) at what you're trying to do "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
giangnguyen Posted May 10, 2016 Author Share Posted May 10, 2016 57 minutes ago, JLogan3o13 said: Chalk it up to a language barrier, but in the future you may want to clarify your intent in your initial post. Otherwise people are left guessing (sometimes incorrectly) at what you're trying to do Haha I don't want to blame it on the language barrier, since I am fluent. However I guess I forgot to clarify it. My bad. Link to comment Share on other sites More sharing options...
giangnguyen Posted May 11, 2016 Author Share Posted May 11, 2016 Still need this, anybody knows how to do it? Link to comment Share on other sites More sharing options...
JeremyNicoll Posted May 12, 2016 Share Posted May 12, 2016 In my experience it makes sense first to set up test scheduled tasks by hand, using the Windows GUI, and make sure they work. You can get help on that elsewhere. Then experiment with the schtasks.exe and a whole set of parameters to see if you can achieve the same thing. Since some of the schtasks options allow you to list the scheduled tasks that are already defined, you can see how it lists the ones you defined & tested using the GUI. It should all make more sense then. After that, creating a scheduled task via a SCHTASKS.EXE command is easy, provided you've decided which of its many parameters are those you want to use. Link to comment Share on other sites More sharing options...
Confuzzled Posted May 13, 2016 Share Posted May 13, 2016 (edited) WMI is very powerful and you may wish to explore the "Win32_Process" in the COM extensions in the AutoIT Help File to get information on running tasks. Microsoft has extensive documentation on the task scheduler at https://technet.microsoft.com/en-us/library/cc766428%28v=ws.11%29.aspx which should prove useful. In your case you want to trigger your routine if process Javaw.exe is not running, so you probably want to be able to catch it as soon as it stops. Sounds like an AutoIT loop with an idle timer to yield CPU cycles in there somewhere running in the background might be a quick and dirty solution. Don't forget to create/kill your COM object only once, not inside the loop repeatedly, otherwise you will exhaust memory. Bigger picture question: Are you debugging Java programs with your background screen shot utility? What are you trying to achieve in the long run? Edited May 13, 2016 by Confuzzled Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now