Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got an old Windows NT Server machine that doesn't have a scheduled tasks feature. I know about AT, but I need to schedule a task to run every 5 minutes. I've looked at cron for windows, but I don't really know anything about it (is it any good?)

What are some good alternatives to scheduled tasks?

share|improve this question

5 Answers 5

up vote 1 down vote accepted

Only a modem and not much desire to download big installs, eh?

You can do what we did "back in the day" with the "AT" scheduler:

@echo off
for /l %%i in (0,1,23) do (
  for /l %%d in (0,5,55) do (
   at %%i:%%d /EVERY:M,T,W,Th,F,S,Su "c:\cron\five-minutes.cmd"
  )
)

It's a hack, but it works! It's only 288 entries-- the box really can handle it fine.

share|improve this answer
    
Well played, sir :-) –  Anthony Lewis Jul 10 '09 at 19:34

At this point, I'll do anything to avoid interacting with NT. Can you schedule the task from another server using psexec to execute it on the NT box? Yes, it's hackish, but the lesser evil versus touching NT. ;)

share|improve this answer
1  
Bah! Touching NT isn't that bad. I won't touch Windows 9X anymore (I break out in hives), but NT is fine. It's a little bit like talking politics with my grandparents. It's out of touch and a bit backward, but in an endearing way. It's still basically a good, decent operating system, but it came from a simpler time. Some of its eccentricities (anonymous SID resolution, privileged APIs with improperly validated inputs) are socially unacceptable today, but back when it was growing up... (Okay, I've taken the analogy a little too far!) –  Evan Anderson Jul 10 '09 at 19:33

Task Scheduler will be available if you install the offline browsing pack.

Microsoft KB article

share|improve this answer
    
Since the offline browsing pack was a component of IE5, here's a link for 5.5, which should still contain the necessary files. brothersoft.com/internet-explorer-download-60634.html –  Jeremy Viet Jul 10 '09 at 19:00
    
Yeah, I know about that. I'm really looking for an alternative. This is a computer that only has modem access and I don't really want to upload the 84MB IE install. –  scottm Jul 10 '09 at 19:01

Do you need to run the task every 5 minutes indefinitely? If so, you grab a copy of the sleep.exe file from the Windows 2003 Resource Kit and set up a batch file like this:

:start
yourtask.exe
sleep 600
goto start

Note that I haven't actually tested the sleep command on Windows NT, but it should work.

share|improve this answer
    
but then I have a cmd window just sitting and waiting all the time. –  scottm Jul 10 '09 at 19:11
    
Yeah-- that makes me feel icky. –  Evan Anderson Jul 10 '09 at 19:22
    
True, but this seemed like the simplest solution to me. –  Anthony Lewis Jul 10 '09 at 19:26
    
The NT servers should already be giving you the icky feeling.. –  andymoe Jul 10 '09 at 19:34
    
See my comment to Kara re: NT. >smile< Now, Windows 9X... Let's just say that I'd be projectile vomiting having to deal with that. –  Evan Anderson Jul 10 '09 at 19:39

I have a few legacy servers where I have to do this sort of thing, and I use:

rem Get the day number. When the day number changes that signals
rem the script to exit.

for /f "tokens=1" %%i in ('date /t') do set THEDATE=%%i
set THEDAY=%THEDATE:~0,2%

rem Start the loop

:start

rem Execute comamnds

echo Run your command here

rem Pause for 5 minutes

sleep 15
rem or ping 1.1.1.1 -n 300 if you don't have sleep.exe

rem Check the day number. If it is still the same loop back to the
rem start of the monitoring loop.

for /f "tokens=1" %%i in ('date /t') do set THEDATE=%%i
if %THEDATE:~0,2% == %THEDAY% goto start

If you start this shortly after midnight it runs for 24 hours then stops, ready to be launched again.

JR

share|improve this answer

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.