Jump to content
Sign in to follow this  
aleph01

simple script works, sort of

Recommended Posts

aleph01

Greetings, forum!

I have the unfortunate circumstance of having a script to start a service doing crazy stuff.  Here's the script:

If ProcessExists("ewRfidLinkSvc.exe") = 0 Then Run("C:\Program Files\EnvisionWare\RFIDLink\ewRfidLinkSvc.exe")

The process, for some reason doesn't start on one of our systems, hence the script to start it. 

What happens when I run it is, a DOS windows pops up, the process appears in Task Manager, the service in Services does not indicate "Started", and the DOS window and the process in Task Manager both disappear in about 20 seconds.  I really didn't expect a DOS window to appear, much less the subsequent failure to get the service running

So, does this sound like something unrelated to the script happening on the system, or perhaps there is just a better way to deal with processes using AutoIt?

Thanks for any help.

_aleph_

By the way, I can start the service in Services and it stays started.  It just fails to automatically start at boot-up.

Edited by aleph01

Meds.  They're not just for breakfast anymore. :'(

Share this post


Link to post
Share on other sites
water

Set the @SW_HIDE flag on the Run statement to suppress the DOS window.

What happens if you manually start the service?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
aleph01

I edited my original to indicate that starting the service in Services is successful.  It just doesn't start (or stay started) at boot-up.


Meds.  They're not just for breakfast anymore. :'(

Share this post


Link to post
Share on other sites
water

Do you see any error messages in the Event Viewer?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
aleph01

The event viewer has a number if Information events for the RFID service, no warnings or errors.  Unfortunately, the programmers failed to provide any details to be reported in the event viewer for this event.


Meds.  They're not just for breakfast anymore. :'(

Share this post


Link to post
Share on other sites
water

I edited my original to indicate that starting the service in Services is successful.  It just doesn't start (or stay started) at boot-up.

Might be a timing problem. Can you insert a Sleep of 1 or 2 minutes and then start the service?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
aleph01

I thought about a timing issue at boot-up, too, but this particular service doesn't have an Automatic (Delayed) startup option.  As for pausing the script, I'm in the testing phase.  The system has been running for an hour and I'm getting this difficulty when running the script.  Is there some other advantage to putting a Sleep in the script?  The system is completely booted up and operating normally except for the RFID service when I execute my script.  I have incorporated the @SW_HIDE flag into the next version of this script.

I'm really baffled.  I can start the service through Services, but I cant get it to stay started by running the executable that Services starts using the simplest of scripts.

Maybe I'm getting sick and need to go home :-o


Meds.  They're not just for breakfast anymore. :'(

Share this post


Link to post
Share on other sites
water

You can't simply start an Exe as a service.

There is a Service UDF available that lets an AutoIt script interact with the Service Control Manager of Windows to start a service.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
aleph01

Thanks, Water.  I'll take a look at that, but not now.  My priorities shift at the whim of my employer.  I'll post back if I still have problems after checking out the UDF.


Meds.  They're not just for breakfast anymore. :'(

Share this post


Link to post
Share on other sites
water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

I've re-read your OP and I think is is much easier. If you just need to start an already created service then

Run ("net start xxx")

should be enough. xxx has to be replaced with the service name.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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  

×