![]() |
Batch files. I dunno if this is the best section for this, buuuut whatever. It's been years since I touched a batch file. Anyone interested in helping me write one? I want to empty out a folder every time I reboot. I've got a folder on a disk where chrome saves anything I specifically download (Not cache, cookies etc) I want it to clear automatically for me. I can handle the syntax regarding folder/drive locations I just don't know what commands to use... duuuur Thanks! |
Oh man its been a while... but i might be able to get you going in the right direction, as I think it's fairly simple... cd c:\<insert your path to folder with the files to be deleted> del *.* write that in notepad or similar, save as .bat and put in your startup folder. Done? |
Quote:
Haha those commands are so old school.. I really didn't think it'd be that simple.. Thanks! If anyone else knows different; let me know! |
Quote:
|
The "are you sure" prompt comes up when I run it manually.. will that get in the way? EDIT: Oddly enough, running it manually does NOT work. I put files in the folder and I can't delete them. I receive no errors or messages in cmd. It just goes through with it but the files are still there. I know those commands work, I've used em billion times lol |
Can you delete the contents of the folder from within windows? |
Quote:
I even ran cmd in admin mode. It didn't do anything to the files in the folder lol. |
Heh... gotta be an authority thing... I'm not currently on a win7 machine.... does the /? switch for del at the command line offer a switch for "do it no matter what!!!" ? |
Try: "del /q /f /s c:\path\to\your\dir\." (excluding the quotes of course) |
under XP it's /f (force deletion of read only) /s (subdirectories) /q (quiet no prompt)...... Be very careful of how you write it if you include the /q though.... Not sure about win7, but XP defaults to the documents and settings\username so if the CD doesn't work that plus all of the subdirectories is what will be deleted without a prompt..... (I'd test it out without the /Q first..... ;) |
| All times are GMT -7. The time now is 01:18 AM. |