From 3455a2ca6ce13f9b0e866d88532a5c3d6de30d4d Mon Sep 17 00:00:00 2001 From: undergroundwires Date: Mon, 4 Jan 2021 00:26:10 +0100 Subject: [PATCH] add script to clean previous windows installation #35 --- src/application/application.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) 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: