Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Stéphane [MS]
Bonjour,
Depuis Scrip Center :
Terminate a process : =================================== strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!" & strComputer & "rootcimv2")
Set colProcessList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = 'Notepad.exe'")
For Each objProcess in colProcessList objProcess.Terminate() Next ======================================= Create a Process on a Remote Computer ======================================= strComputer = "webserver" Set objWMIService = GetObject _ ("winmgmts:" & strComputer & "rootcimv2:Win32_Process")
If Error = 0 Then Wscript.Echo "Notepad was started with a process ID of " _ & intProcessID & "." Else Wscript.Echo "Notepad could not be started due to error " & _ Error & "." End If ======================================= Cdlt Stéphane
"Casso" a écrit dans le message de news: %
Bonjour,
Serait il possible de savoir comment faire un script pour arreter un logiciel et le re-démarrer dans la foulée (sous 2000 srv)
Merci de votre aide
Bonjour,
Depuis Scrip Center :
Terminate a process :
=================================== strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\" & strComputer & "rootcimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'Notepad.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
=======================================
Create a Process on a Remote Computer
======================================= strComputer = "webserver"
Set objWMIService = GetObject _
("winmgmts:\" & strComputer & "rootcimv2:Win32_Process")
If Error = 0 Then
Wscript.Echo "Notepad was started with a process ID of " _
& intProcessID & "."
Else
Wscript.Echo "Notepad could not be started due to error " & _
Error & "."
End If
=======================================
Cdlt
Stéphane
"Casso" <ticasso@free.fr> a écrit dans le message de news:
%23HK2ZDrGGHA.3700@TK2MSFTNGP15.phx.gbl...
Bonjour,
Serait il possible de savoir comment faire un script pour arreter un
logiciel et le re-démarrer dans la foulée (sous 2000 srv)
Terminate a process : =================================== strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!" & strComputer & "rootcimv2")
Set colProcessList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = 'Notepad.exe'")
For Each objProcess in colProcessList objProcess.Terminate() Next ======================================= Create a Process on a Remote Computer ======================================= strComputer = "webserver" Set objWMIService = GetObject _ ("winmgmts:" & strComputer & "rootcimv2:Win32_Process")
If Error = 0 Then Wscript.Echo "Notepad was started with a process ID of " _ & intProcessID & "." Else Wscript.Echo "Notepad could not be started due to error " & _ Error & "." End If ======================================= Cdlt Stéphane
"Casso" a écrit dans le message de news: %
Bonjour,
Serait il possible de savoir comment faire un script pour arreter un logiciel et le re-démarrer dans la foulée (sous 2000 srv)