Results 1 to 10 of 10
  1. #1
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    WAITTIL utility?

    Please could anyone point me at an NT4/W2K/WXP utility which would wait until a user-specified day-of-the-week and time in the future (without chewing up the CPU). <img src=/S/yawn.gif border=0 alt=yawn width=15 height=15>

    Syntax would be something like
    WAITTIL DoW hh mm ss
    for example
    WAITTIL Thu 14 59 03

    Yes, I could do it in BATch, but I'm getting overwhelmed with writing stuff at present!
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: WAITTIL utility?

    Why not use the AT command to do this? It's built in and won't chew up any resources; usually it's running as a service anyway. You can run something local or on a remote server.

    The syntax (AT /?):

    <pre>The AT command schedules commands and programs to run on a computer at
    a specified time and date. The Schedule service must be running to use
    the AT command.

    AT [computername] [ [id] [/DELETE] | /DELETE [/YES]]
    AT [computername] time [/INTERACTIVE]
    [ /EVERY:date[,...] | /NEXT:date[,...]] "command"

    computername Specifies a remote computer. Commands are scheduled on the
    local computer if this parameter is omitted.
    id Is an identification number assigned to a scheduled
    command.
    /delete Cancels a scheduled command. If id is omitted, all the
    scheduled commands on the computer are canceled.
    /yes Used with cancel all jobs command when no further
    confirmation is desired.
    time Specifies the time when command is to run.
    /interactive Allows the job to interact with the desktop of the user
    who is logged on at the time the job runs.
    /every:date[,...] Runs the command on each specified day(s) of the week or
    month. If date is omitted, the current day of the month
    is assumed.
    /next:date[,...] Runs the specified command on the next occurrence of the
    day (for example, next Thursday). If date is omitted, the
    current day of the month is assumed.
    "command" Is the Windows NT command, or batch program to be run.</pre>

    -Mark

  4. #3
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: WAITTIL utility?

    Neither the AT schedule service nor Task Scheduler is any use to me in this instance, since I want the utility to pause within a BATch file. I need to run something every ten minutes for 07:00 to 18:00 Mon-Fri, and at 18:00 on Sat and Sun. I'd like to have it self-contained when started! But thanks for the suggestion.
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  5. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: WAITTIL utility?

    If the machine has the CSCRIPT.EXE command-line VBScript program, you can do this with the Sleep method of the Windows Script Host. This assumes you have time to re-code the BAT file as a VBS file.

  6. #5
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: WAITTIL utility?

    Sorry, I can cope with no more than one area of expertise, and that's BATch files!
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  7. #6
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: WAITTIL utility?

    I came across a couple of methods here but they both use 100% cpu.
    Are you wanting the batch file to be running continuously, or are you looking for some external trigger to start/resume a batch file every 10 minutes?
    Are you simply looking for a nominal 10 minute delay, or something that will run at 07:00, 07:10, 07:20 etc.

  8. #7
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: WAITTIL utility?

    Hi Lief!

    I was imagining that I would start the BATch file automatically on a reboot, and it would run "continuously", waking itself up at the approriate times to do its work, then sleep until the next time. It would be easy enough to work out "during weekday prime shift" when the next ten-minute time was via WAITTIL Wed 08 30 00 (for example), with the "next" time being calcuated from the current time.

    John

    PS you don't write KiXtart, do you?
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  9. #8
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: WAITTIL utility?

    Sorry, I can't see a way, unless you can get the BATch file to re-write an AT command, then exit.

    PS. No!

  10. #9
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    Cincinnati, Ohio, USA
    Posts
    7,089
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: WAITTIL utility?

    The SLEEP.EXE utility is a supplemental utility that is included in several Microsoft resource kits. I don't know how the licensing pertains to its use, but you can look at the Tools Included with the Microsoft Windows 98 Resource Kit (Q247024) article for starters. It originated in the Windows NT 4.0 Resource Kit. It's also in the Small Business Server 2000 Resource Kit and likely a few others that I can't verify.

    Much more advanced than a utility like this and I think you are looking at some scripting using the Windows Scripting Host or something similar.
    -Mark

  11. #10
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: WAITTIL utility?

    Yes, I often <font color=blue>SLEEP</font color=blue> and also <font color=blue>PING -n [secs+1] 127.0.0.1 > NUL</font color=blue>, and I would use the one or the other of these according to which day of the week it is. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    If I can get the scheduler to work properly on the server, I will look into the Reschedule method - but I've found that scheduled jobs can start almost anwhere in the "minute" for which they are scheduled.
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •