Glyph Posted August 4, 2007 Share Posted August 4, 2007 http://support.microsoft.com/kb/137890$nRet = _CreateService("", "PWB",$file&" -system","C:\Documents and Settings\x\srvany.exe", "LocalSystem", "", BitOR($SERVICE_WIN32_OWN_PROCESS, $SERVICE_INTERACTIVE_PROCESS)) If $nRet Then MsgBox(4096,'debug:' , 'PWB service created');### Debug MSGBOX EndIf If _StartService("", "PWB") Then MsgBox(4096,'debug:' , 'PWB service started');### Debug MSGBOX EndIf???? this stops working when it starts it, because it's still not registering correctly.I'm so lost on how to use it correctly in this situation... help! tolle indicium Link to comment Share on other sites More sharing options...
Developers Jos Posted August 4, 2007 Developers Share Posted August 4, 2007 http://support.microsoft.com/kb/137890 $nRet = _CreateService("", "PWB",$file&" -system","C:\Documents and Settings\x\srvany.exe", "LocalSystem", "", BitOR($SERVICE_WIN32_OWN_PROCESS, $SERVICE_INTERACTIVE_PROCESS)) If $nRet Then MsgBox(4096,'debug:' , 'PWB service created');### Debug MSGBOX EndIf If _StartService("", "PWB") Then MsgBox(4096,'debug:' , 'PWB service started');### Debug MSGBOX EndIf ???? this stops working when it starts it, because it's still not registering correctly. I'm so lost on how to use it correctly in this situation... help! Have you set the needed Registry entries ? RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\PWB\Parameters", "Application", "REG_SZ", Path-to-your-program) RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\PWB\Parameters", "AppParameters", "REG_SZ", "needed-parametres") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Glyph Posted August 4, 2007 Author Share Posted August 4, 2007 (edited) Have you set the needed Registry entries ? RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\PWB\Parameters", "Application", "REG_SZ", Path-to-your-program)RegWrite("HKLM\SYSTEM\CurrentControlSet\Services\PWB\Parameters", "AppParameters", "REG_SZ", "needed-parametres")I have no idea what parameters I can enter. :lI assume it's the path to srvany.exe?Note: Google sucks, for searcing service parameters. Edited August 4, 2007 by BackStabbed tolle indicium Link to comment Share on other sites More sharing options...
Glyph Posted August 5, 2007 Author Share Posted August 5, 2007 Someones gotta know the paramters! >< tolle indicium Link to comment Share on other sites More sharing options...
MHz Posted August 5, 2007 Share Posted August 5, 2007 Try this old UDF of mine. 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 & '\SystemFiles\Instsrv.exe' Local $srvany = @WindowsDir & '\SystemFiles\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 Link to comment Share on other sites More sharing options...
Glyph Posted August 5, 2007 Author Share Posted August 5, 2007 MHZ is my new best friend xD. YESS IT WORKS!!! tolle indicium Link to comment Share on other sites More sharing options...
MHz Posted August 5, 2007 Share Posted August 5, 2007 MHZ is my new best friend xD. YESS IT WORKS!!!I am glad it works for you. I just noticed the "..\SystemFiles\.." path I use personally so a readjustment needed there for anyone who uses it. 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