Search found 512 matches

by npocmaka_
06 Jul 2013 00:49
Forum: DOS Batch Forum
Topic: %~z1 question
Replies: 6
Views: 8994

Re: %~z1 question

There's one small issue with Endoro's code - if the file does not exists it will print that the file is empty : try this: setlocal enabledelayedexpansion set "empty=" if !empty! EQU 0 echo this will be printed endlocal I'd a similar problem here : http://ss64.org/viewtopic.php?id=1709 .And...
by npocmaka_
05 Jul 2013 02:29
Forum: DOS Batch Forum
Topic: Need to check file size through batch script.
Replies: 1
Views: 6030

Re: Need to check file size through batch script.

Code: Select all

@echo off
if exist "filename" (
  for %%F in ("filename") do set "file_size=%%~zF"
)

if defined file_size if %file_size%0 NEQ 00  (
  do something
) else (
  do something else
)