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
| @echo on
setlocal
set "key=Server"
if not "%~2"=="" set "ticket=%~2"
if not "%~3"=="" set "file=%~3"
set "file=C:\Windows\var.ini"
set "ticket=SERVERSPEC"
set "flag=1"
for /f "tokens=*" %%i in ('type "%file%"') do call :analyse %%~i
call echo.%%%key%%%
set t=%%%key%%%
echo %t%
PAUSE
IF NOT EXIST Q: net use Q: \\%t%\
endlocal
:analyse
if %flag% equ 0 goto :eof
set currline=%*
if %flag% equ 2 if not "%currline:~0,1%"=="[" set %currline%&goto :eof
if "%currline:~0,1%"=="[" if /i "%currline%"=="[%ticket%]" set flag=2& goto :eof
if "%currline:~0,1%"=="[" if %flag% equ 2 set flag=0
PAUSE
goto :eof |
Partager