Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!mips!pacbell.com!pacbell!att!mcdchg!laidbak!obdient!vpnet!cgordon From: cgordon@vpnet.chi.il.us (Gordon Hlavenka) Newsgroups: comp.windows.ms Subject: Re: Zero byte DOS files Message-ID: <26da9c0d-3e8.3comp.windows.ms-1@vpnet.chi.il.us> Date: 28 Aug 90 17:55:05 GMT References: <23366@sequoia.execu.com> <1990Aug27.163336.17116@cimage.com> Lines: 18 >Does anybody know how to get a .bat file to test for the length of another >file; specifically, for the presence of a zero byte file? Microsoft distributed (with source!) a program called WHAT.COM with some versions of MASM. The file was redistributed on some BBSs; I'm not sure of the legality. WHAT checks several interesting things, and leaves its results in a variable in the master environment. Thus, you could do this: WHAT S GOODFILE.TXT if "%WHAT%" == "0" echo File is zero-length. WHAT also allows prompted input of strings, and other nifty things. Sounds like what you're looking for. ----------------------------------------------------- Gordon S. Hlavenka cgordon@vpnet.chi.il.us