Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.comp.os.windows-10 > #182578
| From | VanguardLH <V@nguard.LH> |
|---|---|
| Newsgroups | alt.comp.os.windows-10 |
| Subject | Re: Windows %TEMP% folder & files |
| Date | 2025-02-26 14:23 -0600 |
| Organization | Usenet Elder |
| Message-ID | <na15ead778ey$.dlg@v.nguard.lh> (permalink) |
| References | <vpn7gg$2jeht$1@dont-email.me> <efdmopoyrrpm.dlg@v.nguard.lh> |
In place of the 'del' command, you can use robocopy to delete files, and specify how old before they become eligible. In a command shell, run: robocopy /? That gives all the parameters you can use with robocopy. Use the /minage:N parameter to specify how old is a file to be eligible for action. N can either specify the number of days, like 1 for 1 day-old files, or a date in YYYYMMDD format. robocopy is for, well, copying/moving, so it doesn't have a delete parameter. Instead have the batch script create a temporary holding folder, like c:\robotemp, have robocopy move (/move) the eligible files into that folder, then the batch script runs 'rmdir /s /q c:\robotemp' to delete the holding folder. Note robocopy does not use shadow copies (VSC: Volume Shadow Copy service), so it cannot act on locked files. Even CCleaner doesn't support VSC. That's why I mentioned Lockhunter and Unlocker to get rid of stubborn locked files, but those aren't guaranteed to delete all files on every attempt. There are tools that are file managers that do support VSC, like VSSCopy, but that is geared to copying locked files, not to delete them. There are command to create, manage, and delete shadow copies that will work with robocopy, but then your intent is to delete the locked files, not to save copies elsewhere (that you then delete from elsewhere, not from the original folder). Either just let robocopy fail on the locked files, and you know something had them locked, so they probably should not get deleted, or use Lockhunter, Unlocker, or similar tool to delete the stubborn file(s). The default timeouts for robocopy are insanely long. If a file is inuse, and robocopy cannot access it, it keeps retrying for a very long time which would make the command or batch script take a very long time to finish. Defaults are: /r:1000000 (one million retries) /w:30 (30 seconds per retry) Those settings would have robocopy trying to act on a file for up over 347 years, and that's for EACH matched file. Change those to more sane values, like /r:6 and /w:10, so robocopy would give up after 1 minute.
Back to alt.comp.os.windows-10 | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Windows %TEMP% folder & files Jim Dell <Jim.Dell@gmail.com> - 2025-02-26 09:12 -0500
Re: Windows %TEMP% folder & files "R.Wieser" <address@is.invalid> - 2025-02-26 16:51 +0100
Re: Windows %TEMP% folder & files Paul <nospam@needed.invalid> - 2025-02-26 12:53 -0500
Re: Windows %TEMP% folder & files "Carlos E.R." <robin_listas@es.invalid> - 2025-02-26 19:29 +0100
Re: Windows %TEMP% folder & files Frank Slootweg <this@ddress.is.invalid> - 2025-02-26 20:46 +0000
Re: Windows %TEMP% folder & files Ed Cryer <ed@somewhere.in.the.uk> - 2025-02-26 21:15 +0000
Re: Windows %TEMP% folder & files Newyana2 <newyana@invalid.nospam> - 2025-02-26 20:06 -0500
Re: Windows %TEMP% folder & files Paul <nospam@needed.invalid> - 2025-02-26 21:09 -0500
Re: Windows %TEMP% folder & files Ed Cryer <ed@somewhere.in.the.uk> - 2025-02-27 11:15 +0000
Re: Windows %TEMP% folder & files Newyana2 <newyana@invalid.nospam> - 2025-02-27 07:34 -0500
Re: Windows %TEMP% folder & files Ed Cryer <ed@somewhere.in.the.uk> - 2025-02-27 19:00 +0000
Re: Windows %TEMP% folder & files Newyana2 <newyana@invalid.nospam> - 2025-02-27 16:54 -0500
Re: Windows %TEMP% folder & files Ed Cryer <ed@somewhere.in.the.uk> - 2025-02-27 22:54 +0000
Re: Windows %TEMP% folder & files Frank Slootweg <this@ddress.is.invalid> - 2025-03-01 15:29 +0000
Re: Windows %TEMP% folder & files VanguardLH <V@nguard.LH> - 2025-02-26 16:06 -0600
Re: Windows %TEMP% folder & files Frank Slootweg <this@ddress.is.invalid> - 2025-02-27 13:29 +0000
Re: Windows %TEMP% folder & files Anssi Saari <anssi.saari@usenet.mail.kapsi.fi> - 2025-02-27 12:37 +0200
Re: Windows %TEMP% folder & files Char Jackson <none@none.invalid> - 2025-02-26 17:57 -0600
Re: Windows %TEMP% folder & files John <Man@the.keyboard> - 2025-02-27 12:01 +0000
Re: Windows %TEMP% folder & files Zaidy036 <Zaidy036@air.isp.spam> - 2025-02-26 19:20 -0500
Re: Windows %TEMP% folder & files Newyana2 <newyana@invalid.nospam> - 2025-02-26 13:42 -0500
Re: Windows %TEMP% folder & files VanguardLH <V@nguard.LH> - 2025-02-26 13:55 -0600
Re: Windows %TEMP% folder & files VanguardLH <V@nguard.LH> - 2025-02-26 14:23 -0600
Re: Windows %TEMP% folder & files John <Man@the.keyboard> - 2025-02-27 11:47 +0000
Re: Windows %TEMP% folder & files Jim Dell <Jim.Dell@gmail.com> - 2025-02-27 08:49 -0500
Re: Windows %TEMP% folder & files Frank Slootweg <this@ddress.is.invalid> - 2025-02-27 15:00 +0000
Re: Windows %TEMP% folder & files Jim Dell <Jim.Dell@gmail.com> - 2025-02-27 08:49 -0500
Re: Windows %TEMP% folder & files "John C." <r9jmg0@yahoo.com> - 2025-02-27 06:43 -0800
Re: Windows %TEMP% folder & files Frank Slootweg <this@ddress.is.invalid> - 2025-02-27 15:31 +0000
Re: Windows %TEMP% folder & files "John C." <r9jmg0@yahoo.com> - 2025-02-28 05:29 -0800
Re: Windows %TEMP% folder & files Paul <nospam@needed.invalid> - 2025-02-28 12:32 -0500
Re: Windows %TEMP% folder & files "John C." <r9jmg0@yahoo.com> - 2025-03-02 06:11 -0800
Re: Windows %TEMP% folder & files VanguardLH <V@nguard.LH> - 2025-02-28 11:39 -0600
Re: Windows %TEMP% folder & files "John C." <r9jmg0@yahoo.com> - 2025-03-02 06:14 -0800
Re: Windows %TEMP% folder & files Frank Slootweg <this@ddress.is.invalid> - 2025-03-02 15:20 +0000
Re: Windows %TEMP% folder & files Paul <nospam@needed.invalid> - 2025-03-02 14:57 -0500
Re: Windows %TEMP% folder & files Frank Slootweg <this@ddress.is.invalid> - 2025-03-02 20:28 +0000
Re: Windows %TEMP% folder & files "John C." <r9jmg0@yahoo.com> - 2025-03-03 06:15 -0800
Re: Windows %TEMP% folder & files VanguardLH <V@nguard.LH> - 2025-03-02 14:44 -0600
Re: Windows %TEMP% folder & files Mr Xi Ji Ping <ping@china.cn> - 2025-02-28 17:39 +0000
Re: Windows %TEMP% folder & files VanguardLH <V@nguard.LH> - 2025-02-28 12:10 -0600
Re: Windows %TEMP% folder & files "John C." <r9jmg0@yahoo.com> - 2025-03-02 06:18 -0800
Re: Windows %TEMP% folder & files Jim Dell <Jim.Dell@gmail.com> - 2025-03-01 19:11 -0500
Re: Windows %TEMP% folder & files John <Man@the.keyboard> - 2025-02-28 23:40 +0000
Re: Windows %TEMP% folder & files Zaidy036 <Zaidy036@air.isp.spam> - 2025-02-27 10:03 -0500
csiph-web