Sign in to follow this  
Followers 0
aleph01

odd behavior with ProcessExists

3 posts in this topic

I created a script to monitor a process and run a bat file if the process didn't exist.  Here's the text:

While 1
    If ProcessExists("ewRfidLinkSvc.exe") = 0 Then Run("C:\startRFID.bat")
    Sleep (10000)
WEnd

The script worked great for a few days and then stopped working.

On a whim, I rewrote the script in this fashion:

While 1
    $i = ProcessExists("ewRfidLinkSvc.exe")
    If $i = 0 Then Run("C:\startRFID.bat")
    Sleep (10000)
WEnd

This script is working as I text.

My question is, why did reading the ProcessExists return value directly and then executing my Run command work, then fail, and is it better to set the return value to a variable as a general rule?

Thanks for any responses.

_aleph_

Share this post


Link to post
Share on other sites




The script worked great for a few days and then stopped working.

 

You have to be able to figure out that is not enough information. No mention of what (if any) errors you received, no idea of the environment you're running in, the AutoIt version, nothing?


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

Sorry, JLogan1o13 if I didn't give enough info.  Scripts written with AutoIt v.3.3.10.2, running compiled on an XP kiosk.  When it fails, the Autoit script process is running in task manager, and if I double-click the .bat file it runs.  Apparently the older version of the Autoit script has stopped running the .bat file.  I get no error, just no action.  Even restarting the XP box didn't help - if I stopped the service, the process was eliminated, but the script didn't run the .bat file.  I'm very perplexed.  What could go wrong in such a simple script that had worked when I rolled it out?

Thanks for responding.

_aleph_

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
Sign in to follow this  
Followers 0