aleph01 Posted November 8, 2013 Share Posted November 8, 2013 (edited) 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 November 8, 2013 by aleph01 Meds. They're not just for breakfast anymore. Link to comment Share on other sites More sharing options...
water Posted November 8, 2013 Share Posted November 8, 2013 (edited) Set the @SW_HIDE flag on the Run statement to suppress the DOS window. What happens if you manually start the service? Edited November 8, 2013 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
aleph01 Posted November 8, 2013 Author Share Posted November 8, 2013 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. Link to comment Share on other sites More sharing options...
water Posted November 8, 2013 Share Posted November 8, 2013 Do you see any error messages in the Event Viewer? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
aleph01 Posted November 8, 2013 Author Share Posted November 8, 2013 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. Link to comment Share on other sites More sharing options...
water Posted November 8, 2013 Share Posted November 8, 2013 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
aleph01 Posted November 8, 2013 Author Share Posted November 8, 2013 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. Link to comment Share on other sites More sharing options...
water Posted November 8, 2013 Share Posted November 8, 2013 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
aleph01 Posted November 8, 2013 Author Share Posted November 8, 2013 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. Link to comment Share on other sites More sharing options...
water Posted November 8, 2013 Share Posted November 8, 2013 Here is the link to the UDF: '?do=embed' frameborder='0' data-embedContent>> My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted November 8, 2013 Share Posted November 8, 2013 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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