1.

Solve : Batch not completed, what can be wrong??

Answer»

Hello!

I got this excellent code from Sidewinder a long time ago, I did change paths and user to %username%, but that is all. I have been testing it now but it will not work properly so I wonder if someone can see if there is something WRONG in the code? The problem is that it does not process all the files in the folder, it leaves 2 to 3 files unprocessed (depending of how many files in the folder) for unknown reasons. Any hints what can be wrong?
Thanks

Code: [Select]¨
echo off
setlocal

> C:\"Documents and SETTINGS"\%username%\"Local Settings"\Temp\TAB.DAT echo !table
>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo !version 300
>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo !charset WindowsLatin1
>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo.
>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo Definition Table
>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo  Type NATIVE Charset "WindowsLatin1"
>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo  Fields 1
>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo    Vägnamn Char (32);

set /a rutter=0

for /f "tokens=1-3 delims=e." %%i In ('dir /o:-n /a:-d /B D:\Maps\Rutter\%username%') do (
set rutter=%%j+1
goto out
)

:out
set /a count=0

for /f "tokens=* delims=." %%V in ('dir /a:-d /b C:\"Documents and Settings"\%username%\"Local Settings"\Temp\~Map*.*') do (
call :group "%%v"
)
del C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.dat

:group
call set /a count=%%count%%+1
if %count% GTR 4 (
set /a count=1
call set /a rutter=%%rutter%%+1
)
if %count% EQU 4 (
copy C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.dat D:\Maps\Rutter\%username%\Rutt%rutter%.TAB > nul
)
for /f "tokens=1-2 delims=." %%w in ("%1") do (
copy C:\"Documents and Settings"\%username%\"Local Settings"\Temp\"%1" D:\Maps\Rutter\%username%\Rutt%rutter%.%%x > nul
)



Discussion

No Comment Found