La commande cd devient folle
Salut, pourriez-vous m'aider sur ce bout de code (c'est un batch de test, ne vous étonnez pas s'il est bordélique) :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| @echo off
set workpath=%~dp0
echo. >"%workpath%\test.txt"
::set racc=H:\[SYSTEM TOOLS]
::_includes\shortcut\Shortcut.exe /f:"%racc%\Raccourcis\Gestion\Mira.exe.lnk" /a:q
:3_Work
for /f "tokens=* delims=" %%r in ('dir /b /s "H:\[SYSTEM TOOLS]\Raccourcis\"') do (
echo %%r>"%workpath%\file.txt"
call :3_Get
)
pause
:3_Get
cd D:\Outils
echo %cd%
goto :eof
for /f "tokens=* delims=" %%f in (file.txt) do (
find ".lnk" file.txt>nul
if errorlevel=1 goto :eof
if errorlevel=0 echo %%f >>"%workpath%\test.txt"
)
goto :eof
for /f "skip=2 tokens=2 delims==" %%t in ('_includes\shortcut\Shortcut.exe /f:"%~dpnx1" /a:q') do (
set target %%t
echo %target%
goto :eof
) |
la commande cd est complètement à la ramasse, elle me renvoit sans cesse la valeur "C:\Documents and Settings\***\Bureau"
lol!