Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Need help with DOS Date comparing

05 Aug 2011   #1

Windows 7 32bit Enterprise
 
 
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 System SpecsSystem Spec
.

05 Aug 2011   #2

Microsoft Community Contributor Award Recipient

Windows 7 x64
 
 

The task scheduler has had major improvements since xp.
I use mine to run similar tasks all the time without issue.
My System SpecsSystem Spec
05 Aug 2011   #3

XP / Win7 x64 Pro
 
 

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


05 Aug 2011   #4

Windows 7 32bit Enterprise
 
 

I'm going to give it a go. Thanks for your help!
My System SpecsSystem Spec
05 Aug 2011   #5

Windows 8.1 Pro RTM x64
 
 

Do you want this script to run just once on a certain date, or every day after and including that date?
My System SpecsSystem Spec
05 Aug 2011   #6

Windows 7 32bit Enterprise
 
 

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 System SpecsSystem Spec
05 Aug 2011   #7

Windows 8.1 Pro RTM x64
 
 

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 System SpecsSystem Spec
05 Aug 2011   #8

Windows 7 32bit Enterprise
 
 

Just need a message displayed.
My System SpecsSystem Spec
05 Aug 2011   #9

Windows 8.1 Pro RTM x64
 
 

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.

Name:  Capture.png
Views: 1
Size:  37.8 KB

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.

Name:  Capture1.PNG
Views: 1
Size:  40.6 KB Name:  Capture2.PNG
Views: 1
Size:  37.6 KB

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.

Name:  Capture3.PNG
Views: 1
Size:  25.6 KB Name:  Capture4.PNG
Views: 1
Size:  37.2 KB

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 System SpecsSystem Spec
05 Aug 2011   #10

Windows 7 32bit Enterprise
 
 

That worked, thank you!

Used the same directions, but tweaked to start vbs script. Still worked. Much appreciated!
My System SpecsSystem Spec
Reply

 Need help with DOS Date comparing




Thread Tools



Similar help and support threads for2: Need help with DOS Date comparing
Thread Forum
Comparing Fonts Microsoft Office
New site for comparing CPU's Hardware & Devices
Comparing copied files: How to Installation & Setup
Solved SSD Comparing 3 m4's Hardware & Devices
File search (by date range) displays incorrect Mod Date in results General Discussion
Date format using space as date separator rather than forward slash! General Discussion
Comparing all editions. Installation & Setup

Our Sites

Site Links

About Us

Find 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 04:58 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33