diff --git a/src/application/application.yaml b/src/application/application.yaml index 8b52b400..542717ac 100644 --- a/src/application/application.yaml +++ b/src/application/application.yaml @@ -424,6 +424,17 @@ actions: net start DPS ) endlocal + - + name: Clear previous Windows installations + code: |- + if exist "%SystemDrive%\Windows.old" ( + takeown /f "%SystemDrive%\Windows.old" /a /r /d y + icacls "%SystemDrive%\Windows.old" /grant administrators:F /t + rd /s /q "%SystemDrive%\Windows.old" + echo Deleted previous installation from "%SystemDrive%\Windows.old\" + ) else ( + echo No previous Windows installation has been found + ) - category: Disable OS data collection children: