From bb53719f965513a8777d2a1fad07165e7a4e30f3 Mon Sep 17 00:00:00 2001 From: Davis Mosenkovs Date: Thu, 2 Jan 2020 20:53:29 +0200 Subject: [PATCH] Version 1.2.1 Verify existence of files before before changing permissions --- LICENSE | 2 +- README.md | 4 ++-- Telemetry-Kill-Script.cmd | 20 ++++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/LICENSE b/LICENSE index 0c35873..14638b8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017-2019 Dāvis Mošenkovs +Copyright (c) 2017-2020 Dāvis Mošenkovs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 2a56fd1..8102e86 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ Telemetry Kill Script A tool for disabling Windows Telemetry (at least part of it) on Windows 7, 8, 8.1 and 10. -Version 1.2.0 +Version 1.2.1 -Copyright (c) 2017-2019 Davis Mosenkovs +Copyright (c) 2017-2020 Davis Mosenkovs ## Introduction diff --git a/Telemetry-Kill-Script.cmd b/Telemetry-Kill-Script.cmd index b427c7d..90bbad0 100644 --- a/Telemetry-Kill-Script.cmd +++ b/Telemetry-Kill-Script.cmd @@ -1,11 +1,11 @@ @echo off rem Display info and license color f0 -echo Telemetry Kill Script 1.2.0 +echo Telemetry Kill Script 1.2.1 echo A tool for disabling Windows Telemetry (at least part of it). echo https://github.com/DavisNT/Telemetry-Kill-Script echo. -echo Copyright (c) 2017-2019 Davis Mosenkovs +echo Copyright (c) 2017-2020 Davis Mosenkovs echo. echo Permission is hereby granted, free of charge, to any person obtaining a copy echo of this software and associated documentation files (the "Software"), to deal @@ -43,23 +43,23 @@ if errorlevel 1 goto :noadmin rem Disable Telemetry set errors=0 echo Taking ownership of Telemetry files... -takeown /A /F %SystemRoot%\system32\CompatTelRunner.exe +if exist %SystemRoot%\system32\CompatTelRunner.exe takeown /A /F %SystemRoot%\system32\CompatTelRunner.exe if errorlevel 1 set errors=1 -takeown /A /F %SystemRoot%\system32\GeneralTel.dll +if exist %SystemRoot%\system32\GeneralTel.dll takeown /A /F %SystemRoot%\system32\GeneralTel.dll if errorlevel 1 set errors=1 -takeown /A /F %SystemRoot%\system32\CompatTel\*.exe +if exist %SystemRoot%\system32\CompatTel\*.exe takeown /A /F %SystemRoot%\system32\CompatTel\*.exe if errorlevel 1 set errors=1 -takeown /A /F %SystemRoot%\system32\CompatTel\*.dll +if exist %SystemRoot%\system32\CompatTel\*.dll takeown /A /F %SystemRoot%\system32\CompatTel\*.dll if errorlevel 1 set errors=1 echo. echo Changing permissions of Telemetry files... -icacls %SystemRoot%\system32\CompatTelRunner.exe /deny *S-1-1-0:(X) +if exist %SystemRoot%\system32\CompatTelRunner.exe icacls %SystemRoot%\system32\CompatTelRunner.exe /deny *S-1-1-0:(X) if errorlevel 1 set errors=1 -icacls %SystemRoot%\system32\GeneralTel.dll /deny *S-1-1-0:(X) +if exist %SystemRoot%\system32\GeneralTel.dll icacls %SystemRoot%\system32\GeneralTel.dll /deny *S-1-1-0:(X) if errorlevel 1 set errors=1 -icacls %SystemRoot%\system32\CompatTel\*.exe /deny *S-1-1-0:(X) +if exist %SystemRoot%\system32\CompatTel\*.exe icacls %SystemRoot%\system32\CompatTel\*.exe /deny *S-1-1-0:(X) if errorlevel 1 set errors=1 -icacls %SystemRoot%\system32\CompatTel\*.dll /deny *S-1-1-0:(X) +if exist %SystemRoot%\system32\CompatTel\*.dll icacls %SystemRoot%\system32\CompatTel\*.dll /deny *S-1-1-0:(X) if errorlevel 1 set errors=1 echo. echo Setting diagnostic data level to Security/Basic (lowest possible)...