Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 .bat script question
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

paco
Junior Member

Spain
187 Posts

Posted - 03 July 2001 :  05:27:18  Show Profile
I want to have a .bat script that deletes all htm files in a folder (and its subfolders) prior to the current time minus an hour. How can I do this?

Thanks,

Paco



Edited by - paco on 03 July 2001 05:30:01

Dan Martin
Average Member

USA
528 Posts

Posted - 03 July 2001 :  10:53:23  Show Profile  Visit Dan Martin's Homepage  Send Dan Martin an AOL message  Send Dan Martin an ICQ Message  Send Dan Martin a Yahoo! Message
Depends on the OS. But if the OS has deltree I think this will work.
deltree /y *.htm

-Dan
Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 03 July 2001 :  11:55:40  Show Profile
It's a Windows 2000 server

Go to Top of Page

Dan Martin
Average Member

USA
528 Posts

Posted - 03 July 2001 :  15:33:58  Show Profile  Visit Dan Martin's Homepage  Send Dan Martin an AOL message  Send Dan Martin an ICQ Message  Send Dan Martin a Yahoo! Message
Honestly, I don't know if Win2000 has deltree. Go to the command prompt and type
deltree /?
and see if you get a response. If so, /deltree /y *.htm should work.

-Dan

Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 04 July 2001 :  03:06:35  Show Profile
Sorry, but no deltree available in W2000, any other sugestion?

Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 04 July 2001 :  03:26:00  Show Profile
del /s *.htm

that will delete all *.htm files in the current directory and all subdirectories, but it doesn't go by how old the file is.

From a command prompt you can type: HELP

to see all of the commands. To keep them from scrolling type it in like this: HELP | MORE

Then just hit the space bar to scroll to the next page.

you can get help for most commands by adding: /? after the command

for example: DEL /?
Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 04 July 2001 :  05:56:06  Show Profile
Thanks, but I do need it to delete only older files and I don't see any way of doing it with available commands. Any batch file guru around?

Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 04 July 2001 :  12:16:32  Show Profile
As long as your server has windows scripting host installed, you could write a .vbs script file and use the filesystem object to determine the files to delete. With the proper permissions you could do the same directly from an asp page for files on your website.



======
Doug G
======
Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 05 July 2001 :  05:14:32  Show Profile
Thanks, that's what I will probably do.

Go to Top of Page

pendragn
Starting Member

USA
1 Posts

Posted - 06 July 2001 :  11:08:59  Show Profile
Paco,
Take a look at http://www.ultratech-llc.com/KB/?File=DelOld.TXT br / . It'll give you an idea how to get started.

tk

Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 06 July 2001 :  11:58:53  Show Profile
Thank you very much, great site. I'll try it on monday.



Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.38 seconds. Powered By: Snitz Forums 2000 Version 3.4.07