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.

My company seems to be hit by a virus that calls shutdown -r on all workstations. Until IT figures it out, I want to:

  1. run a console program (shutdown-a) every minute
  2. without it flashing a cmd.exe window on the screen.

Any suggestions?

share|improve this question
add comment

3 Answers 3

up vote 4 down vote accepted

Seeing the timing does not have to be exact, I would just write a batch file like.

:Start
shutdown -a
ping -n 60 127.0.0.1
Goto Start

You do get one cmd prompt on-screen (which can be minimised), but it doesn't keep flashing up.

share|improve this answer
    
cool. I like the 'think outside the box' approach. –  Cristi Diaconescu May 11 '10 at 12:02
add comment

Could it be this problem http://www.f-secure.com/v-descs/msblast.shtml#details

Can you move shutdown.exe out of C:\windows\system32 temporarily? I do that on my XP machine and then from the command line shutdown -a fails, can't find the command

Running a command minimized http://www.winhelponline.com/blog/run-bat-files-invisibly-without-displaying-command-prompt/

share|improve this answer
1  
Actually, it's probably because his company is using McAfee Anti-Virus. The DAT file pushed today is bad. McAfee Community Thread and ArsTechnica Discussion –  afrazier Apr 21 '10 at 18:18
    
Yep. Big plus to @afrazier. Those were a few fun days for everybody (especially the IT guys) in the company... Thanks McAfee! –  Cristi Diaconescu May 11 '10 at 12:33
add comment

If you're able to install things, or just have python lying around anyway (Because let's face it, why not?)

import time, os
while 1:
    os.system("shutdown.exe -a")
    time.sleep(60)

Save that in a .pyw file, and run it. (I used this very basic idea to make a full-on scheduler a-la cron, to do all sorts of neat things. Useful!)

share|improve this answer
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.