Code: Select all
setlocal enabledelayedexpansion
for /f "tokens=* delims=" %%f in (.\transferFile.log) do (
for /r %%x in (%%f) do (
if exist %%f (
echo %%f FOUND!
) else (
echo %%f NOT FOUND!
)
)
)
Moderator: DosItHelp
Code: Select all
setlocal enabledelayedexpansion
for /f "tokens=* delims=" %%f in (.\transferFile.log) do (
for /r %%x in (%%f) do (
if exist %%f (
echo %%f FOUND!
) else (
echo %%f NOT FOUND!
)
)
)
Squashman wrote:If exist %%x
joecepy wrote:Squashman wrote:If exist %%x
still reporting all NOT FOUND
edit: my bad you're a genius that worked thanks
Code: Select all
SET sTransferLogFile="D:\TransferLog_%timestamp%.log"
for /f "tokens=* delims=" %%f in (%sTransferLogFile%) do (
echo %%f
:: can I do this??
for /r %%x in ("D:\TestSearch\%%f") do (
if exist %%x (
echo %%x file found!!
) else (
echo %%x ERROR: NOT FOUND!
)
)
)
FOR /R [[drive:]path] %variable IN (set) DO command [command-parameters]
Walks the directory tree rooted at [drive:]path, executing the FOR
statement in each directory of the tree. If no directory
specification is specified after /R then the current directory is
assumed. If set is just a single period (.) character then it
will just enumerate the directory tree.
Squashman wrote:You specify the path you want to search after the /R option.FOR /R [[drive:]path] %variable IN (set) DO command [command-parameters]
Walks the directory tree rooted at [drive:]path, executing the FOR
statement in each directory of the tree. If no directory
specification is specified after /R then the current directory is
assumed. If set is just a single period (.) character then it
will just enumerate the directory tree.
Code: Select all
if exist %%x (
move %%x .\Archive
) else ( ...
Code: Select all
move %%x %%~dpx\Archive