JonnyThunder Posted January 20, 2010 Posted January 20, 2010 Hello, I've read various topics on here about running the script as a service but can't get it to work. Here is the test script I'm running.... #NoTrayIcon While 1=1 Beep(4000, 200) Sleep(400) WEnd Then I create a service with this.... sc.exe create "MyService" binpath= "C:\MyScript.exe" type= own type= interact start= auto DisplayName= "MyService" The service is created fine. However, when I try to start the service with this.... sc.exe start "MyService" ... I get the following message... The service did not respond to the start or control request in a timely fashion Can anyone show me how to actually do this? Cheers, JT
whim Posted January 20, 2010 Posted January 20, 2010 I don't, but maybe this thread can: Run your exe as Servicehth,wim
JonnyThunder Posted January 20, 2010 Author Posted January 20, 2010 Thanks, I'd already read that earlier on - but I was trying to make use of SC.EXE which is 'meant' to be able to do this. I already tested the script with RunAsSvc and it works fine with that too. Just seems to be SC.EXE which is a problem, though I can't think why.
Juvigy Posted January 20, 2010 Posted January 20, 2010 sc create myservice c:\myprogram.exe Thia is how you can install your exe to run as a service.
JonnyThunder Posted January 20, 2010 Author Posted January 20, 2010 Sadly it isn't that easy. The command I posted originally DOES install the service but it doesn't actually start.
JonnyThunder Posted January 20, 2010 Author Posted January 20, 2010 Yes, when I try to start the service I get the error above. I get it whether I use the UDF posted earlier or from the command line using SC.EXE. Or even if I try to start the service from the Services list.
spudw2k Posted January 20, 2010 Posted January 20, 2010 (edited) I believe SC is simply a commandline interface to the Service Control Manager. It has nothing to do with making non-service executables into services. You can use the Services UDF mentioned by Whim to accomplish what you want. Else you have to use another tool to launch any exe as a service. Edited January 20, 2010 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
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