Batch-File Blues..

Discussion in 'Software' started by guest_12345, Jan 30, 2005.

  1. guest_12345

    guest_12345 Guest

    Here's my dilemma. In order to understand it better let me just tell you what I want the result of the task to be:

    Kill all processes EXCEPT the ones I tell you not to kill.

    I wan't to use the pslist & pskill utilities to accomplish this task but using a batch file to automate the procedure. Basically I want to somehow parse the output of pslist.exe and feed it to the pskill.exe utility in such a way that I can terminate all the processes in memory EXCEPT a few predefined ones such as "svchost.exe" obviously. Get it? Is this possible to do in a simple batch file or will this shiznit require some more thought?

    Please let me know if you can help. Much appreciated.
     
  2. Coco

    Coco Sergeant Major

    I don't think a batch file is capable of parsing the list. Not unless you can somehow generate just the process numbers. But then I"m not sure how you'd plan to identify what not to kill.

    I think you'd need to write a real program to accomplish this. It's just a little over what a batch file can do.
     
  3. help

    help Corporal

    use this command

    net stop {Service Name Here}

    so sometin like

    :::::::::::::::::::::::::::::::::::::::
    Echo On

    Echo "this Script will kill Desired processes"

    net stop {Service Name Here #1}
    net stop {Service Name Here #2}
    net stop {Service Name Here #3}

    :::::::::::::::::::::::::::::::::::::::

    etc ,
     
  4. Coco

    Coco Sergeant Major

    help, the whole question here is on how to parse the file to create a batch file like this, not write one manually. He's asking for it to kill any processes which is currently running besides from predetermined ones. Not kill predetermined processes, which is what that would do.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds