evilpacketmonkey Posted April 20, 2009 Share Posted April 20, 2009 (edited) In the Example portion of this forum there is an Service.au3. I have followed the instructions to the "T" and not sure what I am doing wrong if any.The only code changes I made were to the example so as to see some sort of proof I got it correct.func main() while 1 ;doing what you want here msgbox(0,"","ok");This is where I removed the ";" comment tag Sleep(1000) WEnd EndFuncI compile example to "test.exe"From a command line "test.exe -i" Installing service, please wait Installation of service successfulI use service.msc to start the service and nothing happens other then a message box that says "Error 0" with "OK" optionI think maybe I should run test.exe again with no switch. Still "Error 0" with "OK" option.I re-read the thread and I get the point how this is not supposed to be a gui type app so maybe the message box from the service is a bad ideaI write a quick exe that is just a message box on it's ownMessage () Func Message() MsgBox(0, "Title", "Test",2) wait() EndFunc Func wait() sleep(10000) Message() EndFuncI test MsgBox.exe and runs fine. I even write a another app "test4.exe" to just make sure I can call MsgBox.exeRun("C:\Projects\temp\MsgBox.exe","")Works fine.So I change the Service_Example to:func main() while 1 ;doing what you want here Run("C:\temp\MsgBox.exe","") WEnd EndFuncYes, MsgBox.exe is in the c:\temp\ dir.Still "error 0"What am I doing wrong?N0 I am not running an of this from SciTE. This is all via the compiled script.I think I have all my ducks in a row. Please let me know if I am missing any information for troubleshooting this.As always, thanks! Edited April 20, 2009 by evilpacketmonkey Link to comment Share on other sites More sharing options...
BrettF Posted April 20, 2009 Share Posted April 20, 2009 Read the FAQ for the exact one I use. This starts APACHE Service for me (when I want it to). #include "Service.au3" Dim $nRet ; Stop/start the Apache2.2 service If _ServiceExists("", "Apache2.2") Then ;MsgBox(4096,'debug:' , 'Apache2.2 service exists');### Debug MSGBOX If _StartService("", "Apache2.2") Then MsgBox(4096,'debug:' , 'Apache2.2 service started');### Debug MSGBOX EndIf Else MsgBox(4096,'debug:' , 'Apache2.2 service does not exist');### Debug MSGBOX EndIf Sleep(1000) Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
evilpacketmonkey Posted April 20, 2009 Author Share Posted April 20, 2009 (edited) --- Nothing to see here .. (yet) Fake Edit: for my own lack of searching skills. Edited April 20, 2009 by evilpacketmonkey Link to comment Share on other sites More sharing options...
Juvigy Posted April 21, 2009 Share Posted April 21, 2009 while 1 ;doing what you want here msgbox(0,"","ok");This is where I removed the ";" comment tag Sleep(1000) WEnd This looks like an infinite loop. What are you trying to accomplish? It should pop up the msgbox every 1000secs . Link to comment Share on other sites More sharing options...
evilpacketmonkey Posted April 23, 2009 Author Share Posted April 23, 2009 while 1;doing what you want here msgbox(0,"","ok");This is where I removed the ";" comment tag Sleep(1000) WEndThis looks like an infinite loop. What are you trying to accomplish? It should pop up the msgbox every 1000secs .That is not my code, that is the code from the author of the Service.au3. http://www.autoitscript.com/forum/index.ph...st&id=22211I finally got some time to make sure I did not miss anything in the FAQ that BrettF was referencing and he is using a different method/author/.au3 then what I am asking about in my first post.What am I trying to do? Get the service.au3 to work, all I am trying to do at this point is just get the example script to work, even if all it does it throw a bunch of msgbox windows up. I can't get that to work. Larger question of what I am trying to do? I help maintain a test rack of machines at work and we want the service to monitor a (intranet) website , first download then launch that file. We are using the local MAC address to name the file on the server. First package is a app that changes hostname and IP then updates Bginfo with a custom .bgi file (it displays who has the machine checked out and for how long). I have 98% the code written except for the part where it's a service. We plan on adding it to our ghost images so when box is imaged and the setup.exe has not run yet it will. Updating the one place packages are stored on webserver is easier then trying to maintain all the ghost images. None of what I am trying to do requires user interaction , but I am just trying to get the test example to work. 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