forever Posted May 6, 2006 Share Posted May 6, 2006 Global $objWMIService Global $strComputer = "." Const $OWN_PROCESS = 16;16 is own process Const $INTERACTIVE = true;True changes the $Own_Process to 272 is interact with desktop Const $NORMAL_ERROR_CONTROL = 1 Dim $Script, $SrvAny, $info, $Help ;Functions _File_Open() _Install_Service() Func _File_Open() $FileOD = FileOpenDialog("Select SrvAny.exe File", "C:\", "EXE (*.exe)", 3) $File = FileOpen($FileOD, 0) $SrvAny = (Chr(34) & $FileOD & chr(34) ) If $File = -1 Then MsgBox(0, "Error", "Unable to open file, or no file selected !!") EndIf EndFunc Func _Install_Service() If $SrvAny = "" Then MsgBox(0,"Warning ", "Select the SvrAny.exe using the File Open first") Else MsgBox(0,"Information","This has to be activated only ONCE !!") $objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") $objService = $objWMIService.Get("Win32_BaseService") $errReturn = $objService.Create("_Au3@Service" ,"_Au3@Service" , $SrvAny, $OWN_PROCESS, $NORMAL_ERROR_CONTROL, _ "Manual", $INTERACTIVE, "LocalSystem", "" ) EndIf EndFuncThis is what i got from another script by searching tru this forums.Ofc it can add services and also progs to start if it fails.I want to create a real service - one that answers to the control commands from windows.(Start?,Pause?,Stop?)(myprob: it starts the service but it doesnt answer to control commands from windows. So how to receive those and how to "answer" ?)can anyone help? Link to comment Share on other sites More sharing options...
forever Posted May 7, 2006 Author Share Posted May 7, 2006 hmm... ? :s any1? Link to comment Share on other sites More sharing options...
Valuater Posted May 7, 2006 Share Posted May 7, 2006 (edited) not my area... but have you seen this... and there is a link inside to another programhttp://www.autoitscript.com/forum/index.php?showtopic=17581#good luck8) Edited May 7, 2006 by Valuater Link to comment Share on other sites More sharing options...
forever Posted May 7, 2006 Author Share Posted May 7, 2006 The Scriptsnippets i showed are exactly copied from that thread. It also does not what i want. And its always the same issues with "other programs" i cant use them I have only use for windows-integrated tools. thanks anyways. anyone else with ideas on this? it could be really useful... since autoit programming is getting more and more complex and there'r coming more and more prof. programs up with this. 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