ayarikhaoula
Messages postés126Date d'inscriptionvendredi 13 août 2010StatutMembreDernière intervention15 août 2011
-
1 mars 2011 à 09:22
NHenry
Messages postés15113Date d'inscriptionvendredi 14 mars 2003StatutModérateurDernière intervention22 avril 2024
-
1 mars 2011 à 12:51
salut tout le monde.je souhaite développé un script vbs qui tue un processus encour d'éxécution si son nom contient une chaine donné.voici mon script mon problème c'est qu'il génère une erreur:argument ou appel de procédure incorrecte "INSTR"
Set objWMI = GetObject("winmgmts:root\cimv2")
sQuery = "Select * from Win32_process"
For Each oproc In objWMI.execquery(sQuery)
Wscript.echo oproc.Name
'& " = " & oproc.ExecutablePath
dim p
pos = InStr(0, oproc.Name , "ma_chaine")
if p<> 0 then
oproc.Terminate()
end if
Next
Set objWMI = Nothing
merci pour vos aide.