jcaspar Posted November 6, 2006 Share Posted November 6, 2006 bonjour à tous !Je viens de réaliser un petit script autoitil me manque le test de la présence du servicepourriez vous m'aider à résoudre ce petit problème ?Merci d'avance pour vos conseils et votre aide demarrage avec les droits administrateursrunasset("administrateur",@Computername,"****");ne rien afficher pour l'utilisateurBreak(0) ;;supprimer le répertoire ocs-ngDirRemove("C:\Ocs-ng", 1); si le service ocs inventory service existe sortir de l'applirun("OcsAgentSetup.exe")Func ServiceExists($szService) RegRead("HKLM\SYSTEM\CurrentControlSet\Services\" & $szService,"OCS INVENTORY Service") Return Not @errorEndFunc sleep(1000);fenetre active "installation de ocs inventory agent"WinWaitActive("Installation de OCS Inventory Agent 4.0.2.6");si la fenetre existeIf WinExists("Installation de OCS Inventory Agent 4.0.2.6") Then; enterSend("{ENTER}");attente 1000 millisecondessleep(1000);enterSend("{ENTER}");attente 1000 millisecondessleep(1000);tabSend("{tab}");attente 1000 millisecondessleep(1000);taper nas-dd68Send("nas-dd68");entersleep(1000)Send("{ENTER}");attente 1000 millisecondessleep(1000);enterSend("{ENTER}");attente 1000 millisecondessleep(1000);enterSend("{ENTER}");message Installation 60 secondessleep(2500)msgBox (4096,"Installation Client OCS","Installation réussie",2)EndIf Link to comment Share on other sites More sharing options...
GaryFrost Posted November 6, 2006 Share Posted November 6, 2006 (edited) i think your needing to add a call to the function from what I see you have there after the run je pense votre devoir ajouter un appel à la fonction de ce que je vous vois avoir là après la course ServiceExists("service name") C'est un forum anglais, vous obtiendra plus d'aide si on pose les questions en anglais Edited November 6, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
jcaspar Posted November 7, 2006 Author Share Posted November 7, 2006 Thanks a lot for your answer ! but my function doesn't do i what i would like ...i would like that it test if a service exist and if exists that the application close.Also i have other question i would like that the user don't see the execution processof autoit is it possible to hide it ?Thanks a lot for your help and tricks ! Jean Marc Link to comment Share on other sites More sharing options...
GaryFrost Posted November 7, 2006 Share Posted November 7, 2006 expandcollapse popup#NoTrayIcon $szService = "service name here" RunAsSet("administrateur", @ComputerName, "****") ;ne rien afficher pour l'utilisateur Break(0) ; If ServiceExists($szService) Then Exit ;supprimer le répertoire ocs-ng DirRemove("C:\Ocs-ng", 1) ; si le service ocs inventory service existe sortir de l'appli Run("OcsAgentSetup.exe") Sleep(1000) ;fenetre active "installation de ocs inventory agent" WinWaitActive("Installation de OCS Inventory Agent 4.0.2.6") ;si la fenetre existe If WinExists("Installation de OCS Inventory Agent 4.0.2.6") Then ; enter Send("{ENTER}") ;attente 1000 millisecondes Sleep(1000) ;enter Send("{ENTER}") ;attente 1000 millisecondes Sleep(1000) ;tab Send("{tab}") ;attente 1000 millisecondes Sleep(1000) ;taper nas-dd68 Send("nas-dd68") ;enter Sleep(1000) Send("{ENTER}") ;attente 1000 millisecondes Sleep(1000) ;enter Send("{ENTER}") ;attente 1000 millisecondes Sleep(1000) ;enter Send("{ENTER}") ;message Installation 60 secondes Sleep(2500) MsgBox(4096, "Installation Client OCS", "Installation réussie", 2) EndIf Func ServiceExists($szService) RegRead("HKLM\SYSTEM\CurrentControlSet\Services\" & $szService, "OCS INVENTORY Service") If @error Then Return 0 Return 1 EndFunc ;==>ServiceExists SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. 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