已查到下面的代码能把本机电脑某个文件的大小和预设参数作比较,然后把小于参数的文件进行复制或移动。
@echo off&setlocal enabledelayedexpansion
title %date% %time:~,8% By escortmnm
cd d:\abc\test
for /f "tokens=*" %%i in ('dir /b data.dat) do (
if %%~zi leq 665600 move /y "%%~dpnxi" "bad.bak")
pause
@Echo Off&SetLocal EnableDelayedExpansion
For %%I IN (局域网的\\abc\test\b.dat) Do (
For %%J IN (d:\abc\test\a.dat) Do (
Set /A Num=%%~zI-%%~zJ
If !Num! GEQ 10240 Copy /Y "%%I" "%%J"
...
ArdentMan 发表于 2011-7-4 11:18