Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 10-27-2007, 01:21 PM   #1 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default Batch?

Can this be done with batch and if so how?

I have a folder located in c:\Program Files\Folder1

I need to empty this folder every week, and at the moment im doing it manualy by deleting the whole folder then creating a new one with the same name.

What is stored in this folder are hundreds of images from my security cameras that are just using far too much memory to be kept for more than 7 days, there must be something that can delete them automaticaly for me!

The "camera server" (basicaly just an old box) is on all the time so a batch file being open all the time (im gussing it would have to be?) wouldnt be a problem.

Thanks guys, is this possiable?
Yek is offline  
Old 10-27-2007, 03:45 PM   #2 (permalink)
void's Avatar
 
True Techie

Join Date: Oct 2005

Posts: 198

void

Default Re: Batch?

You can write a batch file like:
Code:
rmdir "C:\Program Files\Folder 1" /s /q
mkdir "C:\Program Files\Folder 1"
This deletes the directory Folder 1 and all its sub directories, and doesn't ask for confirmation. Then it creates the folder again. Put this in a *.bat file, then create a Scheduled Task. Create it so it runs the batch script every 7 days. Check the documentation for commands and arguments you can supply to those commands. You should be able to get the script to run at a specific time on a specific day of the week every week.
void is offline  
Old 10-27-2007, 04:57 PM   #3 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default Re: Batch?

Thanks, big help
Yek is offline  
Old 10-28-2007, 03:19 PM   #4 (permalink)
 
Banned

Join Date: Oct 2006

Posts: 81

williwaw

Default Re: Batch?

1. Click Start
2. Click Programs
3. Click Accessories, System Tools, and then Scheduled Tasks.

Once open, you'll be able to create your own custom task by clicking Add Scheduled Task, which will start you through the wizard, prompting you with what program you wish to execute, how often you wish to run it (daily, weekly, monthly, one time only, when my computer starts, and when I log on), the time you wish to run, and how often each day to run.
williwaw is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch File Help EnigmaX Programming Discussions 6 07-03-2007 07:07 AM
question on batch files, programmable keys, and context menus king vash Windows Operating Systems and Software 0 06-04-2007 12:28 AM
Batch Yek Programming Discussions 19 05-13-2007 09:17 PM
batch zipping? atomic tofu Windows Operating Systems and Software 1 05-01-2007 12:00 PM
Batch file steak1986 Windows Operating Systems and Software 6 04-11-2007 06:03 PM