# How to run a command line script every Friday at 3:00 AM automatically?

I currently use SWFTools via command line on my computer. I have two commands that I want to run every Friday at 3:00 AM automatically. However, I want to run the two scripts in a specific order. This is what I have:

At 3:00 AM on Friday I want to run this first:

.\swfcombine -o "C:\users\****\My Documents\****\****\****.swf" --dummy -y 50 "C:\users\****\My Documents\****\****.swf"


Then this:

.\swfrender "C:\users\****\My Documents\****\****\****.swf" -o "C:\users\****\My Documents\****\****.png"


How can I make this happen automatically? Any help would be highly appreciated!

-

Use Task Scheduler on a Windows system.

Trigger: Weekly
Recur every: 1 weeks on:
X Friday

Start a program

Put your two lines into a bat file, then put that file into your "Start a Program".

Your bat file might look something like this:

@ECHO OFF
REM This program first combines then renders swf files as png
"C:\Path\to\swfcombine" -o "%USERPROFILE%\Path\to\****.swf" --dummy -y 50 "%USERPROFILE%\Path\to\****.swf"
.\swfrender "%USERPROFILE%\Path\to\****.swf" -o "%USERPROFILE%\Path\to\****.png"


In Windows 8, the task scheduler looks like this:

-
Thank you. However, I'm not very familiar with bat files. Would I just place the lines I used in a file and call it file.bat? –  Gkhan14 Jan 2 '13 at 20:31
Yes, that's pretty much it. –  Nathan DeWitt Jan 2 '13 at 20:31
Great! I have another question, would I include the line "cd C:\users****\..." in the bat file? Sorry for the questions, I'm still learning. Haha! –  Gkhan14 Jan 2 '13 at 20:34
You should be able to use %USERPROFILE% in place of the C:\Users\<username> part of the path. You don't need to include the cd statement if you specify the exact path to the executables (%USERPROFILE%\path\to\program\swfrender) on those command lines. –  Darth Android Jan 2 '13 at 20:55