Skip to content

Commit

Permalink
Update AdminLaunchOption.bat
Browse files Browse the repository at this point in the history
Added conditional checks for existence of C:\NexTool directory before attempting to delete its contents and remove the directory itself.
  • Loading branch information
coff33ninja committed Nov 29, 2024
1 parent 5b0e239 commit 37ae98d
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions AdminLaunchOption.bat
Original file line number Diff line number Diff line change
Expand Up @@ -340,17 +340,26 @@ if /i "%user_input%"=="yes" (
start /wait notepad %LOGFILE%
)

:: Cleanup Logic
echo Deleting contents of C:\NexTool...
for /R "C:\NexTool" %%i in (*) do (
del "%%i"
)
for /D %%i in (C:\NexTool\*) do (
rmdir /s /q "%%i"
if exist "C:\NexTool" (
for /R "C:\NexTool" %%i in (*) do (
del "%%i"
)
for /D %%i in (C:\NexTool\*) do (
rmdir /s /q "%%i"
)
echo Cleanup complete.
) else (
echo C:\NexTool does not exist. No cleanup necessary.
)

echo Removing C:\NexTool directory...
rmdir "C:\NexTool"

echo Cleanup complete. Exiting script...
if exist "C:\NexTool" (
rmdir "C:\NexTool"
echo C:\NexTool directory removed.
) else (
echo C:\NexTool directory does not exist.
)
endlocal
exit /B

0 comments on commit 37ae98d

Please sign in to comment.