Copying of files only if file count is met

Microsoft Windows xp professional editio...
October 19, 2009 at 07:55:38
Specs: Windows XP
Hello,
I am new to batch program
I want to copy files from one folder to another only certain file count in a particular directoy is met.

Please find my code below. Its not working ..Please correct the code and let me .

set var1 = 2
set var2

Var2= dir "C:\test" /b | find /v /c "::"

If %var1% == %var2% xcopy C:\test D:\test /s /e


See More: Copying of files only if file count is met

Report •


#1
October 19, 2009 at 11:52:16
set var1 = 2
You're not making %var1%, you're making %var1 %. (Notice the space?)

Var2= dir "C:\test" /b | find /v /c "::"

for /f %%a in ('dir "C:\test" /b ^| find /v /c "::"') do set var2=%%a


Report •

#2
October 24, 2009 at 21:07:51
Thanks! it worked

Report •

Related Solutions


Ask Question