@prompt $s
@color 1f
@cd /d %~dp0
@title Win10 Apps Delete
@mode con cols=200 lines=30000
@setlocal enabledelayedexpansion
@echo 관리자권한 확인용 >%windir%\admin.confirm || @(
echo Set UAC = CreateObject^("Shell.Application"^) > "%tmp%\admin.vbs"
echo UAC.ShellExecute "%~0", "", "", "runas", 1 >> "%tmp%\admin.vbs"
wscript.exe "%tmp%\admin.vbs" & del "%tmp%\admin.vbs" & exit)
@del %windir%\admin.confirm
@echo.
@echo.
@echo. Win10_Apps_Delete_List.txt 에 있는 항목들을 삭제합니다
@echo.
@pause
@if not exist Win10_Apps_Delete_List.txt (echo. & echo. & echo. === Win10_Apps_Delete_List.txt 파일이 없습니다 === & echo. & pause & exit)
for /f "tokens=* usebackq" %%a in (`"type Win10_Apps_Delete_List.txt"`) do powershell "Get-AppxPackage *%%a* | Remove-AppxPackage"& set app=%%a& call :delete
@echo.
@echo.
@echo. 모든 작업을 완료했습니다
@echo.
@pause
@exit
:delete
cd /d "%ProgramFiles%\WindowsApps"
for /f "tokens=* usebackq" %%a in (`"dir /ad /b *%app%*"`) do takeown /f "%%a" /r /d y & icacls "%%a" /grant administrators:F /t & rd /q/s "%%a"
cd /d %windir%\InfusedApps\Applications
for /f "tokens=* usebackq" %%a in (`"dir /ad /b *%app%*"`) do takeown /f "%%a" /r /d y & icacls "%%a" /grant administrators:F /t & rd /q/s "%%a"
cd /d %windir%\InfusedApps\Packages
for /f "tokens=* usebackq" %%a in (`"dir /ad /b *%app%*"`) do takeown /f "%%a" /r /d y & icacls "%%a" /grant administrators:F /t & rd /q/s "%%a"
exit /b