Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Ok, I was goofing around on the command line, and I was trying to see if I could use an endless loop to cause a visual effect on the screen. Fooling around with ASCII Art. I started out using timeout /t 1 after each echo, but that was did not allow the output to swap fast enough, even with the window shrunk into a little 1" x 1" square (w/ small fonts).

Anyway, I wanted to halve that 1 second timeout, and while I was trying to remember what I'd called my batch file that uses VBS's sleep command, I stupidly left out any timeout at all, and of course my machine ground to a virtual halt as that version of cmd.exe grabbed nearly every available cpu cycle.

I've tried to use the graphical taskman.exe to kill the process, but somehow right clicked on it and now have an uncloseable 2 item context menu, below which flicker all the processes running and which I can't click on or even sort. But even without it I suspect I'd still have trouble using it.

When I try to use TASKKILL.EXE terminate any process, I get:

ERROR: This operation returned because the timeout expired.

And sometimes get:

ERROR: Server execution failed.

I've searched unsuccessfuly for any information on extending that timeout for the past several hours using just my Nook, and I've nearly given up. I really don't want to just shut it down because there is stuff open I need to save, but it looks like I may have to take my lumps and kill the power.

Any ideas I could use to close that runaway process / eliminate TASKILL's timeout I'd REALLY appreciate.


EDIT: Harry wanted to know what code caused this behavior, so I'm adding the code with the suggestion that no one runs it unless they are prepaired to hard-power-off their computer.

I don't recall the exact design I was printing, I tried to save it, but obviously failed, but here is the code:

@for /l %x in (0 0 1) do (
echo.
echo.
echo  ASCII Art
echo  ASCII Art
echo  ASCII Art
echo  ASCII Art
echo  ASCII Art
echo.
REM @timeout /t 1 > nul
echo.
echo.
echo.
echo  ASCII Art
echo  ASCII Art
echo  ASCII Art
echo  ASCII Art
echo  ASCII Art
echo.
REM @timeout /t 1 > nul
echo.
echo.
)
share|improve this question

migrated from stackoverflow.com Sep 20 '12 at 19:38

This question came from our site for professional and enthusiast programmers.

    
You should be able to kill cmd.exe simply by closing the associated console window. –  Harry Johnston Sep 20 '12 at 1:38
    
@HarryJohnston - "Should" being the pivital word in that sentence. The process is eating so many cycles it ignores any attempt to close it. In fact, I may have suceeded in actually closing the window, but something is still hogging the CPU. Unfortunatelly the uncloseable task manager has itself and some othrt process flickering at top of it's process list showing 99% CPU. I only see one C:\` icon in the taskbar but TASKLIST`, when it works, shows two CMD.EXE tasks. Obviously one of them, I assume PID 8708, somehow managed to survive after the window dissapeared. –  James K Sep 20 '12 at 2:57
    
I'm puzzled as to what's causing this behaviour in the first place. Did you artificially increase the priority of one of the processes? I assume you've tried control-alt-delete? –  Harry Johnston Sep 20 '12 at 4:30
    
Have you tried pskill (downloadable from Microsoft's web site) instead of taskkill? –  Harry Johnston Sep 20 '12 at 4:34
1  
More likely there was a hardware problem already and that was what was causing the issue. You shouldn't get those sort of symptoms just because a program is running at 100% CPU. (I just ran your code on a test machine here and, as expected, it caused no problems at all.) –  Harry Johnston Sep 20 '12 at 20:18
show 3 more comments

1 Answer

up vote 1 down vote accepted

It is likely that these symptoms were caused by a hardware problem. Either that or a corrupt OS (malware infection, buggy device drivers, incompatible security software, etc.).

You shouldn't get those sort of symptoms just because a program is running at 100% CPU. (I just ran your code on a test machine here and, as expected, it caused no problems at all.)

To address the original question, the timeout in question is likely to be an internal operating system timeout (to prevent deadlocking) rather than anything specific to taskkill, so (a) there is no way to extend it; and (b) it probably wouldn't have helped if you could.

share|improve this answer
    
I did eventually figure out the problem. My laptop's cooling fan was dieing, and so the motherboard was overheating, causing, among other things, the CPU to go to 1/2 and eventually 1/4 speed. So other weird things are to be expected in such a situation. –  James K Jul 29 '13 at 19:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.