Improve code quality and reliability

- Replace legacy ping delays with modern timeout command across all scripts
- Enhance PowerShell job error handling for better reliability
- Fix typos in error messages for professional appearance

These changes improve script reliability while maintaining
full backward compatibility.
This commit is contained in:
Atanu Roy 2025-09-24 15:25:47 +05:30
parent b74d1155b9
commit 24e0209de9
11 changed files with 120 additions and 24 deletions

View file

@ -82,7 +82,7 @@ echo:
echo Check this webpage for help - %mas%fix_service
echo:
echo:
ping 127.0.0.1 -n 20
timeout /t 20 /nobreak >nul
)
cls
@ -97,7 +97,7 @@ echo:
echo Check this webpage for help - %mas%troubleshoot
echo:
echo:
ping 127.0.0.1 -n 20 >nul
timeout /t 20 /nobreak >nul
popd
exit /b
)
@ -939,7 +939,7 @@ echo Generating GenuineTicket.xml [Successful]
set "_xmlexist=if exist "%tdir%\GenuineTicket.xml""
%_xmlexist% (
%psc% "Start-Job { Restart-Service ClipSVC } | Wait-Job -Timeout 20 | Out-Null"
%psc% "try { Start-Job { Restart-Service ClipSVC } | Wait-Job -Timeout 20 | Out-Null } catch { Write-Host 'ClipSVC restart timed out or failed' }"
%_xmlexist% timeout /t 2 %nul%
%_xmlexist% timeout /t 2 %nul%
@ -13914,7 +13914,7 @@ if %_wmic% EQU 1 wmic path Win32_ComputerSystem get CreationClassName /value 2>n
if %_wmic% EQU 0 %psc% "Get-CIMInstance -Class Win32_ComputerSystem | Select-Object -Property CreationClassName" 2>nul | find /i "computersystem" 1>nul
if !errorlevel! NEQ 0 (set e_wmispp=WMI, SPP) else (set e_wmispp=SPP)
echo:
echo Error: Not Respoding- !e_wmispp!
echo Error: Not Responding - !e_wmispp!
echo:
)