Author |
Topic |
|
paco
Junior Member
Spain
187 Posts |
Posted - 03 July 2001 : 05:27:18
|
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
|
Depends on the OS. But if the OS has deltree I think this will work. deltree /y *.htm
-Dan |
|
|
paco
Junior Member
Spain
187 Posts |
Posted - 03 July 2001 : 11:55:40
|
It's a Windows 2000 server
|
|
|
Dan Martin
Average Member
USA
528 Posts |
Posted - 03 July 2001 : 15:33:58
|
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
|
|
|
paco
Junior Member
Spain
187 Posts |
Posted - 04 July 2001 : 03:06:35
|
Sorry, but no deltree available in W2000, any other sugestion?
|
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 04 July 2001 : 03:26:00
|
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 /? |
|
|
paco
Junior Member
Spain
187 Posts |
Posted - 04 July 2001 : 05:56:06
|
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?
|
|
|
Doug G
Support Moderator
USA
6493 Posts |
Posted - 04 July 2001 : 12:16:32
|
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 ====== |
|
|
paco
Junior Member
Spain
187 Posts |
Posted - 05 July 2001 : 05:14:32
|
Thanks, that's what I will probably do.
|
|
|
pendragn
Starting Member
USA
1 Posts |
|
paco
Junior Member
Spain
187 Posts |
Posted - 06 July 2001 : 11:58:53
|
Thank you very much, great site. I'll try it on monday.
|
|
|
|
Topic |
|