I have a script to output the folders list and their underneath file version into a file called list.txt
Code: Select all
@echo off
for /f "tokens=1-4 delims=, " %%A in (C:\Users\wyxy\Test\list2_UPP.txt) do call :indexlist "%%A" %%B %%C %%D
EXIT /B %ERRORLEVEL%
:indexlist
set snfld=%~1
set snfld=%snfld:"=%
set snfile=%~2
set snfileND=%snfile:~-3%
set snprefix=%snfile:~0,6%
set snver=%snfile:~6,4%
set snfile2=%~2
set snprefix2=%snfile2:~0,10%
set snver2=%snfile2:~10,6%
:::::::::::::::::::::::::::::
::Two components for AppleVAS
:::::::::::::::::::::::::::::
if "%snprefix%"=="844941" (
echo %snfld%>>list.txt
echo LIBLEGAPPV Version: %snver%>>list.txt
)
if "%snprefix%"=="844943" (
echo LIBLEGOSE Version: %snver%>>list.txt
)
:::::::::::::::::::::::::::::
::AppleVasEssentials
:::::::::::::::::::::::::::::
if "%snprefix2%"=="9992047406" (
echo %snfld%>>list.txt
echo vasApple Version: %snver2%>>list.txt
)
:::::::::::::::::::::::::::::
::NAR KIA
:::::::::::::::::::::::::::::
if "%snprefix%"=="829500" (
if "%snfileND%"=="P3A" (
echo %snfld%>>list.txt
echo 929500 Version: %snver%>>list.txt
)
)
:::::::::::::::::::::::::::::
::NAR TSA
:::::::::::::::::::::::::::::
if "%snprefix%"=="829501" (
if "%snfileND%"=="P3A" (
echo %snfld%>>list.txt
echo 829501 Version: %snver%>>list.txt
)
)
EXIT /B 0
- LIBLEGAPPV Version: 0306
LIBLEGOSE Version: 0312
AppleVasEssentials
vasApple Version: 010400
NAR KIA
929500 Version: 0627
NAR TSA
829501 Version: 0627
- LIBLEGAPPV Version: 0306
LIBLEGOSE Version: 0312
AppleVasEssentials
vasApple Version: 010400
NAR KIA
929500 Version: 0627 T501-08680-0103 T501-08699-0100 0501-08690-0100 T503-08961-0100
NAR TSA
829501 Version: 0627 T501-08699-0100 0501-08690-0100
Code: Select all
@echo off
for /f "tokens=1-4 delims=, " %%A in (C:\Users\wyxy\Test\list2_UPP.txt) do call :indexlist "%%A" %%B %%C %%D
EXIT /B %ERRORLEVEL%
:indexlist
set snfld=%~1
set snfld=%snfld:"=%
set snfile=%~2
set snfileND=%snfile:~-3%
set snprefix=%snfile:~0,6%
set snver=%snfile:~6,4%
set snfile2=%~2
set snprefix2=%snfile2:~0,10%
set snver2=%snfile2:~10,6%
:::::::::::::::::::::::::::::
::Two components for AppleVAS
:::::::::::::::::::::::::::::
if "%snprefix%"=="844941" (
echo %snfld%>>list.txt
echo LIBLEGAPPV Version: %snver%>>list.txt
)
if "%snprefix%"=="844943" (
echo LIBLEGOSE Version: %snver%>>list.txt
)
:::::::::::::::::::::::::::::
::AppleVasEssentials
:::::::::::::::::::::::::::::
if "%snprefix2%"=="9992047406" (
echo %snfld%>>list.txt
echo vasApple Version: %snver2%>>list.txt
)
:::::::::::::::::::::::::::::
::NAR KIA
:::::::::::::::::::::::::::::
for /f "tokens=1-7 delims=," %%A in (C:\CA_MOCKUP\Tetra_Schemes\temp\scheme\829500_scheme_data.cfg) do (set str1=%%A)
set "schKIA=%str1:~7,200%"
if "%snprefix%"=="829500" (
if "%snfileND%"=="P3A" (
echo %snfld%>>list.txt
echo 929500 Version: %snver% (%schKIA%) >>list.txt
)
)
:::::::::::::::::::::::::::::
::NAR TSA
:::::::::::::::::::::::::::::
for /f "tokens=1-7 delims=," %%A in (C:\CA_MOCKUP\Tetra_Schemes\temp\scheme\829501_scheme_data.cfg) do (set str1=%%A)
set "schTSA=%str1:~7,200%"
if "%snprefix%"=="829501" (
if "%snfileND%"=="P3A" (
echo %snfld%>>list.txt
echo 829501 Version: %snver% (%schTSA%)>>list.txt
)
)
EXIT /B 0
The process cannot access the file because it is being used by another process
And it will not correctly add the info I needed.
Need your input...
Thanks