Olish Posted July 10, 2006 Share Posted July 10, 2006 (edited) Hello everybody ! I'd like to register my EXE as a Windows Service as simply as possible. Can someone tell me how could I do please ? Thank you for your help. Olivier, from France. PS : Sorry for the title > "create" Edited July 10, 2006 by Olish Olivier, from France.Free Wake On LAN script Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 10, 2006 Share Posted July 10, 2006 HI, maybe this helps out. Never tested! Func _SrvAny($service, $fullpath, $hidden = 0) ; Adds a program, as a windows service. ; Requires $instsrv and $srvany to be assigned, full paths. ; e.g. _SrvAny ( 'ServiceName', 'FullPath_to_the_program' ) Local $instsrv = @WindowsDir & '\System32\Instsrv.exe' Local $srvany = @WindowsDir & '\System32\SrvAny.exe' If FileExists($instsrv) And FileExists($srvany) Then RunWait($instsrv & ' ' & $service & ' "' & $srvany & '"', '', @SW_HIDE) Local $key = 'HKLM\SYSTEM\CurrentControlSet\Services\' & $service If RegRead($key, 'DisplayName') Then If $hidden Then RegWrite($key & '\Parameters', 'AppParameters', 'Reg_sz', '/hidden') Return RegWrite($key & '\Parameters', 'Application', 'Reg_sz', $fullpath) EndIf EndIf EndFunc So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Olish Posted July 10, 2006 Author Share Posted July 10, 2006 Thank you for your help th.meger . And for unregistering the service, may I delete corresponding registry keys ? Olivier, from France.Free Wake On LAN script Link to comment Share on other sites More sharing options...
MHz Posted July 11, 2006 Share Posted July 11, 2006 Thank you for your help th.meger .And for unregistering the service, may I delete corresponding registry keys ?Just use SC delete "servicename" 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