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.
need to delete 0 byte files
Name: User9987 Date: October 17, 2006 at 02:50:48 Pacific OS: w2k CPU/Ram: non relevant Product: non relevant
Comment:
I was looking for a script to delete 0 byte files from the command line ...
The reason for that is that I then can do a check with "if exist FILE" to determine success or not.
If sees a zero-byte file as a file, and hence cannot make a difference between a non-empty and an empty file ...
Name: Mechanix2Go Date: October 17, 2006 at 04:49:42 Pacific
Reply:
No idea what your 2nd and 3rd paragraphs are driving at. But this should take care of deleting 0 length files.
::== Z2.bat @echo off for /f "tokens=* delims=" %%F in ('dir /s/b/a-d \temp') do ( if 0 equ %%~zF echo del "%%F" )
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 2
Name: User9987 Date: October 18, 2006 at 05:55:33 Pacific
Reply:
C:\Tools>for /f "tokens=* delims=" %F in ('dir /s/b/a-d \temp') do ( Syntax error
C:\Tools>if 0 equ %~zF echo del "%F" Syntax error
C:\Tools>) Bad command or file name
Lots of errors there. The reason is that I generate tempfile, some of them are empty, some are not. I want to see the diff between them, so I delete the 0 byte files, then check on existance.
User
0
Response Number 3
Name: Mechanix2Go Date: October 19, 2006 at 02:26:52 Pacific
Reply:
It won't work at the prompt.
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 4
Name: User9987 Date: October 20, 2006 at 13:20:41 Pacific
Reply:
This was output from an echo-enabled batch file ... I guess W98 is different after all.
User
0
Response Number 5
Name: Mechanix2Go Date: October 21, 2006 at 01:15:22 Pacific
Reply:
98 runs on DOS. NT is a completely different OS.
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 6
Name: User9987 Date: October 21, 2006 at 10:08:54 Pacific
Reply:
A changed FOR loop doesn't make an OS totally different. Unix is totally different. Windows 98, 95, NT and XP are quite compatible.
User
0
Response Number 7
Name: Mechanix2Go Date: October 21, 2006 at 11:06:21 Pacific
Reply:
OK, if you say so.
===================================== If at first you don't succeed, you're about average.
Summary: I was able to remove it from a friend's system, was a real pain. if you don't have spybot you can get it from download.com. When you can launch it run in 'advanced mode'. Select Tools on the left si...
Summary: Then you must be writing the batch file wrong. Let's say you have the shared folder: \\server_name\share with several folders underneath it. ex: folder1, folder2 folder3 You want to delete folder1 ...
Summary: James, I thought of that too. I've done that before to solve a similar problem. Not sure if that would work if it is a 0 byte file though. Kim did not specify whether it was or not. If it doesn't work...