sakshi Posted May 11, 2010 Share Posted May 11, 2010 I am automating some task in which i need to stop all the Oracle services which are running. I have used RunWait(@ComSpec & " /c " & 'sc stop "' & $sSvcName1 & '"', "", @SW_HIDE) but the issue is the service name changes each time . it is according to the database created but always starts with Oracle keyword. so i am thinking of stoping all services that start with keyword Oracle. but dont know how to.... can anyone help Please? thanks. Link to comment Share on other sites More sharing options...
Xenobiologist Posted May 11, 2010 Share Posted May 11, 2010 Hi, one way would be Using this ConsoleWrite( _getDOSOutput('sc query') & @CRLF) Func _getDOSOutput($command) Local $text = '', $Pid = Run('"' & @ComSpec & '" /c ' & $command, '', @SW_HIDE, 2 + 4) While 1 $text &= StdoutRead($Pid, False, False) If @error Then ExitLoop Sleep(10) WEnd Return $text EndFunc ;==>_getDOSOutput to get all runnning service, then using RegExp to get the ones which contain the word Orcale and then using e.g. net stop to stop them 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...
sakshi Posted May 12, 2010 Author Share Posted May 12, 2010 thanks i tried it but now i have issue with StringRegExp if you could tell how to seacrh for services starting with oracle. thanks anyway. Link to comment Share on other sites More sharing options...
Xenobiologist Posted May 12, 2010 Share Posted May 12, 2010 No problem, if you post the output of my code posted before. 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...
sakshi Posted May 12, 2010 Author Share Posted May 12, 2010 here is a screen shot of the output . i have used a msgbox to view output. http://mbf.me/EBBu Link to comment Share on other sites More sharing options...
Fantastic Posted May 12, 2010 Share Posted May 12, 2010 (edited) Try this excelent UDF, it might solve your problem.Windows Services UDF from engineI'm using it on a small launcher and it works great. Edited May 12, 2010 by Fantastic [u]My current project:[/u] [size="1"]A bootable USB[/size]Webpage:*http://mylittlesoft.blogspot.com/ Link to comment Share on other sites More sharing options...
Xenobiologist Posted May 12, 2010 Share Posted May 12, 2010 here is a screen shot of the output . i have used a msgbox to view output.http://mbf.me/EBBuThere is nothing with the word Oracle in the screenshot. 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...
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