Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
determine if a file has zero size
Name: earlgrey Date: August 31, 2004 at 05:04:24 Pacific OS: DOS CPU/Ram: p4 512
Comment:
Does anyone know a Dos command that determines if a file has 0 kb size? thank you
Name: IVO Date: August 31, 2004 at 05:51:43 Pacific
Reply:
Not a command, but a well known trick (under DOS only) is to try to copy the file; if the file has 0Kb size the copy fails and you can test for the existence of the target, if that does not exist the file's size is zero.
So e.g.
Copy Zero.ext Zero.tmp If not exist Zero.tmp Echo Zero has 0Kb size Del Zero.tmp
That can be embedded in a batch to achieve your target.
0
Response Number 2
Name: Mechanix2Go Date: August 31, 2004 at 07:26:29 Pacific
Reply:
IVO,
That's slick. Does that work in 3.x - 7.x?
M2
Mechanix2Go@Golden-Triangle.com
0
Response Number 3
Name: IVO Date: August 31, 2004 at 07:34:46 Pacific
Reply:
The trick works fine under all DOS-kernel based systems, i.e. Windows 3X/9X/ME and obviously the related DOS subsystems (DOS 7.X).
0
Response Number 4
Name: earlgrey Date: September 1, 2004 at 00:12:22 Pacific
Summary: It may be in "The World Library", but it comes from this page: http://bigfoot.com/~batfiles/main/batricks.htm 30. Determine if a file is a 0 byte file without deleting it. :: is0byte.bat @ECH...
Summary: Here where I work, we're rolling out a software patch across our network by using an autorun batch file. It will check the file(s) being updated by their date to determine if the patch has been appli...