Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Re: how can i create a Batch file to kill some processes by name

Reply
Thread Tools Display Modes

Re: how can i create a Batch file to kill some processes by name

 
 
Andrew Mishechkin
Guest
Posts: n/a

 
      10-01-2008
Here my cmd-file: pskill.cmd
-------------
@ECHO OFF
REM Using this bat-file: pskill ProcessName [RemoteComputerName] [UserName]
[UserPassword]
IF "%1"=="" (GOTO Error)
IF "%2"=="" (SET NodeName=.) ELSE (SET NodeName=%2)
IF NOT "%3"=="" (GOTO AnotherUser)
wmic /NODE:%NodeName% PROCESS WHERE (name="%1") CALL TERMINATE
GOTO End

:AnotherUser
SET UserName=%3
IF NOT "%4"=="" (SET Password=%4) ELSE (SET Password="")
wmic /NODE:%NodeName% /User:%UserName% /Password:%Password% PROCESS WHERE
(name="%1") CALL TERMINATE
GOTO End

:Error
ECHO Using this bat-file: pskill ProcessName [RemoteComputerName] [UserName]
[UserPassword]

:End
------------------
With best regards
Andrew Mishechkin

"Hansel Ortiz -[BrEcHaWarr]" <> сообщил/сообщила в
новостях следующее:
news:2018fa9c-896b-459e-9953-...
> hi guys... i`ll be searching in the web trying to find a script to
> kill one or various process, but i just can find
> how to kill process by pid.
>
> how can i to this.... just searching the name process like Starting
> with X.... or task%..
> something like that.. if someone could help..
>
> i couldn`t find the sintax of the taskkill to refer this command to a
> name.. just pid and others...
>
>
> thanks


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't kill some processes Brataq Windows Vista General Discussion 17 09-11-2009 04:07 PM
Re: how can i create a Batch file to kill some processes by name Pegasus \(MVP\) Scripting 1 09-23-2008 10:03 PM
How to create a script in a DOS batch file to do a loop? Jon Osborn Scripting 2 05-27-2008 01:11 PM
Unable to kill processes Faheem Windows Media Center 0 10-01-2006 01:20 AM
Create a Service trought a batch file barbara Windows Server 1 04-11-2005 03:35 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59