Re: Schedule Batch File-How to?
- From: Fred <Fred@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 5 Apr 2006 06:46:02 -0700
Hello Richard,
Thanks for the replay. I waited until the execution of the two scheduled
batch files, 02:55 AM (runs in 20 seconds or less) and the second 03:00 AM
(11 minutes to complete) had run successfully.
The process that was used was the one suggested by starting with Control
Panel > Scheduled Task etc. and the batch file name was used as the program
name. The batch file (quick on included) executed several commands and then
initiated a program for completion.
The destination locations were checked to insure execution had taken place
and the files successfully completed.
My other concern was that the computer would be in a "sleep" mode in that
all of the power conservation settings would have kicked in more than an hour
earlier. The three disk drives would be shut down too.
In your backup, I concluded you overwrite your file each time. I had wanted
some depth to the backup so a scheme was implemented that provides about 10
copies, or backup over 10 days. Hopefully any problems could be discovered
in that period.
The other issue that was a problem for a while, the blank space in file
names. Eventually I found out that quotation marks would solve the problem.
After creating the batch file, another reference indicated that only the file
name had to be in quotes. However, at that point, the older use of quotes
was working. If it ain't broke, don't fix it. I guess I'm just lazy.
In any case, the batch file has also been included for reference purposes.
Again, thank you very much for taking the time.
Fred
Echo Backup RoboForm File
echo Rev 20060404.0238
rem remove oldest file
del J:\backups\robobkup\roboback9.zip
rem shift all files up by 1
ren J:\backups\robobkup\roboback8.zip roboback9.zip
ren J:\backups\robobkup\roboback7.zip roboback8.zip
ren J:\backups\robobkup\roboback6.zip roboback7.zip
ren J:\backups\robobkup\roboback5.zip roboback6.zip
ren J:\backups\robobkup\roboback4.zip roboback5.zip
ren J:\backups\robobkup\roboback3.zip roboback4.zip
ren J:\backups\robobkup\roboback2.zip roboback3.zip
ren J:\backups\robobkup\roboback1.zip roboback2.zip
ren J:\backups\robobkup\roboback0.zip roboback1.zip
rem all files have been shifted. Begin backup
"c:\program files\pkware\pkzipc\pkzipc" -add -path=specify
J:/backups/robobkup/roboback0.zip "C:\Documents and Settings\MyName\My
Documents\My RoboForm Data\Default Profile\*"
echo RoboForm backup complete
"Richard In Va." wrote:
Hello Fred,.
I had the same question about a year ago.
Never found a (perfect) solution, however I did find an acceptable
workaround that works well for me.
From the top..... (For the benefit of others if needed)
Start>Settings>Control Panel>Scheduled Tasks.
Select "Add Scheduled Task" (This will open the "Scheduled Task Wizard")
Select the "Next" button.
In the Application List, Select the "Browse" button and browse to and select
the DOS or
Windows command that you are using within the batch file.
(Maybe located in C:\WINDOWS\system32\ or somewhere similar)
Using this approach, you will not be using the batch file anymore. But you
will be using the command line inside the batch file.
Select "Next" button.
Choose how often you want the task to run followed by the "Next" button.
(Can always change later if needed)
Choose the time of day for the task followed by the "Next" button.
The next window will ask for a password. Leave this blank and try not to
get excited about the warning.
This window will also display your computer name and your user login name.
Leave this field as is.
Select the "Next" button.
Apply a check to the "Open Advanced Properties" check-box and select
"Finish".
Answer "Okay" to the warning that pops up in the next window.
The properties window for the new scheduled task should now be open. If
not, double-click on the new task from the scheduled task listing.
In the advanced properties window for your new task, select the "Task" tab.
Apply a check to the "Run only if logged on" check-box.
Don't bother to add a password... you don't have one.
Here is where we get creative....
Note the command that is entered in the "Run:" field, should look like
this....
[Run:] C:\WINDOWS\system32\xcopy.exe
(I'm using the xcopy.exe command as an example)
Now open the batch file you created and have tested.
If your batch file contains only one command line your home free.
Copy-and-paste from the batch file the command and its parameters into the
task schedule "Run:" field.
You will want them to look the same.
Mine looks like this...
" C:\Windows\System32\xcopy.exe "E:\*.*" "F:\Backup of Documents Drive E" /E
/D /W /Y /I /R /K "
I'm using the xcopy.exe command to copy all (new or updated) files and
folders from partition drive (E) over to an external hard drive (F) every
day at 2:30PM as a scheduled task.
My drive (E) contains all my work related documents.
Cool Huh?
Now "apply" and close the task properties window and the task should run
according to the schedule (day/time) you selected.
If your batch file contained more than one (1) command line, You may need to
create a scheduled task for each command. (really not sure about this tho)
If what works well for me causes you problems. You might consider putting a
shortcut to the batch file on your desktop. You'll need to remember to
double-click the shortcut to run the batch file tho. Also, you could put
the shortcut in your startup folder. Then it will run each time you login,
pros-and-cons with this option as well I'm sure.
One last option is to create a script file to take the place of the batch
file. I think script routines co-exist much better with Windows (XP) and
task scheduler.
I don't know anything about scripts, maybe someone else can advise here.
Hope this is helpful!
Best regards,
Richard in Va.
+++++++++++++++++++++++++++++
"Fred" <Fred@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:10A69758-129A-43DC-A17D-6EBD575F7988@xxxxxxxxxxxxxxxx
I have a batch file I would like to schedule to run daily.
The attempt to use task scheduler and substitute the file.bat as the
program
did not work. I DO NOT have a password on my profile. There is an
administrator pw, but it is never needed. Now pw is ever needed.
I came across schtasks but did not know where to put it for execution,
unless it goes in the "program name" area of schedule task. However,
since
schedule task will have all the scheduling information, I was confused.
Assume I have a file batch.bat that I would like to have executed on
a
schedule, how do I do it?
I have already confirmed the batch file will run when executed in a dos
window.
Thank you.
Fred
- Follow-Ups:
- Re: Schedule Batch File-How to?
- From: Richard In Va.
- Re: Schedule Batch File-How to?
- References:
- Re: Schedule Batch File-How to?
- From: Richard In Va.
- Re: Schedule Batch File-How to?
- Prev by Date: Re: What Do I Do Now?
- Next by Date: Re: XP Product Key, Need to change from Volume Key to OEM Keys....HELP!!
- Previous by thread: Re: Schedule Batch File-How to?
- Next by thread: Re: Schedule Batch File-How to?
- Index(es):
Loading