Results 1 to 2 of 2

Thread: Off Topic? Batch file, check time,load specific program

  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    1
    Thanks
    0
    Thanked
    0 times in 0 posts

    Off Topic? Batch file, check time,load specific program

    I was wondering if you gurus can give me some direction...

    I run a Specials Menu on a large LCD TV at a restaurant using powerpoint. There are two specials files (lunch.pps and dinner.pps)
    When this system reboots, i want a batch file to determine which powerpoint file to open based on what time it is.

    ON BOOTUP: For instance, if it's anywhere between 11am and 3pm, open the lunch file. If its any other time, run the dinner.pps file. Make sense?

    Im already running a scheduled tasks application that shuts down one and starts up the other based on what time. This works very well. Problem is, i frequently Remote Desktop into this machine and make changes. Once those changes are made, i have to reboot the system. I then want this batch file to start the appropriate presentation since the scheduled task application only works when it sees 11am or 3pm (as in the example above)

    I figured since you can determine time and date within a batch file, can't you do an if /then/else type script within a batch? (if its *this time* then load THIS application)

    Does anyone know what the syntax is to do this?

    Thank you, and im sorry if this is off-topic


  2. #2
    Senior Member
    Join Date
    Jan 2009
    Location
    London
    Posts
    350
    Thanks
    6
    Thanked
    48 times in 42 posts
    • sadbuttrue's system
      • Motherboard:
      • Gigabyte P55 UD5
      • CPU:
      • i5 750 @ 3.8ghz + Megahalems + GT1450 @ 5v
      • Memory:
      • G.Skill ECO 4GB 1.4v
      • Storage:
      • Intel 320 120gb + Samsung F4 2tb in Scythe Quiet Drive
      • Graphics card(s):
      • 6950 @ 940/1350/1.175v + Shaman @ 20%
      • PSU:
      • Corsair AX750
      • Case:
      • Raven RV02 with 3xPhobya G-Silent Fans @ 210rpm + Scythe S-Flex 1200 @ 5v
      • Operating System:
      • Windows 7
      • Monitor(s):
      • Samsung 2233rz, Dell 2209wa, Panasonic AX200 Projector
      • Internet:
      • BeThere 24mb

    Re: Off Topic? Batch file, check time,load specific program

    A simple vbs (vb script) will be much simpler. Put this in a file with a .vbs extension:

    Code:
    on error resume next
    err.clear
    dim cur_hour
    dim obj_shell
    
    cur_hour = hour(now)
    
    set obj_shell = CreateObject("WScript.Shell")
    
    if (cur_hour>=11 and cur_hour<=15) then
      obj_shell.run "lunch.pps" 
    else
      obj_shell.run "dinner.pps" 
    end if

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 63
    Last Post: 14-11-2011, 09:17 AM
  2. Dodgy DVD-r's ?
    By starside in forum Help! Quick Relief From Tech Headaches
    Replies: 12
    Last Post: 27-03-2005, 06:11 PM
  3. How do you backup?
    By Howard in forum PC Hardware and Components
    Replies: 48
    Last Post: 05-01-2005, 09:05 AM
  4. Batch file help
    By wol in forum Software
    Replies: 11
    Last Post: 21-10-2004, 10:09 AM
  5. Batch File
    By mrdata2003 in forum Software
    Replies: 4
    Last Post: 26-01-2004, 06:25 PM

Posting Permissions

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