Computing.Net > Forums > Programming > Batch delete files on external HD

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch delete files on external HD

Reply to Message Icon

Name: hobblyhoy
Date: June 29, 2007 at 00:07:16 Pacific
OS: winXP
CPU/Ram: 512
Product: HP
Comment:

I'm trying to create a batch that removes all .DS_store files located on an external harddrive. Unfortunately I've hit 2 roadblocks. For one, I can't CD to the to the external as windows wont allow it, so

del /F /S /Q *.DS_store

is out of the questions, and using:

del /F /S /Q K:\*.DS_store

Will only delete the DS files located in the root of the drive, not any of the subdirectorys. HELP!

~Nathan Rooke


"the right to swing my arm ends where your nose begins."
-Claude Adrien Helvetius



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: June 29, 2007 at 01:19:36 Pacific
Reply:

Before your del line, add:
K:


0

Response Number 2
Name: Mechanix2Go
Date: June 29, 2007 at 01:59:13 Pacific
Reply:

"del /F /S /Q K:\*.DS_store"

That is correct syntax.

If it doesn't work you may have a currupt file system. If you can't CD to the drive [unecessary for DEL] you may have serious problems.


=====================================
If at first you don't succeed, you're about average.

M2



0

Response Number 3
Name: hobblyhoy
Date: June 29, 2007 at 12:29:07 Pacific
Reply:

Wow. your actually right mechanix. I came back and ran the same script from yesterday and it just randomly decides to work today. Maybe since I was running it based off the errorlevel of the command before it?

Oh well, works now. Thanks all :D

"the right to swing my arm ends where your nose begins."
-Claude Adrien Helvetius


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Batch: replace variable w... Extract substring in batc...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch delete files on external HD

Batch deletion based on .txt file on ftp www.computing.net/answers/programming/batch-deletion-based-on-txt-file-on-ftp/20025.html

Deleting files on multi computers www.computing.net/answers/programming/deleting-files-on-multi-computers/18371.html

Batch File deleting files by date? www.computing.net/answers/programming/batch-file-deleting-files-by-date/13717.html