Saved Bookmarks
| 1. |
Solve : Run a file every ...? |
|
Answer» Does someone know how to run a batch file on the 25 till the 31(30) of every MONTH? I know you should use the command: at and /date or something, but it doesn't seem to work with me. I'd use the task scheduler of Windows XP if XP Pro... The easy way! 8-) I'd like to do it in batch. I know it is possible with a task scedular but a lot of batch commands are possible to do in the graphical windows too!This depends on the format of your %date% variable, but this will work for ddd mm/dd/yyyy: Code: [Select]set day=%date:~7,2% if %day% LEQ 31 if %day% GEQ 25 dosomething dosomething is a placeholder for you to, well, do something I don't really undesrstand wath this script would do? Like I think the script would do something if the computer date is 25/31 of the month. But then you have to open the script on that date(s). What my intention was, open the script on a random date, and plan it to open a file on the 25th/31th of the month.. How should you do that?Quote Does someone know how to run a batch file on the 25 till the 31(30) of every month The script posted will only do something if the day of the month is equal or greater than 25 and the day of the month is less than or equal to 31. Both conditions must be true. As mentioned the dosomething is merely a placeholder. Put in your own command. 8-)Yeah, but what I MENT is that the batch file make a task in windows scheduled tasks and that that task would execute a other batch file at the 25fth and the 30th of every month. I have looked up a long time for such thing but every example doesn't work! even the example that DOS gives itself doesn't work AT 23:30 /EVERY:m,t,w,th,f,s,su c:\backups\every_day.cmd even taht one doesn't work Gotcha! I misunderstood and thought you wanted the 25th thru the 31st and that you didn't want to use the scheduler. The problem with the scheduler is that batch and Windows use two very different API's. In the batch world you can use the AT command, and in Windows you can use either the GUI or a Windows Script. In the batch world you can try this: AT 23:30 /EVERY:25,31 c:\backups\monthly.cmd An example of a Windows script can be found at: How Can I Manage Scheduled Tasks Using Scripts? Good luck. 8-) Note: The GUI can see all the jobs on the schedule, the AT utility can only see jobs it actually put on the schedule. PS. I have no idea what will happen if a month does not have a 31st day, but February is right around the CORNER...let us know That worked, tnx. If you want to speed up the progress, you could just adjust your clock i think, to see if it would work in february I think I'll let you handle that part |
|