1.

Solve : delete all zero byte files in a folder . . .?

Answer»

I know everyone is saying this, but I REALLY am new at attempting batch files, so please forgive any stupid QUESTIONS.   
I tried running this exact code, which had already been posted as a solution to someone else's post, but am getting an error.
Maybe something in the code is implied and I'm supposed to know enough to replace what's there with my own variable?
***************************
  set zerofile=zerobyte
  copy nul %zerofile% >nul
  for /f "delims=" %%a in (%d_qdbconf%) do (
    fc %zerofile% "%%a" >nul && del "%%a"
  )
  del %zerofile%
***************************
%d_qdbconf% is the path where the files reside that I want to delete if they are 0 byte.

I've attached a screen print of the cmd.exe window.



[REGAINING space - attachment deleted by admin]Got it!!   
This works perfectly . . .

Set d_qdbconf=\\sourdough\crossdata\ftp\qd\test\out\conf_temp
dir %d_qdbconf%\*.*  |  find " 0 "  >  %d_qdbconf%\zerotxt.txt
for /f "tokens=5 delims= " %%i in (%d_qdbconf%\zerotxt.txt) do del /F  %d_qdbconf%\"%%i"

Thanks anyway! Code: [Select]for /f "delims=" %%A in ( ' dir /b /a-d %d_qdbconf%\*.* ' ) do if %%~zA equ 0 del "%%~dpnxA"Thanks Salmon TROUT,
I'm assuming you are saying that I should be able to replace my TWO lines of code with your one line of code?
Remember, I'm new at this. 
If so, I tried to do this and it doesn't work.
It finds the zero byte file in the d_qdbconf directory, but then tries to delete the file from the directory where my bat file is running, not the d_qdbconf directory.



Discussion

No Comment Found