processes

This is a discussion on processes within the Windows Programming forums, part of the Platform Specific Boards category; I have a serious problem with windows booting up - the ony way i have found to stop a painfully ...

  1. #1
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385

    Lightbulb processes

    I have a serious problem with windows booting up - the ony way i have found to stop a painfully long boot up process is to kill the explorer.exe process and then restart it. I want to automate this, executing a new instance of explorer.exe is easy but i am having problems killing the process to begin with.

    How can i get the process identifier for explorer.exe?

    Or is there a way to terminate the process using its name and not by PID?

    PLease help

    WinXp(Home)\Dev C++
    Monday - what a way to spend a seventh of your life

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    On Windows XP:
    Code:
    taskkill /im explorer.exe
    Other methods for killing a process from code.

  3. #3
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385

    Question cannot taskkill

    I tried runing taskkill from the CL before coding it but get the unrecognised command error. Taskkill is not compatible with the the OS. (http://www.annoyances.org/exec/show/article10-002)
    Can anyone suggest a solution?

    WinXP(Home)\DevC++\
    Last edited by iain; 06-25-2004 at 08:47 AM.
    Monday - what a way to spend a seventh of your life

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    You can use an API route, but if you have WinXP then you should have WMI installed

    Code:
    	var strQry = "SELECT * FROM Win32_Process WHERE Name=\"explorer.exe\"";
    	var oExp = new Enumerator(GetObject("WinMgmts:").ExecQuery(strQry));
    	for(;!oExp.atEnd();oExp.moveNext())oExp.item().Terminate();
    Save as "KillExplorer.js" run it when you want explorer killed. You can run it from the commandline with "cscript KillExplorer.js"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 34
    Last Post: 05-27-2009, 12:26 PM
  2. Processes not dying
    By Elkvis in forum Linux Programming
    Replies: 12
    Last Post: 04-23-2008, 08:59 AM
  3. Stopping Processes Question
    By brett in forum Linux Programming
    Replies: 3
    Last Post: 06-24-2007, 10:15 PM
  4. binary tree of processes
    By gregulator in forum C Programming
    Replies: 1
    Last Post: 02-27-2005, 11:59 PM
  5. Computer Processes.... Which can be stopped?
    By Sevrin in forum Tech Board
    Replies: 3
    Last Post: 06-08-2003, 08:13 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21