hi guys i need a batch code that runs a file automatically in a specific time example : i have a file named as test.bat and i want to insert a code in it to make it runs at 1:00 am please help me
A cron job is a macro for a server... if your dealing with a batch file your referring to a user's local machine. The bottom line, they both do the same thing ... automate tasks on a schedule. But each has different coding.
I guess that is something we need "Sir" Najeeb to clarify. Is he doing it on his website or his own computer - if so is it a PC, Mac or Linux - hell, he could be trying to do it on an android tablet or his iphone?!! Then again he does say test.bat so it must be a PC, right?
A batch file can be executed in Windows, or Mac. Basically any DOS based system. A Cron job is for UNIX based systems. Most server use Linux and thus most cron jobs are referring to a server script. Again, same basic idea, just different terms. Also, to run any cron on an iphone, it must be jail broken.
Hi, Use the AT command for DOS, for Windows Vista and 7 use schtasks.exe for AT.exe use this command. Let's say you want to create a folder in the temp dir in C drive. Here's a batch file that creates a folder with the current date of the time it was created. folder.bat [path: C:\folder.bat] ------------- @echo off cd c:\temp set folder=%date:~10,4%%date:~7,2%%date:~4,2% mkdir %folder% move c:\temp c:\%folder% --------------------------- Then open cmd [Run as Administrator] execute this command so it will run only once at, for example, 8:30:00 PM >at.exe 20:30 /interactive C:\folder.bat And it will give you message: "Added a new job at job ID = 1" Then you can check the time and status with the command >at 1 For schtasks.exe use the following command: [with date: Jan 13 2012 and time 8:30 PM] >schtasks /create /tn "My Batch File" /tr C:\folder.bat /sc once /st 20:30:00 /sd 01/13/2012 Hit enter "SUCCESS: The scheduled task "My Batch File" has successfully been created. Then go to C:\temp folder and you should see a new created folder with the name of the current date [the date it batch file was executed]. Also, check out these sites for the command lists AT commmands : computerhope.com/at.htm schtasks: technet.microsoft.com/en-us/library/bb490996.aspx