Delete files on specific date
Moderator: DosItHelp
-
- Expert
- Posts: 1163
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Delete files on specific date
I did also have the test vs temp typo, but even after fixing that, I still get no output and the files still exist. Also, if I get rid of echo y|, then I'm prompted to delete the files.
Re: Delete files on specific date
Here's my test: (Virtualbox not VMware)
Re: Delete files on specific date
You are right.
When I use this then it behaves like yours does:
When I use this then it behaves like yours does:
Code: Select all
@echo off
if a==a echo y|del c:\test\*.*
Re: Delete files on specific date
This is a workaround for that issue.
It's a new one on me too.
It's a new one on me too.
Code: Select all
if not "%date%"=="24-10-2014" goto skip
echo y|del c:\test\*.*
:skip
-
- Expert
- Posts: 1163
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Delete files on specific date
The workaround seems to be to use a goto in the if statement to call a subroutine to do the piped deletion.
works.
EDIT: Although yours is nicer.
Code: Select all
if "%date%"=="10-06-2014" goto wipeit
exit
:wipeit
echo y|del C:\temp\*.*
works.
EDIT: Although yours is nicer.
-
- Expert
- Posts: 1163
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Delete files on specific date
I wonder if it's related to http://support2.microsoft.com/kb/81089
-
- Posts: 239
- Joined: 04 Mar 2014 11:14
- Location: germany
Re: Delete files on specific date
Hallo,
When you use command.com
Eg. From windows 98 I've written a batch for timestamp.
http://www.administrator.de/forum/win98-batch-datum-ermitteln-und-die-variable-splitten-in-tag-mon-jahr-221318.html#comment-891359
Phil
When you use command.com
Eg. From windows 98 I've written a batch for timestamp.
http://www.administrator.de/forum/win98-batch-datum-ermitteln-und-die-variable-splitten-in-tag-mon-jahr-221318.html#comment-891359
Phil
Re: Delete files on specific date
pieh-ejdsch wrote:Hallo,
When you use command.com
Eg. From windows 98 I've written a batch for timestamp.
Is that the 286 line batch script?
It seems very complex
ShadowThief wrote:I wonder if it's related to http://support2.microsoft.com/kb/81089
It may be.
Re: Delete files on specific date
I appreciate to foxidrive and ShadowThief,s support... I did follow the instructions and success to build script Is run fine for me,
Thanks for supports..
Thanks for supports..