Computing.Net > Forums > Programming > deleting folders - use batch prog

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

deleting folders - use batch prog

Reply to Message Icon

Name: carrac89
Date: January 15, 2005 at 21:13:29 Pacific
OS: NT / XP
CPU/Ram: P4 - 1gig
Comment:

I am trying to delete dated folders with files in them from under the main folder, but keep the most recent dated folder. I have bits and pieces of this, but end up deleting all folders, can someone assist




Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: January 15, 2005 at 22:02:47 Pacific
Reply:

Take a look at:

for /?

There are many options to, for instance,

%~tI - expands %I to date/time of file

With that, you can do arithmetic manipulation.

Ask for more detail if needed.

HTH


M2


0

Response Number 2
Name: carrac89
Date: January 15, 2005 at 22:26:53 Pacific
Reply:

Thanks for the information - I am not really familiar with the FOR commands. I have used the "DELETE" command to remove files so many days old, but I also delete the folders with it.
ex: "delete /r c:\amex" - will delete everything under amex, but
"delete /d7 c:\amex" will delete files 7 days old, but will leave empty folders. I am trying to automate this as well. I will look into the FOR commands - I really appreciate the feedback..

CLP


0

Response Number 3
Name: Mechanix2Go
Date: January 15, 2005 at 23:16:30 Pacific
Reply:

CLP,

Now I'm intrigued.

I typed in:

del /?

to see if there was a /D switch. {w2k]

There isn't

So I typed delete. There's no such command in w2k.

So, what OS are you using?

M2


0

Response Number 4
Name: BlueRaja
Date: January 16, 2005 at 01:31:36 Pacific
Reply:

In windows, you use deltree to delete folders (or rmdir, if the folder has already been emptied)

BlueRaja.admin@gmail.com


0

Response Number 5
Name: Mechanix2Go
Date: January 16, 2005 at 01:59:22 Pacific
Reply:

BlueRaja,

Yes, but no built-in way to selte by date/age.

M2


0

Related Posts

See More



Response Number 6
Name: carrac89
Date: January 16, 2005 at 08:46:30 Pacific
Reply:

Mechanix2Go

Its a program I found in this web site:
http://www.bykeyword.com/downloads/software-3/download-3033.html

Its really nice program and its simple, but all I need to do is add another line that would delete empty folders for my batch program I am creating.

BlueRaja
I know about RMDIR and DELTREE, but I can't automate that command to run without user intervention.

CLP



0

Response Number 7
Name: Mechanix2Go
Date: January 16, 2005 at 21:25:49 Pacific
Reply:

If you want to delete empty folders without user input, just:

rd foldname

It will only delete empty ones.

HTH

M2


0

Sponsored Link
Ads by Google
Reply to Message Icon

unmathing value.... Square root in assembly



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: deleting folders - use batch prog

Rename multiple iles in folder using Batch www.computing.net/answers/programming/rename-multiple-iles-in-folder-using-batch/19638.html

deleting folders using C www.computing.net/answers/programming/deleting-folders-using-c/9442.html

Batch file to delete folder in fol. www.computing.net/answers/programming/batch-file-to-delete-folder-in-fol/16994.html