1.

Solve : Help with for comand?

Answer»

I am still pretty new to this. This is the part I am having problems with on what I am trying to do.

I want to move a PROMPTED amount of *.tif files from 1 place to another. That need to be in the newest ORDER. I know I have goofed in the for comand. I don't know if there is a less than comand. or a equal and less comand.


Code: [Select]
@if {%echo%}=={} (echo off) else (echo %echo%)
Goto Begin
:BEGIN
set /A flag=1
set dir_string=*.tif
set source_drive=c:
set source_folder=\test
set dest_drive=c:
set dest_folder=\test2
set /p Count1=Enter How many tifs to move:
set /a Count1=%count1%+1
goto user

:user
%source_drive%
cd %source_folder%

for /f "tokens=1 delims=" %%a in ('dir /o:-d /b %dir_string%') do call :move1 %%a
goto end

:move1
if %flag%=<%Count1% move %a %dest_drive%%dest_folder%%a
set /A flag=%flag%+1
goto :EOF

:endIs there a less than comand in dos? I know i need to have my var in the if comand from %%a to %1

Can anyone POINT me in the direction.

I figured it out. NeverMind.Future use ..............maybe.............>http://www.robvanderwoude.com/index.html



Discussion

No Comment Found