Originally posted by zw19750516 at 2008-5-28 04:17 PM:
I thought the owner wanted to move all, so I added /s. If you don't want to move subdirectories, just remove /s.
[ Last edited by zw19750516 on 2008-5-28 at 04:23 PM ]
@echo off&setlocal enabledelayedexpansion
set str=.td .cfg
for /f "delims=" %%i in ('dir /a-d /b D:\batch\test\*.*') do (
set "flag="
for %%a in (%str%) do if "%%a"=="%%~xi" set flag=A
if not defined flag move /y "%%i" D:\batch\test\temp\
)
pause
Why does this error occur when I run it? The error message is:
D:\batch>moveFile
The system cannot find the file specified.
The system cannot find the file specified.
Press any key to continue . . .
In addition, 'dir /a-d /s' also errors:
D:\batch>moveFile
The system cannot find the file specified.
The system cannot find the file specified.
The filename, directory name, or volume label syntax is incorrect.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the file specified.
The filename, directory name, or volume label syntax is incorrect.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the file specified.
The filename, directory name, or volume label syntax is incorrect.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the file specified.
" Total Files Listed:" is not a recognized device.
" Total Files Listed:" is not a recognized device.
The filename, directory name, or volume label syntax is incorrect.
The system cannot find the file specified.
The system cannot find the file specified.
Press any key to continue . . .
Please analyze it, thank you