Hi All,
I am running the following script for Format Volume, the script works most of the Time but some time I am getting error as
Script===============================
echo LIST VOLUME > abc.tpm
FOR /F "tokens=1,2,3,4" %%i IN ('diskpart /s abc.tpm') DO if /i '%%i' EQU 'Volume' (
call :FORMATVOLUME %%j %%k %%l
)
goto :EOF
:FORMATVOLUME
%TraceLine% FORMAT VOLUME %1 %2 %3
echo SELECT VOLUME %1 > %DiskPartScript%
echo CLEAN>> %DiskPartScript%
diskpart /s %DiskPartScript% >> %LOG% 2>&1
IF %ERRORLEVEL% EQU 0 (
%TraceLine% OK
goto finished
) else (
%TraceLine% ** Failed to FORMAT VOLUME %1 %2 %3
)
goto :EOF
Trace/Error====================
FORMAT VOLUME 0 NTFS Static
Microsoft DiskPart version 10.0.17763.1
Copyright (C) Microsoft Corporation.
On computer: MININT-KQIPQ6C
Volume 0 is the selected volume.
DiskPart succeeded in cleaning the disk.
OK
FORMAT VOLUME 2 FAT32 SYSTEM
Microsoft DiskPart version 10.0.17763.1
Copyright (C) Microsoft Corporation.
On computer: MININT-KQIPQ6C
The volume you selected is not valid or does not exist.
There is no volume selected.
** Failed to FORMAT VOLUME 2 FAT32 SYSTEM
Please Help to fix this, Error occurred on Gen 4 PCs
Error Occurs in WinPe
OS : Windows 10