

InterviewSolution
Saved Bookmarks
1. |
Solve : Batch not completed, what can be wrong?? |
Answer» <html><body><p>Hello!<br/><br/>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 <a href="https://interviewquestions.tuteehub.com/tag/wrong-1462035" style="font-weight:bold;" target="_blank" title="Click to know more about WRONG">WRONG</a> in the code? The problem is that it does not process all the files in the folder, it leaves <a href="https://interviewquestions.tuteehub.com/tag/2-236987" style="font-weight:bold;" target="_blank" title="Click to know more about 2">2</a> to 3 files unprocessed (depending of how many files in the folder) for unknown reasons. Any hints what can be wrong?<br/>Thanks<br/><br/> Code: <a>[Select]</a>¨<br/>echo off<br/>setlocal<br/><br/>> C:\"Documents and <a href="https://interviewquestions.tuteehub.com/tag/settings-771535" style="font-weight:bold;" target="_blank" title="Click to know more about SETTINGS">SETTINGS</a>"\%username%\"Local Settings"\Temp\TAB.DAT echo !table<br/>>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo !version 300<br/>>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo !charset WindowsLatin1<br/>>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo.<br/>>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo Definition Table<br/>>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo Type NATIVE Charset "WindowsLatin1"<br/>>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo Fields 1<br/>>> C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.DAT echo Vägnamn Char (32);<br/><br/>set /a rutter=0<br/><br/> for /f "tokens=1-3 delims=e." %%i In ('dir /o:-n /a:-d /<a href="https://interviewquestions.tuteehub.com/tag/b-236590" style="font-weight:bold;" target="_blank" title="Click to know more about B">B</a> D:\Maps\Rutter\%username%') do (<br/> set rutter=%%j+1<br/> goto out<br/> )<br/><br/>:out<br/> set /a count=0<br/><br/> for /f "tokens=* delims=." %%<a href="https://interviewquestions.tuteehub.com/tag/v-238055" style="font-weight:bold;" target="_blank" title="Click to know more about V">V</a> in ('dir /a:-d /b C:\"Documents and Settings"\%username%\"Local Settings"\Temp\~Map*.*') do (<br/> call :group "%%v"<br/> )<br/> del C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.dat<br/><br/>:group<br/> call set /a count=%%count%%+1<br/> if %count% GTR 4 (<br/> set /a count=1<br/> call set /a rutter=%%rutter%%+1<br/> )<br/> if %count% EQU 4 (<br/> copy C:\"Documents and Settings"\%username%\"Local Settings"\Temp\TAB.dat D:\Maps\Rutter\%username%\Rutt%rutter%.TAB > nul<br/> )<br/> for /f "tokens=1-2 delims=." %%w in ("%1") do (<br/> copy C:\"Documents and Settings"\%username%\"Local Settings"\Temp\"%1" D:\Maps\Rutter\%username%\Rutt%rutter%.%%x > nul<br/> )<br/></p></body></html> | |