TehWhale Posted August 17, 2008 Posted August 17, 2008 I just needed a bit of clarification. If I create a service, and start the service, it will run at startup correct? I am making a backup utility, and want to have a service so you don't have to have the actual program running all the time, you will have a service to do it. This is some test code. ; Create/delete the WinVNC service ; You must copy both the winvnc.exe and vnchooks.dll file to the Windows directory before ; running this code. If _ServiceExists("", "WinVNC") Then MsgBox(4096,'debug:' , 'WinVNC service exists') ;### Debug MSGBOX If _ServiceRunning("", "WinVNC") Then MsgBox(4096,'debug:' , 'WinVNC service running') ;### Debug MSGBOX If _StopService("", "WinVNC") Then Sleep(1000) MsgBox(4096,'debug:' , 'WinVNC service stopped') ;### Debug MSGBOX If _DeleteService("", "WinVNC") Then MsgBox(4096,'debug:' , 'WinVNC service deleted') ;### Debug MSGBOX EndIf EndIf Else If _DeleteService("", "WinVNC") Then MsgBox(4096,'debug:' , 'WinVNC service deleted') ;### Debug MSGBOX EndIf EndIf Else $nRet = _CreateService("", _ "WinVNC", _ "VNC Server", _ "%SystemRoot%\winvnc.exe -service", _ "LocalSystem", _ "", _ BitOR($SERVICE_WIN32_OWN_PROCESS, $SERVICE_INTERACTIVE_PROCESS)) If $nRet Then MsgBox(4096,'debug:' , 'WinVNC service created') ;### Debug MSGBOX If _StartService("", "WinVNC") Then MsgBox(4096,'debug:' , 'WinVNC service started') ;### Debug MSGBOX EndIf Else MsgBox(4096,'debug:' , 'Failed to create WinVNC service: ' & @error) ;### Debug MSGBOX EndIf EndIf So, if I was going to use FileInstall() where would "%SystemRoot%\winvnc.exe -service" be with macros? like @WindowsDir or @SystemDir? Thats all the information I need! Thanks for your help guys!
AdmiralAlkex Posted August 17, 2008 Posted August 17, 2008 I just needed a bit of clarification.If I create a service, and start the service, it will run at startup correct?Not necessary, a service in WinXP can have on of three "startup types".Automatic.Manual.Disabled.Windows Vista added: "Automatic (Delayed Start)"I don't know how that service is created so I can't tell if it's Automatic or not, you better check yourself what it is setting itself on. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
TehWhale Posted August 17, 2008 Author Posted August 17, 2008 Not necessary, a service in WinXP can have on of three "startup types". Automatic. Manual. Disabled. Windows Vista added: "Automatic (Delayed Start)" I don't know how that service is created so I can't tell if it's Automatic or not, you better check yourself what it is setting itself on.Thanks. Well how can I set it to Automatic. $nRet = _CreateService("", _ "EzBackup Pro", _ "EzBackup Service", _ "%SystemRoot%\EzBServ.exe", _ "LocalSystem", _ "", _ BitOR($SERVICE_WIN32_OWN_PROCESS, $SERVICE_INTERACTIVE_PROCESS))So would this automatically start and stuff?
AdmiralAlkex Posted August 17, 2008 Posted August 17, 2008 I have no idea, I have done such things with autoit and services, but do you not run the code yourself and check which "startup type" it sets? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
TehWhale Posted August 17, 2008 Author Posted August 17, 2008 I have no idea, I have done such things with autoit and services, but do you not run the code yourself and check which "startup type" it sets?I just want a simple service that will run at startup!
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