Need help with DOS Date comparing

Page 1 of 2 12 LastLast

  1. Posts : 22
    Windows 7 32bit Enterprise
       #1

    Need help with DOS Date comparing


    Greetings,

    I know that this is a Windows 7 forum, but I thought I would give it a try.

    My ultimate goal is to have a vbs script run after a certain date on a computer image.

    I thought that this would be best done with a simple batch file. In Windows XP, whenever you would create a Scheduled Task and run Sysprep, the task would not run because it loses credentials and must be restored in order to work. I don't know if this is true in Windows 7, but not to take the chance, I'm thinking using the Registry Run option to point to the batch file each bootup.

    I think it might be simple to do, but I can't figure it out. I'm open to other options as well. But for now here's my for example,

    if "%date%"=="Fri 10/28/2011" echo %date%


    I need it to check to see if it's "Fri 10/28/2011" or any day after, so something like...

    if "%date%"== or >"Fri 10/28/2011" echo %date%

    Thanks!
      My Computer


  2. Posts : 6,668
    Windows 7 x64
       #2

    The task scheduler has had major improvements since xp.
    I use mine to run similar tasks all the time without issue.
      My Computer


  3. Posts : 1,814
    XP / Win7 x64 Pro
       #3

    Task scheduler has the option to run as administrator, which would work for your scenario. Why not try it and see?
      My Computer


  4. Posts : 22
    Windows 7 32bit Enterprise
    Thread Starter
       #4

    I'm going to give it a go. Thanks for your help!
      My Computer


  5. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #5

    Do you want this script to run just once on a certain date, or every day after and including that date?
      My Computer


  6. Posts : 22
    Windows 7 32bit Enterprise
    Thread Starter
       #6

    yes, every day after a certain day.

    I tried the Windows Task Scheduler, for Windows 7. Very different interface from XP, looks more capable. However, when I scheduled the task to run under a different admin account (not administrator), it says it ran successfully, but I see nothing happening when logged in as administrator.

    The vbs script is a simple popup message. I need this message to appear everyday after a certain date regardless of what user is logged on. Can this be done? If so, what am I doing wrong that prevents the scheduled task to not only run, but display the popup under the currently logged in account?
      My Computer


  7. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #7

    Is the purpose of this just to display a simple message? Or to carry out some other function as well as display the message?
      My Computer


  8. Posts : 22
    Windows 7 32bit Enterprise
    Thread Starter
       #8

    Just need a message displayed.
      My Computer


  9. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #9

    Try this with Task Scheduler.

    Open Task Scheduler (may need to provide administrative credentials if not opened from within an administrator account).

    Click Create Task...

    This will open the following dialogue panel, with the General tab selected. Give the task a suitable Name and Description. Also, change the other settings (if different) to match those shown below.

    Need help with DOS Date comparing-capture.png

    Click the Triggers tab and then click New...

    Enter the settings as shown below (you can set the date to whatever you want) and click OK.

    Need help with DOS Date comparing-capture1.png Need help with DOS Date comparing-capture2.png

    Click the Actions tab and then click New...

    Enter the settings as shown below (note that you can change the message to whatever you want it to display) and click OK.

    Need help with DOS Date comparing-capture3.png Need help with DOS Date comparing-capture4.png

    Since we don't need to change any further settings, click on OK to finish creating the task.

    Click Task Scheduler Library to bring up the list of tasks, highlight the one you've just created and click Run to test it.

    The task will now run at log-on on and after the date specified
      My Computer


  10. Posts : 22
    Windows 7 32bit Enterprise
    Thread Starter
       #10

    That worked, thank you!

    Used the same directions, but tweaked to start vbs script. Still worked. Much appreciated!
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:00.
Find Us