Go Back   Hardware Canucks > SOFTWARE > O/S's, Drivers & General Software

    
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old October 7, 2010, 03:38 PM
Hall Of Fame
F@H
 
Join Date: Apr 2008
Posts: 3,426
Default 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!
Reply With Quote
  #2 (permalink)  
Old October 7, 2010, 03:46 PM
CMetaphor's Avatar
Quadfather
 
Join Date: May 2007
Location: Montreal, Canada
Posts: 5,078
Default

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?
__________________
"Backed by common sense and physics!" -Squeetard
Reply With Quote
  #3 (permalink)  
Old October 7, 2010, 03:53 PM
Hall Of Fame
F@H
 
Join Date: Apr 2008
Posts: 3,426
Default

Quote:
Originally Posted by CMetaphor View Post
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?
God, wait.. it's that easy?

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!
Reply With Quote
  #4 (permalink)  
Old October 7, 2010, 04:08 PM
CMetaphor's Avatar
Quadfather
 
Join Date: May 2007
Location: Montreal, Canada
Posts: 5,078
Default

Quote:
Originally Posted by encorp View Post
God, wait.. it's that easy?

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!
No prob dude. you can always just try out the commands to a batch file one at a time by typing them in an ms-dos command windows too btw...
__________________
"Backed by common sense and physics!" -Squeetard
Reply With Quote
  #5 (permalink)  
Old October 7, 2010, 04:29 PM
Hall Of Fame
F@H
 
Join Date: Apr 2008
Posts: 3,426
Default

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
Reply With Quote
  #6 (permalink)  
Old October 7, 2010, 04:41 PM
sswilson's Avatar
Moderator
F@H
 
Join Date: Dec 2006
Location: Moncton NB
Posts: 17,078

My System Specs

Default

Can you delete the contents of the folder from within windows?
__________________
Gigabyte Z97N-WIFI / i7 4770K / 2X 8G Gskill 1866 Sniper / XFX XTR 750 / ASUS Strix GTX 1070ti
AZZA Titan 240 / Custom WC / Intel 730 Series 480GB SSD / Seagate Barracuda 1TB / ASUS SWIFT PG279Q

Asrock AM1H-ITX / AM1 Athlon 5350 / 1X4G Gskill PC3-14900 / Intel 6235 Wi-Fi / 90W Targus Power Brick / Uncased 256GB Sandisk Z400S SSD / Mini-Box M350 / 24" Westinghouse L2410NM
Reply With Quote
  #7 (permalink)  
Old October 7, 2010, 04:44 PM
Hall Of Fame
F@H
 
Join Date: Apr 2008
Posts: 3,426
Default

Quote:
Originally Posted by sswilson View Post
Can you delete the contents of the folder from within windows?
Yep!

I even ran cmd in admin mode.

It didn't do anything to the files in the folder lol.
Reply With Quote
  #8 (permalink)  
Old October 7, 2010, 04:49 PM
sswilson's Avatar
Moderator
F@H
 
Join Date: Dec 2006
Location: Moncton NB
Posts: 17,078

My System Specs

Default

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!!!" ?
__________________
Gigabyte Z97N-WIFI / i7 4770K / 2X 8G Gskill 1866 Sniper / XFX XTR 750 / ASUS Strix GTX 1070ti
AZZA Titan 240 / Custom WC / Intel 730 Series 480GB SSD / Seagate Barracuda 1TB / ASUS SWIFT PG279Q

Asrock AM1H-ITX / AM1 Athlon 5350 / 1X4G Gskill PC3-14900 / Intel 6235 Wi-Fi / 90W Targus Power Brick / Uncased 256GB Sandisk Z400S SSD / Mini-Box M350 / 24" Westinghouse L2410NM
Reply With Quote
  #9 (permalink)  
Old October 7, 2010, 05:04 PM
Allstar
 
Join Date: Mar 2010
Location: Ottawa
Posts: 520
Default

Try: "del /q /f /s c:\path\to\your\dir\."

(excluding the quotes of course)
Reply With Quote
  #10 (permalink)  
Old October 7, 2010, 05:04 PM
sswilson's Avatar
Moderator
F@H
 
Join Date: Dec 2006
Location: Moncton NB
Posts: 17,078

My System Specs

Default

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..... ;)
__________________
Gigabyte Z97N-WIFI / i7 4770K / 2X 8G Gskill 1866 Sniper / XFX XTR 750 / ASUS Strix GTX 1070ti
AZZA Titan 240 / Custom WC / Intel 730 Series 480GB SSD / Seagate Barracuda 1TB / ASUS SWIFT PG279Q

Asrock AM1H-ITX / AM1 Athlon 5350 / 1X4G Gskill PC3-14900 / Intel 6235 Wi-Fi / 90W Targus Power Brick / Uncased 256GB Sandisk Z400S SSD / Mini-Box M350 / 24" Westinghouse L2410NM
Reply With Quote
Reply


Thread Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Overclockin i7 930 Batch #3942A819 Closed Note Overclocking, Tweaking and Benchmarking 17 September 3, 2010 01:25 PM
Anyone had this i7 930 batch yet? Jelah Overclocking, Tweaking and Benchmarking 13 August 9, 2010 05:17 PM
Core I7 Batch# Saterial CPU's and Motherboards 4 July 3, 2009 09:52 AM
batch numbers Rapid-X Overclocking, Tweaking and Benchmarking 8 May 12, 2008 10:29 PM
Intel Batch Codes enaberif CPU's and Motherboards 2 February 14, 2008 11:56 AM