Jump to content

ProcessExists?


Recommended Posts

Did a search through the forum and even googled, but nothing comes up that is quite what I need. All the actual ProcessExists examples I found seem to launch a message box if a condition is or isn't met and I just need an app to run or not run <g>.

An excellent example script that I have works perfectly (it isn't what I need, but it shows general simplicity I was hoping for):

While ProcessExists ( "Outlook.exe" )
    ProcessClose ( "Outlook.exe" )
WEnd
No message box needed.

As an aside, I can get this to work, I'll have a snooze button for my weekday alarm clock program that will make it even more completely awesome! I have MP3Rdio set to launch out of a task scheduler at a very early time. With a working ProcessExists script, can replace the actual physical launch of file with an AU3 script that will allow me to have an easier time of it in the mornings along with all my favourite music and an AT&T natural voice DJ!! (MP3Radio is freeware, too, so it's just the right price just like AI!!)

Thank you! :)

Link to comment
Share on other sites

Look at the help file for IF and RUN

Example

If Not ProcessExists("MP3_RADIO.exe") Then Run("MP3_RADIO.exe", @TempDir, @SW_SHOW)
Thank you! This works just great.

I did a general search in the help file for ProcessExists and then went through the many options lists but didn't see an example like this. I know, I'm a real dunce with anything but simple code and though I intellectually understand all this stuff, for some reason I can't seem to yet wrap my brain around conditional statements. I'm hoping that with enough actual working code examples that one day the light bulb will click on figuring out syntax and how all those darned commands can be modified, but I'm still conditional-syntax-challenged!!! <sigh> Don't know why that is. I tried all sorts of things on my own for this but they didn't work. I see that it's actually working with IF NOT and not just an IF statement <sigh> Anyway, double thanks for this. The final code just needed the actual path to the EXE to run (since on hdd and not on USB flash drive, using full path without qualms <g>), so it looks like this:

If Not ProcessExists("MP3_RADIO.exe") Then Run("M:\clock, MP3Radio\APP- MP3 Radio (actually installed)\MP3_RADIO.exe", @TempDir, @SW_SHOW)
Just tested it and super wow.

Cheers. :)

Link to comment
Share on other sites

Thank you! This works just great.

I did a general search in the help file for ProcessExists and then went through the many options lists but didn't see an example like this. I know, I'm a real dunce with anything but simple code and though I intellectually understand all this stuff, for some reason I can't seem to yet wrap my brain around conditional statements. I'm hoping that with enough actual working code examples that one day the light bulb will click on figuring out syntax and how all those darned commands can be modified, but I'm still conditional-syntax-challenged!!! <sigh> Don't know why that is. I tried all sorts of things on my own for this but they didn't work. I see that it's actually working with IF NOT and not just an IF statement <sigh> Anyway, double thanks for this. The final code just needed the actual path to the EXE to run (since on hdd and not on USB flash drive, using full path without qualms <g>), so it looks like this:

If Not ProcessExists("MP3_RADIO.exe") Then Run("M:\clock, MP3Radio\APP- MP3 Radio (actually installed)\MP3_RADIO.exe", @TempDir, @SW_SHOW)
Just tested it and super wow.

Cheers. :)

Also look in the include files. The File is Misc.au3 and the function is singleton()

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...