giangnguyen

SchTsk help

8 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by JLogan3o13

When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites

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 ;)


When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Still need this, anybody knows how to do it?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by Confuzzled

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now