FOR Command Differences on NT vs 2000
From: Tom Lavedas (tlavedas_at_hotmail.remove.com)
Date: 03/26/04
- Previous message: Russell Styles: "Re: command prompt window > 50 lines"
- In reply to: Tom Lavedas: "FOR Command Differences on NT vs 2000"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 26 Mar 2004 13:24:51 -0800
Sorry, I must have been asleep when I wrote that. The
correct formulation is ...
dir dummy.txt | find " 0 bytes">nul
if not errorlevel 1 echo Is zero bytes.
if errorlevel 1 echo Is NOT zero bytes.
Tom Lavedas
===========
>-----Original Message-----
>If all you need to know is whether it is zero bytes or
>not, you could do something like this (for all MS OS's I
>can think of) ...
>
>dir dummy.txt | find " 0 bytes">nul
>if not errorlevel 0 echo Not zero bytes.
>if errorlevel 1 echo Is zero bytes.
>
>Tom Lavedas
>===========
>
>>-----Original Message-----
>>I'm trying to determine if a text file is empty by using
>>the following FOR command to set the environment
variable
>>size_ to the number of bytes in a file:
>>
>>FOR %f in (dummy.txt) do set size_=%~zf
>>
>>This works correctly on a Win2000 server, but not on a
>>WinNT server. On a WinNT server, the environment
>variable
>>size_ ends up being equal to "%~zf".
>>
>>Is there a way to make this work on a WinNT box or is
>>there another method that can be used to determine if a
>>text file is empty? I read through the 1CMCFAQ.txt
found
>>in tscmd.zip and searched the newsgroup, but found
>nothing
>>that might help. Our WinNT server current with all
>>required updates and has had service pack 6 installed.
>>
>>Thanks
>>
>>
>>.
>>
>.
>
- Previous message: Russell Styles: "Re: command prompt window > 50 lines"
- In reply to: Tom Lavedas: "FOR Command Differences on NT vs 2000"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|