From 2b9537a3bff1d91b6b55c7052ecbc26c79bc7f7d Mon Sep 17 00:00:00 2001 From: jazir5 <31750063+jazir555@users.noreply.github.com> Date: Sat, 12 Oct 2024 21:56:01 -0700 Subject: [PATCH] Update Enable GamesDows v2.bat --- Enable GamesDows v2.bat | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Enable GamesDows v2.bat b/Enable GamesDows v2.bat index 588e37f..3976e7a 100644 --- a/Enable GamesDows v2.bat +++ b/Enable GamesDows v2.bat @@ -128,9 +128,17 @@ echo Delete the existing scheduled task if it exists schtasks /delete /tn "RunDelayedExplorerStart" /f echo Create the scheduled task using the XML file -schtasks /create /tn "RunDelayedExplorerStart" /xml "!XML_PATH!" -if %errorlevel% neq 0 ( - echo Error creating scheduled task +IF EXIST "%XML_PATH%" ( + schtasks /create /tn "RunDelayedExplorerStart" /xml "%XML_PATH%" >nul 2>&1 + if %errorlevel% neq 0 ( + echo Error creating scheduled task + pause + exit /b 1 + ) else ( + echo [SUCCESS] Scheduled task 'RunDelayedExplorerStart' created. + ) +) else ( + echo [ERROR] XML file for scheduled task does not exist. pause exit /b 1 )