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?

link|improve this question

78% accept rate
feedback

3 Answers

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.

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

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/

link|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
feedback

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!)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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