Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Windows 2000 / File System / August 2004

Tip: Looking for answers? Try searching our database.

Deleting 0 size files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arnold - 20 Aug 2004 18:46 GMT
How can I delete a 0 size file from the command prompt?
(The name can is different every day and I want to run a
script to clean it up)
Jerold Schulman - 21 Aug 2004 10:02 GMT
>How can I delete a 0 size file from the command prompt?
>(The name can is different every day and I want to run a
>script to clean it up)

Assuming the folder is called C:\Folder

Using FileSize from tip 5725 in the 'Tips & Tricks' at http://www.jsiinc.com

@echo off
setlocal
pushd C:\folder
for /f "Tokens=*" %%f in ('dir /a /a-d /b') do (
call :test "%%f"
)
popd
endlocal
goto :EOF
:test
set file=%1
call FileSize %file% size
if %size% NEQ 0 goto :EOF
del /q /f %file%

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
John Doue - 21 Aug 2004 16:01 GMT
>>How can I delete a 0 size file from the command prompt?
>>(The name can is different every day and I want to run a
[quoted text clipped - 23 lines]
> JSI, Inc.
> http://www.jsiinc.com
Very interesting tip. But,what about the wisdom of deleting zero length
files? I seem to remember - back in Dos and Win 3.1 times - that some
programs relied on zero length files for a variety of purposes. Is it
safe now to assume that such files are just space wasters?

Regards

Signature

John Doue

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.