├── .DS_Store
├── privacyascii.png
├── .github
└── ISSUE_TEMPLATE
│ ├── question.md
│ ├── feature_request.md
│ └── bug_report.md
├── bash_scripts
├── mac_privacy.sh
├── privacy_cleanup.sh
├── configure_programs.sh
├── secure_mac.sh
└── nuke_history.sh
├── .gitignore
├── README.md
├── enforce_mac.sh
├── batch_scripts
├── revert_some_bloatware.bat
├── revert_secure_window.bat
├── secure_window.bat
├── privacy_cleanup.bat
├── nuke_window.bat
└── remove_bloatware.bat
├── enforce_windows.ps1
└── LICENSE
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brootware/privacy-sexy-lite/HEAD/.DS_Store
--------------------------------------------------------------------------------
/privacyascii.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/brootware/privacy-sexy-lite/HEAD/privacyascii.png
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Question
3 | about: Ask whatever you want
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
12 | ## Checklist
13 |
14 |
15 |
16 | - [ ] I have read the [README](https://github.com/brootware/privacy-sexy-lite/blob/master/README.md) and know the correct effect of the functional design.
17 | - [ ] There are no similar reports on [existing issues](https://github.com/brootware/privacy-sexy-lite/issues?q=is%3Aissue) (including closed ones).
18 | - [ ] I have tried to find the answer on [Google](https://google.com/) and [StackOverflow](https://stackoverflow.com/).
19 | - [ ] My question is based on the latest code of the `master` branch.
20 |
21 | ## Description
22 |
23 |
24 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
12 | ## Checklist
13 |
14 |
15 | - [ ] There is no similar request on [existing issues](https://github.com/brootware/privacy-sexy-lite/issues?q=is%3Aissue) (including closed ones).
16 | - [ ] I was in the `master` branch of the latest code.
17 |
18 | ## Is your feature request related to a problem? Please describe
19 |
20 |
21 |
22 | ## Describe the solution you'd like
23 |
24 |
25 |
26 | ## Describe alternatives you've considered
27 |
28 |
29 |
30 | ## Additional context
31 |
32 |
33 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
12 | ## Checklist
13 |
14 |
15 |
16 | - [ ] I have read the [README](https://github.com/brootware/privacy-sexy-lite/blob/main/README.md) and know the correct effect of the functional design.
17 | - [ ] There are no similar reports on [existing issues](https://github.com/brootware/privacy-sexy-lite/issues?q=is%3Aissue) (including closed ones).
18 | - [ ] I found the bug on the latest code of the `master` branch.
19 |
20 | ## Describe the bug
21 |
22 |
23 |
24 | ### To Reproduce
25 |
26 | Steps to reproduce the behavior:
27 |
33 |
34 | ### Expected behavior
35 |
36 |
37 |
38 | ### Screenshots
39 |
40 |
41 |
42 | ### Software
43 |
44 |
45 | - Virtualbox version: by running: `vboxmanage -v`
46 | - VMWare version: by checking on VMWare fusion GUI: [e.g. VMWare Fusion Player Version 12.2.1 (18811640]
47 | - Vagrant version: by running: `vagrant version` or `vagrant -v`
48 | - Power shell version: by running: `$PSVersionTable.PSVersion`
49 |
50 | ### Desktop
51 |
52 |
53 | - MacOS: [e.g. macOS 10.15.6] *by running:* `sw_vers -productVersion`
54 | - Windows: *by running:* `Get-ComputerInfo | select WindowsProductName, WindowsVersion, OsHardwareAbstractionLayer`
55 | - Terminal or Power-shell:
56 |
57 | ### Additional context
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/bash_scripts/mac_privacy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | configure_mac_privacy() {
3 | # ----------------------------------------------------------
4 | # ---------------Disable Remote Apple Events----------------
5 | # ----------------------------------------------------------
6 | echo -e '\n--- Disable Remote Apple Events'
7 | sudo systemsetup -setremoteappleevents off
8 | # ----------------------------------------------------------
9 |
10 | # ----------------------------------------------------------
11 | # ---------------Disable AirDrop file sharing---------------
12 | # ----------------------------------------------------------
13 | echo -e '\n--- Disable AirDrop file sharing'
14 | defaults write com.apple.NetworkBrowser DisableAirDrop -bool true
15 | # ----------------------------------------------------------
16 |
17 | # ----------------------------------------------------------
18 | # ------------Opt-out from Siri data collection-------------
19 | # ----------------------------------------------------------
20 | echo -e '\n--- Opt-out from Siri data collection'
21 | defaults write com.apple.assistant.support 'Siri Data Sharing Opt-In Status' -int 2
22 | # ----------------------------------------------------------
23 | }
24 |
25 | revert_configure_mac_privacy() {
26 | # ----------------------------------------------------------
27 | # -----------Disable Remote Apple Events (revert)-----------
28 | # ----------------------------------------------------------
29 | echo -e '\n--- Disable Remote Apple Events (revert)'
30 | sudo systemsetup -setremoteappleevents on
31 | # ----------------------------------------------------------
32 |
33 | # ----------------------------------------------------------
34 |
35 | # ----------Disable AirDrop file sharing (revert)-----------
36 | # ----------------------------------------------------------
37 | echo -e '\n--- Disable AirDrop file sharing (revert)'
38 | defaults write com.apple.NetworkBrowser DisableAirDrop -bool false
39 | # ----------------------------------------------------------
40 | # ----------------------------------------------------------
41 |
42 | # --------Opt-out from Siri data collection (revert)--------
43 | # ----------------------------------------------------------
44 | echo -e '\n--- Opt-out from Siri data collection (revert)'
45 | defaults delete com.apple.assistant.support 'Siri Data Sharing Opt-In Status'
46 | # ----------------------------------------------------------
47 | }
48 |
--------------------------------------------------------------------------------
/bash_scripts/privacy_cleanup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | privacy_cleanup() {
3 | # ----------------------------------------------------------
4 | # ---------------------Clear DNS cache----------------------
5 | # ----------------------------------------------------------
6 | echo '--- Clear DNS cache'
7 | sudo dscacheutil -flushcache
8 | sudo killall -HUP mDNSResponder
9 | # ----------------------------------------------------------
10 |
11 | # ----------------------------------------------------------
12 | # ------------------Purge inactive memory-------------------
13 | # ----------------------------------------------------------
14 | echo '--- Purge inactive memory'
15 | sudo purge
16 | # ----------------------------------------------------------
17 |
18 | # ----------------------------------------------------------
19 | # --------------------Clear bash history--------------------
20 | # ----------------------------------------------------------
21 | echo '--- Clear bash history'
22 | rm -f ~/.bash_history
23 | # ----------------------------------------------------------
24 |
25 | # ----------------------------------------------------------
26 | # --------------------Clear zsh history---------------------
27 | # ----------------------------------------------------------
28 | echo '--- Clear zsh history'
29 | rm -f ~/.zsh_history
30 | # ----------------------------------------------------------
31 |
32 | # ----------------------------------------------------------
33 | # --------------------Clear Adobe cache---------------------
34 | # ----------------------------------------------------------
35 | echo '--- Clear Adobe cache'
36 | sudo rm -rfv ~/Library/Application\ Support/Adobe/Common/Media\ Cache\ Files/* &>/dev/null
37 | # ----------------------------------------------------------
38 |
39 | # ----------------------------------------------------------
40 | # -------------------Clear Dropbox cache--------------------
41 | # ----------------------------------------------------------
42 | echo '--- Clear Dropbox cache'
43 | if [ -d "/Users/${HOST}/Dropbox" ]; then
44 | sudo rm -rfv ~/Dropbox/.dropbox.cache/* &>/dev/null
45 | fi
46 | # ----------------------------------------------------------
47 |
48 | # ----------------------------------------------------------
49 | # -----------Clear Google Drive file stream cache-----------
50 | # ----------------------------------------------------------
51 | echo '--- Clear Google Drive file stream cache'
52 | killall "Google Drive File Stream"
53 | rm -rfv ~/Library/Application\ Support/Google/DriveFS/[0-9a-zA-Z]*/content_cache &>/dev/null
54 | # ----------------------------------------------------------
55 |
56 | # ----------------------------------------------------------
57 | # ------------------Clear iOS photo caches------------------
58 | # ----------------------------------------------------------
59 | echo '--- Clear iOS photo caches'
60 | rm -rf ~/Pictures/iPhoto\ Library/iPod\ Photo\ Cache/*
61 | # ----------------------------------------------------------
62 | }
63 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | # Ignoring sensitive files and directories.
3 |
4 | secret*.*
5 | *secret*.*
6 | SECRET*.*
7 | *SECRET*.*
8 | Password*.*
9 | *Password*.*
10 | PASSWORD*.*
11 | *PASSWORD*.*
12 | *pass*.*
13 | *PASS*.*
14 | *pwd*.*
15 | *PWD*.*
16 | *Pwd*.*
17 | Token*.*
18 | *Token*.*
19 | TOKEN*.*
20 | *TOKEN*.*
21 | API*.*
22 | *API*.*
23 | api*.*
24 | *api*.*
25 | TOKEN_API*.*
26 | *TOKEN_API*.*
27 | Token_api*.*
28 | *Token_api*.*
29 | password/
30 | PASSWORD/
31 | Token/
32 | TOKEN/
33 | api/
34 | API/
35 |
36 | # Python Template
37 |
38 | # Byte-compiled / optimized / DLL files
39 | __pycache__/
40 | *.py[cod]
41 | *$py.class
42 |
43 | # C extensions
44 | *.so
45 |
46 | # Distribution / packaging
47 | .Python
48 | build/
49 | develop-eggs/
50 | dist/
51 | downloads/
52 | eggs/
53 | .eggs/
54 | lib/
55 | lib64/
56 | parts/
57 | sdist/
58 | var/
59 | wheels/
60 | share/python-wheels/
61 | *.egg-info/
62 | .installed.cfg
63 | *.egg
64 | MANIFEST
65 |
66 | # PyInstaller
67 | # Usually these files are written by a python script from a template
68 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
69 | *.manifest
70 | *.spec
71 |
72 | # Installer logs
73 | pip-log.txt
74 | pip-delete-this-directory.txt
75 |
76 | # Unit test / coverage reports
77 | htmlcov/
78 | .tox/
79 | .nox/
80 | .coverage
81 | .coverage.*
82 | .cache
83 | nosetests.xml
84 | coverage.xml
85 | *.cover
86 | *.py,cover
87 | .hypothesis/
88 | .pytest_cache/
89 | cover/
90 |
91 | # Translations
92 | *.mo
93 | *.pot
94 |
95 | # Django stuff:
96 | *.log
97 | local_settings.py
98 | db.sqlite3
99 | db.sqlite3-journal
100 |
101 | # Flask stuff:
102 | instance/
103 | .webassets-cache
104 |
105 | # Scrapy stuff:
106 | .scrapy
107 |
108 | # Sphinx documentation
109 | docs/_build/
110 |
111 | # PyBuilder
112 | .pybuilder/
113 | target/
114 |
115 | # Jupyter Notebook
116 | .ipynb_checkpoints
117 |
118 | # IPython
119 | profile_default/
120 | ipython_config.py
121 |
122 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
123 | __pypackages__/
124 |
125 | # Celery stuff
126 | celerybeat-schedule
127 | celerybeat.pid
128 |
129 | # SageMath parsed files
130 | *.sage.py
131 |
132 | # Environments
133 | .env
134 | .venv
135 | env/
136 | venv/
137 | ENV/
138 | env.bak/
139 | venv.bak/
140 |
141 | # Spyder project settings
142 | .spyderproject
143 | .spyproject
144 |
145 | # Rope project settings
146 | .ropeproject
147 |
148 | # mkdocs documentation
149 | /site
150 |
151 | # mypy
152 | .mypy_cache/
153 | .dmypy.json
154 | dmypy.json
155 |
156 | # Pyre type checker
157 | .pyre/
158 |
159 | # pytype static type analyzer
160 | .pytype/
161 |
162 | # Ruby template
163 |
164 | *.gem
165 | *.rbc
166 | /.config
167 | /coverage/
168 | /InstalledFiles
169 | /pkg/
170 | /spec/reports/
171 | /spec/examples.txt
172 | /test/tmp/
173 | /test/version_tmp/
174 | /tmp/
175 |
176 | # Used by dotenv library to load environment variables.
177 | # .env
178 |
179 | # Ignore Byebug command history file.
180 | .byebug_history
181 |
182 | ## Specific to RubyMotion:
183 | .dat*
184 | .repl_history
185 | build/
186 | *.bridgesupport
187 | build-iPhoneOS/
188 | build-iPhoneSimulator/
189 |
190 | ## Specific to RubyMotion (use of CocoaPods):
191 | #
192 | # We recommend against adding the Pods directory to your .gitignore. However
193 | # you should judge for yourself, the pros and cons are mentioned at:
194 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
195 | #
196 | # vendor/Pods/
197 |
198 | ## Documentation cache and generated files:
199 | /.yardoc/
200 | /_yardoc/
201 | /doc/
202 | /rdoc/
203 |
204 | ## Environment normalization:
205 | /.bundle/
206 | /vendor/bundle
207 | /lib/bundler/man/
208 |
209 | # for a library or gem, you might want to ignore these files since the code is
210 | # intended to run in multiple environments; otherwise, check them in:
211 | # Gemfile.lock
212 | # .ruby-version
213 | # .ruby-gemset
214 |
215 | # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
216 | .rvmrc
217 |
218 | # Vagrant template
219 | .vagrant
220 | compare*
221 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Privacy-sexy-lite
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | A lite CLI version of Open-source tool to enforce privacy & security best-practices on Windows and MacOS. Originally a web app by [undergroundwires](https://github.com/undergroundwires). 🍑 🍆
10 |
11 | This tool is customized from original site [privacy.sexy](https://privacy.sexy) to fit privacy and security needs for my mac and windows VMs.
12 |
13 | > Standard Disclaimer: Author assumes no liability for any damage done on your machines.
14 |
15 | ## Core Features
16 |
17 | - 💻 Cross platform. Both Windows and MacOS.
18 | - 🪶 Ultra light! No compiled binaries. Just plain old bash,batch and powershell scripts.
19 | - 🙅 Automated security and privacy hardening on your Operating System.
20 | - 🔁 Automated reversion of the security and privacy hardening.
21 | - 🧹 Automated privacy cleanups.
22 |
23 | ## How to use for Mac
24 |
25 | ```bash
26 | rm -rf privacy-sexy-lite
27 | git clone https://github.com/brootware/privacy-sexy-lite
28 | cd privacy-sexy-lite
29 | chmod +x enforce_mac.sh
30 | sudo ./enforce_mac.sh --help
31 | ```
32 |
33 | ## What's included in Mac?
34 |
35 | - **Secure Mac**
36 | - Disable remote login
37 | - Disable insecure TFTP service
38 | - Disable Bonjour multicast advertising
39 | - Disable insecure telnet protocol
40 | - Disable sharing of local printers with other computers
41 | - Disable printing from any address including the Internet
42 | - Disable remote printer administration
43 | - Disable Captive portal
44 | - **Configure Privacy**
45 | - Disable Remote Apple Events
46 | - Disable AirDrop file sharing
47 | - Opt-out from Siri data collection
48 | - **Prviacy cleanup**
49 | - Clear Terminal History
50 | - Clear Browser History
51 | - Clear 3rd party application data
52 | - IOS Cleanup
53 | - Reset Privacy Permissions for all applications
54 | - Clear cups printer job cache
55 | - Empty trash on all volumes
56 | - Clear system cache files
57 | - Clear XCode derived data and archives
58 | - Clear DNS Cache
59 | - Purge inactive memory
60 |
61 | ## How to use for Windows
62 |
63 | Right click > Run Powershell As Administrator
64 |
65 | ```powershell
66 | rm -Force privacy-sexy-lite
67 | git clone https://github.com/brootware/privacy-sexy-lite
68 | cd privacy-sexy-lite
69 | .\enforce_windows.ps1 help
70 | ```
71 |
72 | ## What's included in Windows?
73 |
74 | - **Secure windows**
75 | - Disable unsafe features
76 | - Disable administrative shares
77 | - Disable autoplay and autorun
78 | - Disable remote assitance
79 | - Disable lock screen camera
80 | - Prevent the storage of lan manager hash of passwords
81 | - Disable windows installer always install with elevated privileges
82 | - Prevent WinRM from using basic authentication
83 | - Restrict anonymous enmeration of shares
84 | - Refuse less secure authentication
85 | - Enable structured exception handling overwrite protection
86 | - Block anonymous enumeration of SAM accounts
87 | - Restrict anonymous access to named pipes and shares
88 | - Disable the windows connect now wizard
89 | - **Configure privacy**
90 | - Disable windows telemetry and data collection
91 | - Deny app access to personal information
92 | - Disable location access
93 | - Disable window search data collection
94 | - Disable targeted ads and marketing
95 | - Disable windows insider program
96 | - Disable cloud sync
97 | - Disable cloud speech recognition
98 | - Opt out from windows privacy consent
99 | - Disable windows feedback
100 | - Disable text and handwriting collection
101 | - Disable turn off sensors
102 | - Disable wi-fi sense
103 | - Disable inventory collector
104 | - Disable website access of language list
105 | - Disable auto downloading maps
106 | - Disable steps recorder
107 | - Disable game screen recording
108 | - Disable Windows DRM internet access
109 | - Disable feedback on write(Sending type info to Microsoft)
110 | - Disable activity feed
111 | - Disable media player data collection
112 | - Disable Xbox services
113 | - Disable Microsoft retail demo experience
114 |
115 | *and many more....*
116 |
117 | - **Privacy & bloatware cleanup**
118 | - Clear app, browser history
119 | - Clear non essential windows logs and caches
120 | - Delete controversial Default- User
121 | - Enable reset base in DISM component store
122 | - Remove Default apps associations
123 | - Clear (RESET) network data usage
124 | - Uninstall MSN(BING), Office, XBox, Cortana, Feedback hub, Windows maps app
125 | - Uninstall Microsoft advertising app, Network speed test app.
126 | - Uninstall holographic first run app, family safety/parental controls app, Windows feedback app, CBS Preview app
127 |
--------------------------------------------------------------------------------
/enforce_mac.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # enforce_mac.sh Author: Oaker Min (brootware)
4 | # git clone https://github.com/brootware/privacy-sexy-lite.git
5 | # Usage: sudo ./enforce_mac.sh ( defaults to the menu system )
6 | # command line arguments are valid, only catching 1 arguement
7 | #
8 | # Standard Disclaimer: Author assumes no liability for any damage done on your machine
9 |
10 | # revision var
11 | revision="0.0.2"
12 |
13 | source bash_scripts/mac_privacy.sh
14 | source bash_scripts/configure_programs.sh
15 | source bash_scripts/nuke_history.sh
16 | source bash_scripts/secure_mac.sh
17 | source bash_scripts/privacy_cleanup.sh
18 |
19 | check_for_root() {
20 | if [ "$EUID" -ne 0 ]; then
21 | echo -e "\n\n Script must be run with sudo ./enforce_mac.sh or as root \n"
22 | exit
23 | fi
24 | }
25 |
26 | harden_mac() {
27 | configure_mac_privacy
28 | configure_programs
29 | secure_mac
30 | }
31 |
32 | revert_hardening() {
33 | revert_configure_mac_privacy
34 | revert_configure_programs
35 | revert_secure_mac
36 | }
37 |
38 | # asciiart DO NOT MOVE
39 | asciiart=$(base64 -d <<<"X19fX19fX19fXyAgICAgICAgLl9fICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX19fX19fX18gICAgICAgICAgICAgICAgICAgICAKXF9fX19fXyAgIFxfX19fX19ffF9ffF9fICBfX19fX19fICAgIF9fX18gX19fLl9fLi8gICBfX19fXy8gX19fXyBfX18gIF9fX19fXy5fXy4KIHwgICAgIF9fXy9cXyAgX18gXCAgXCAgXC8gL1xfXyAgXCBfLyBfX188ICAgfCAgfFxfX19fXyAgXF8vIF9fIFxcICBcLyAgPCAgIHwgIHwKIHwgICAgfCAgICAgfCAgfCBcLyAgfFwgICAvICAvIF9fIFxcICBcX19fXF9fXyAgfC8gICAgICAgIFwgIF9fXy8gPiAgICA8IFxfX18gIHwKIHxfX19ffCAgICAgfF9ffCAgfF9ffCBcXy8gIChfX19fICAvXF9fXyAgPiBfX19fL19fX19fX18gIC9cX19fICA+X18vXF8gXC8gX19fX3wKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXC8gICAgIFwvXC8gICAgICAgICAgICBcLyAgICAgXC8gICAgICBcL1wvICAgICAKCiAgICAgICAgICAgICAgICAgICAgKy0rLSstKy0rLSstKy0rICstKy0rICstKy0rLSstKy0rLSstKy0rLSsKICAgICAgICAgICAgICAgICAgICB8UHxvfHd8ZXxyfGV8ZHwgfGJ8eXwgfEJ8cnxvfG98dHx3fGF8cnxlfAogICAgICAgICAgICAgICAgICAgICstKy0rLSstKy0rLSstKyArLSstKyArLSstKy0rLSstKy0rLSstKy0r")
40 |
41 | exit_screen() {
42 | echo -e "$asciiart"
43 | echo -e '\n\nYour privacy and security is now hardened 🎉💪'
44 | exit
45 | }
46 |
47 | mac_menu() {
48 | clear
49 | echo -e "$asciiart"
50 | echo -e "\n Select an option from menu: Rev:$revision" # function call list
51 | echo -e "\n Key Menu Option: Description:"
52 | echo -e " --- ------------ ------------"
53 | echo " 1 - Configure mac privacy Enforce privacy on your mac " # configure_mac_privacy
54 | echo " 2 - Revert mac privacy config Revert privacy config on your mac " # revert_configure_mac_privacy
55 | echo " 3 - Configure programs Enforce 3rd party programs privacy on your mac " # configure_programs
56 | echo " 4 - Revert Programs config Revert 3rd party programs privacy CONFIG on your mac " # revert_configure_programs
57 | echo " 5 - Secure your mac Secure all the unused services on mac " # secure_mac
58 | echo " 6 - Revert security configs Revert all the security configs on mac" # revert_secure_mac
59 | echo " 7 - Lite privacy cleanup Small privacy clean up" # privacy_cleanup
60 | echo -e " 8 - Nuke history WARNING!!! This will remove all your bash history,os log and reset privacy settings\n" # nuke_history
61 | read -n1 -p " Press key for menu item selection or press Q to exit: " menuinput
62 |
63 | case $menuinput in
64 | 1) configure_mac_privacy ;;
65 | 2) revert_configure_mac_privacy ;;
66 | 3) configure_programs ;;
67 | 4) revert_configure_programs ;;
68 | 5) secure_mac ;;
69 | 6) revert_secure_mac ;;
70 | 7) privacy_cleanup ;;
71 | 8) nuke_history ;;
72 | q | Q)
73 | echo -e "\n\n Exiting enforce_mac.sh - Happy computing! \n"
74 | exit_screen
75 | ;;
76 | *) mac_menu ;;
77 | esac
78 | }
79 |
80 | mac_help() {
81 | # do not edit this echo statement, spacing has been fixed and is correct for display in the terminal
82 | echo -e "\n valid command line arguements are : \n \n --menu brings you to main menu of the program \n" \
83 | "--help shows help menu for arguments \n --harden run all security and privacy enforcements\n" \
84 | "--revert revert all enforcements \n --cleanup remove dns,bash,dropbox,ios photo caches\n" \
85 | "--nuke remove all your bash history,os log and reset privacy settings"
86 | exit
87 | }
88 |
89 | check_arg() {
90 | if [ "$1" == "" ]; then
91 | mac_menu
92 | else
93 | case $1 in
94 | --menu) mac_menu ;;
95 | --help) mac_help ;;
96 | --harden) harden_mac ;;
97 | --revert) revert_hardening ;;
98 | --cleanup) privacy_cleanup ;;
99 | --nuke) nuke_history ;;
100 | *)
101 | mac_help
102 | exit 0
103 | ;;
104 | esac
105 | fi
106 | }
107 |
108 | check_for_root
109 | check_arg "$1"
110 |
--------------------------------------------------------------------------------
/batch_scripts/revert_some_bloatware.bat:
--------------------------------------------------------------------------------
1 | :: ----------------------------------------------------------
2 | :: ------------------My Office app (revert)------------------
3 | :: ----------------------------------------------------------
4 | echo --- My Office app (revert)
5 | PowerShell -ExecutionPolicy Unrestricted -Command "$package = Get-AppxPackage -AllUsers 'Microsoft.MicrosoftOfficeHub'; if (!$package) {; Write-Error "^""Cannot reinstall 'Microsoft.MicrosoftOfficeHub'"^"" -ErrorAction Stop; }; $manifest = $package.InstallLocation + '\AppxManifest.xml'; Add-AppxPackage -DisableDevelopmentMode -Register "^""$manifest"^"""
6 | :: ----------------------------------------------------------
7 |
8 |
9 | :: ----------------------------------------------------------
10 | :: -----------Xbox Console Companion app (revert)------------
11 | :: ----------------------------------------------------------
12 | echo --- Xbox Console Companion app (revert)
13 | PowerShell -ExecutionPolicy Unrestricted -Command "$package = Get-AppxPackage -AllUsers 'Microsoft.XboxApp'; if (!$package) {; Write-Error "^""Cannot reinstall 'Microsoft.XboxApp'"^"" -ErrorAction Stop; }; $manifest = $package.InstallLocation + '\AppxManifest.xml'; Add-AppxPackage -DisableDevelopmentMode -Register "^""$manifest"^"""
14 | :: ----------------------------------------------------------
15 |
16 |
17 | :: ----------------------------------------------------------
18 | :: --------Xbox Live in-game experience app (revert)---------
19 | :: ----------------------------------------------------------
20 | echo --- Xbox Live in-game experience app (revert)
21 | PowerShell -ExecutionPolicy Unrestricted -Command "$package = Get-AppxPackage -AllUsers 'Microsoft.Xbox.TCUI'; if (!$package) {; Write-Error "^""Cannot reinstall 'Microsoft.Xbox.TCUI'"^"" -ErrorAction Stop; }; $manifest = $package.InstallLocation + '\AppxManifest.xml'; Add-AppxPackage -DisableDevelopmentMode -Register "^""$manifest"^"""
22 | :: ----------------------------------------------------------
23 |
24 |
25 | :: ----------------------------------------------------------
26 | :: ----------------Xbox Game Bar app (revert)----------------
27 | :: ----------------------------------------------------------
28 | echo --- Xbox Game Bar app (revert)
29 | PowerShell -ExecutionPolicy Unrestricted -Command "$package = Get-AppxPackage -AllUsers 'Microsoft.XboxGamingOverlay'; if (!$package) {; Write-Error "^""Cannot reinstall 'Microsoft.XboxGamingOverlay'"^"" -ErrorAction Stop; }; $manifest = $package.InstallLocation + '\AppxManifest.xml'; Add-AppxPackage -DisableDevelopmentMode -Register "^""$manifest"^"""
30 | :: ----------------------------------------------------------
31 |
32 |
33 | :: ----------------------------------------------------------
34 | :: ----------Xbox Game Bar Plugin appcache (revert)----------
35 | :: ----------------------------------------------------------
36 | echo --- Xbox Game Bar Plugin appcache (revert)
37 | PowerShell -ExecutionPolicy Unrestricted -Command "$package = Get-AppxPackage -AllUsers 'Microsoft.XboxGameOverlay'; if (!$package) {; Write-Error "^""Cannot reinstall 'Microsoft.XboxGameOverlay'"^"" -ErrorAction Stop; }; $manifest = $package.InstallLocation + '\AppxManifest.xml'; Add-AppxPackage -DisableDevelopmentMode -Register "^""$manifest"^"""
38 | :: ----------------------------------------------------------
39 |
40 |
41 | :: ----------------------------------------------------------
42 | :: -----------Xbox Identity Provider app (revert)------------
43 | :: ----------------------------------------------------------
44 | echo --- Xbox Identity Provider app (revert)
45 | PowerShell -ExecutionPolicy Unrestricted -Command "$package = Get-AppxPackage -AllUsers 'Microsoft.XboxIdentityProvider'; if (!$package) {; Write-Error "^""Cannot reinstall 'Microsoft.XboxIdentityProvider'"^"" -ErrorAction Stop; }; $manifest = $package.InstallLocation + '\AppxManifest.xml'; Add-AppxPackage -DisableDevelopmentMode -Register "^""$manifest"^"""
46 | :: ----------------------------------------------------------
47 |
48 |
49 | :: ----------------------------------------------------------
50 | :: ---------Xbox Speech To Text Overlay app (revert)---------
51 | :: ----------------------------------------------------------
52 | echo --- Xbox Speech To Text Overlay app (revert)
53 | PowerShell -ExecutionPolicy Unrestricted -Command "$package = Get-AppxPackage -AllUsers 'Microsoft.XboxSpeechToTextOverlay'; if (!$package) {; Write-Error "^""Cannot reinstall 'Microsoft.XboxSpeechToTextOverlay'"^"" -ErrorAction Stop; }; $manifest = $package.InstallLocation + '\AppxManifest.xml'; Add-AppxPackage -DisableDevelopmentMode -Register "^""$manifest"^"""
54 | :: ----------------------------------------------------------
55 |
56 |
57 | :: ----------------------------------------------------------
58 | :: --------------Uninstall Cortana app (revert)--------------
59 | :: ----------------------------------------------------------
60 | echo --- Uninstall Cortana app (revert)
61 | PowerShell -ExecutionPolicy Unrestricted -Command "$package = Get-AppxPackage -AllUsers 'Microsoft.549981C3F5F10'; if (!$package) {; Write-Error "^""Cannot reinstall 'Microsoft.549981C3F5F10'"^"" -ErrorAction Stop; }; $manifest = $package.InstallLocation + '\AppxManifest.xml'; Add-AppxPackage -DisableDevelopmentMode -Register "^""$manifest"^"""
62 | :: ----------------------------------------------------------
63 |
64 |
65 | :: ----------------------------------------------------------
66 | :: Windows 10 Family Safety / Parental Controls app (revert)-
67 | :: ----------------------------------------------------------
68 | echo --- Windows 10 Family Safety / Parental Controls app (revert)
69 | PowerShell -ExecutionPolicy Unrestricted -Command "$package = Get-AppxPackage -AllUsers 'Microsoft.Windows.ParentalControls'; if (!$package) {; Write-Error 'App could not be found' -ErrorAction Stop; }; $directories = @($package.InstallLocation, "^""$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)"^""); foreach($dir in $directories) {; if ( !$dir -Or !(Test-Path "^""$dir"^"") ) { continue; }; cmd /c ('takeown /f "^""' + $dir + '"^"" /r /d y 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership' }; cmd /c ('icacls "^""' + $dir + '"^"" /grant administrators:F /t 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership' }; $files = Get-ChildItem -File -Path "^""$dir\*.OLD"^"" -Recurse -Force; foreach($file in $files) {; $newName = $file.FullName.Substring(0, $file.FullName.Length - 4); Write-Host "^""Rename '$($file.FullName)' to '$newName'"^""; Move-Item -LiteralPath "^""$($file.FullName)"^"" -Destination "^""$newName"^"" -Force; }; }"
70 | :: ----------------------------------------------------------
--------------------------------------------------------------------------------
/bash_scripts/configure_programs.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | configure_programs() {
3 | # ----------------------------------------------------------
4 | # ----------------Disable Firefox telemetry-----------------
5 | # ----------------------------------------------------------
6 | echo '--- Disable Firefox telemetry'
7 | # Enable Firefox policies so the telemetry can be configured.
8 | sudo defaults write /Library/Preferences/org.mozilla.firefox EnterprisePoliciesEnabled -bool TRUE
9 | # Disable sending usage data
10 | sudo defaults write /Library/Preferences/org.mozilla.firefox DisableTelemetry -bool TRUE
11 | # ----------------------------------------------------------
12 |
13 | # ----------------------------------------------------------
14 | # ----Disable Microsoft Office diagnostics data sending-----
15 | # ----------------------------------------------------------
16 | echo '--- Disable Microsoft Office diagnostics data sending'
17 | defaults write com.microsoft.office DiagnosticDataTypePreference -string ZeroDiagnosticData
18 | # ----------------------------------------------------------
19 |
20 | # ----------------------------------------------------------
21 | # ---------Disable Homebrew user behavior analytics---------
22 | # ----------------------------------------------------------
23 | echo '--- Disable Homebrew user behavior analytics'
24 | command='export HOMEBREW_NO_ANALYTICS=1'
25 | declare -a profile_files=("$HOME/.bash_profile" "$HOME/.zprofile")
26 | for profile_file in "${profile_files[@]}"; do
27 | touch "$profile_file"
28 | if ! grep -q "$command" "${profile_file}"; then
29 | echo "$command" >>"$profile_file"
30 | echo "[$profile_file] Configured"
31 | else
32 | echo "[$profile_file] No need for any action, already configured"
33 | fi
34 | done
35 | # ----------------------------------------------------------
36 |
37 | # ----------------------------------------------------------
38 | # --------------Disable NET Core CLI telemetry--------------
39 | # ----------------------------------------------------------
40 | echo '--- Disable NET Core CLI telemetry'
41 | command='export DOTNET_CLI_TELEMETRY_OPTOUT=1'
42 | declare -a profile_files=("$HOME/.bash_profile" "$HOME/.zprofile")
43 | for profile_file in "${profile_files[@]}"; do
44 | touch "$profile_file"
45 | if ! grep -q "$command" "${profile_file}"; then
46 | echo "$command" >>"$profile_file"
47 | echo "[$profile_file] Configured"
48 | else
49 | echo "[$profile_file] No need for any action, already configured"
50 | fi
51 | done
52 | # ----------------------------------------------------------
53 |
54 | # ----------------------------------------------------------
55 | # ------------Disable PowerShell Core telemetry-------------
56 | # ----------------------------------------------------------
57 | echo '--- Disable PowerShell Core telemetry'
58 | command='export POWERSHELL_TELEMETRY_OPTOUT=1'
59 | declare -a profile_files=("$HOME/.bash_profile" "$HOME/.zprofile")
60 | for profile_file in "${profile_files[@]}"; do
61 | touch "$profile_file"
62 | if ! grep -q "$command" "${profile_file}"; then
63 | echo "$command" >>"$profile_file"
64 | echo "[$profile_file] Configured"
65 | else
66 | echo "[$profile_file] No need for any action, already configured"
67 | fi
68 | done
69 | # ----------------------------------------------------------
70 | }
71 |
72 | revert_configure_programs() {
73 | # ----------------------------------------------------------
74 | # ------------Disable Firefox telemetry (revert)------------
75 | # ----------------------------------------------------------
76 | echo '--- Disable Firefox telemetry (revert)'
77 | sudo defaults delete /Library/Preferences/org.mozilla.firefox EnterprisePoliciesEnabled
78 | sudo defaults delete /Library/Preferences/org.mozilla.firefox DisableTelemetry
79 | # ----------------------------------------------------------
80 |
81 | # Disable Microsoft Office diagnostics data sending (revert)
82 | echo '--- Disable Microsoft Office diagnostics data sending (revert)'
83 | defaults delete com.microsoft.office DiagnosticDataTypePreference
84 | # ----------------------------------------------------------
85 |
86 | # ----------------------------------------------------------
87 | # ----Disable Homebrew user behavior analytics (revert)-----
88 | # ----------------------------------------------------------
89 | echo '--- Disable Homebrew user behavior analytics (revert)'
90 | command='export HOMEBREW_NO_ANALYTICS=1'
91 | declare -a profile_files=("$HOME/.bash_profile" "$HOME/.zprofile")
92 | for profile_file in "${profile_files[@]}"; do
93 | if grep -q "$command" "${profile_file}" 2>/dev/null; then
94 | sed -i '' "/$command/d" "$profile_file"
95 | echo "[$profile_file] Reverted configuration"
96 | else
97 | echo "[$profile_file] No need for any action, configuration does not exist"
98 | fi
99 | done
100 | # ----------------------------------------------------------
101 |
102 | # ----------------------------------------------------------
103 | # ---------Disable NET Core CLI telemetry (revert)----------
104 | # ----------------------------------------------------------
105 | echo '--- Disable NET Core CLI telemetry (revert)'
106 | command='export DOTNET_CLI_TELEMETRY_OPTOUT=1'
107 | declare -a profile_files=("$HOME/.bash_profile" "$HOME/.zprofile")
108 | for profile_file in "${profile_files[@]}"; do
109 | if grep -q "$command" "${profile_file}" 2>/dev/null; then
110 | sed -i '' "/$command/d" "$profile_file"
111 | echo "[$profile_file] Reverted configuration"
112 | else
113 | echo "[$profile_file] No need for any action, configuration does not exist"
114 | fi
115 | done
116 | # ----------------------------------------------------------
117 |
118 | # ----------------------------------------------------------
119 | # --------Disable PowerShell Core telemetry (revert)--------
120 | # ----------------------------------------------------------
121 | echo '--- Disable PowerShell Core telemetry (revert)'
122 | command='export POWERSHELL_TELEMETRY_OPTOUT=1'
123 | declare -a profile_files=("$HOME/.bash_profile" "$HOME/.zprofile")
124 | for profile_file in "${profile_files[@]}"; do
125 | if grep -q "$command" "${profile_file}" 2>/dev/null; then
126 | sed -i '' "/$command/d" "$profile_file"
127 | echo "[$profile_file] Reverted configuration"
128 | else
129 | echo "[$profile_file] No need for any action, configuration does not exist"
130 | fi
131 | done
132 | # ----------------------------------------------------------
133 | }
134 |
--------------------------------------------------------------------------------
/batch_scripts/revert_secure_window.bat:
--------------------------------------------------------------------------------
1 | :: ----------------------------------------------------------
2 | :: ----------Disable unsafe SMBv1 protocol (revert)----------
3 | :: ----------------------------------------------------------
4 | echo --- Disable unsafe SMBv1 protocol (revert)
5 | dism /online /Enable-Feature /FeatureName:"SMB1Protocol" /NoRestart
6 | dism /Online /Enable-Feature /FeatureName:"SMB1Protocol-Client" /NoRestart
7 | dism /Online /Enable-Feature /FeatureName:"SMB1Protocol-Server" /NoRestart
8 | :: ----------------------------------------------------------
9 |
10 |
11 | :: ----------------------------------------------------------
12 | :: Disable PowerShell 2.0 against downgrade attacks (revert)-
13 | :: ----------------------------------------------------------
14 | echo --- Disable PowerShell 2.0 against downgrade attacks (revert)
15 | dism /online /Enable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2Root" /NoRestart
16 | dism /online /Enable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2" /NoRestart
17 | :: ----------------------------------------------------------
18 |
19 |
20 | :: ----------------------------------------------------------
21 | :: ----------Disable administrative shares (revert)----------
22 | :: ----------------------------------------------------------
23 | echo --- Disable administrative shares (revert)
24 | reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /v "AutoShareWks" /t REG_DWORD /d 1 /f
25 | :: ----------------------------------------------------------
26 |
27 |
28 | :: ----------------------------------------------------------
29 | :: ----------Disable AutoPlay and AutoRun (revert)-----------
30 | :: ----------------------------------------------------------
31 | echo --- Disable AutoPlay and AutoRun (revert)
32 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /f
33 | reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoAutorun" /t REG_DWORD /d 2 /f
34 | reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "NoAutoplayfornonVolume" /f
35 | :: ----------------------------------------------------------
36 |
37 |
38 | :: ----------------------------------------------------------
39 | :: ------------Disable remote Assistance (revert)------------
40 | :: ----------------------------------------------------------
41 | echo --- Disable remote Assistance (revert)
42 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Remote Assistance" /v "fAllowToGetHelp" /t REG_DWORD /d 1 /f
43 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Remote Assistance" /v "fAllowFullControl" /t REG_DWORD /d 1 /f
44 | :: ----------------------------------------------------------
45 |
46 |
47 | :: ----------------------------------------------------------
48 | :: -----------Disable lock screen camera (revert)------------
49 | :: ----------------------------------------------------------
50 | echo --- Disable lock screen camera (revert)
51 | reg delete "HKLM\Software\Policies\Microsoft\Windows\Personalization" /v NoLockScreenCamera /f
52 | :: ----------------------------------------------------------
53 |
54 |
55 | :: Prevent the storage of the LAN Manager hash of passwords (revert)
56 | echo --- Prevent the storage of the LAN Manager hash of passwords (revert)
57 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "NoLMHash" /t REG_DWORD /d 10 /f
58 | :: ----------------------------------------------------------
59 |
60 |
61 | :: Disable Windows Installer Always install with elevated privileges (revert)
62 | echo --- Disable Windows Installer Always install with elevated privileges (revert)
63 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer" /v "AlwaysInstallElevated" /t REG_DWORD /d 1 /f
64 | :: ----------------------------------------------------------
65 |
66 |
67 | :: ----------------------------------------------------------
68 | :: --Prevent WinRM from using Basic Authentication (revert)--
69 | :: ----------------------------------------------------------
70 | echo --- Prevent WinRM from using Basic Authentication (revert)
71 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client" /v "AllowBasic" /t REG_DWORD /d 1 /f
72 | :: ----------------------------------------------------------
73 |
74 |
75 | :: ----------------------------------------------------------
76 | :: ----Restrict anonymous enumeration of shares (revert)-----
77 | :: ----------------------------------------------------------
78 | echo --- Restrict anonymous enumeration of shares (revert)
79 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\LSA" /v "RestrictAnonymous" /t REG_DWORD /d 0 /f
80 | :: ----------------------------------------------------------
81 |
82 |
83 | :: ----------------------------------------------------------
84 | :: --------Refuse less secure authentication (revert)--------
85 | :: ----------------------------------------------------------
86 | echo --- Refuse less secure authentication (revert)
87 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "LmCompatibilityLevel" /t REG_DWORD /d 3 /f
88 | :: ----------------------------------------------------------
89 |
90 |
91 | :: Enable Structured Exception Handling Overwrite Protection (SEHOP) (revert)
92 | echo --- Enable Structured Exception Handling Overwrite Protection (SEHOP) (revert)
93 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel" /v "DisableExceptionChainValidation" /t REG_DWORD /d 1 /f
94 | :: ----------------------------------------------------------
95 |
96 |
97 | :: ----------------------------------------------------------
98 | :: ---Block Anonymous enumeration of SAM accounts (revert)---
99 | :: ----------------------------------------------------------
100 | echo --- Block Anonymous enumeration of SAM accounts (revert)
101 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel" /v "RestrictAnonymousSAM" /t REG_DWORD /d 0 /f
102 | :: ----------------------------------------------------------
103 |
104 |
105 | :: Restrict anonymous access to Named Pipes and Shares (revert)
106 | echo --- Restrict anonymous access to Named Pipes and Shares (revert)
107 | reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters" /v "RestrictNullSessAccess" /t REG_DWORD /d 0 /f
108 | :: ----------------------------------------------------------
109 |
110 |
111 | :: ----------------------------------------------------------
112 | :: -----Disable the Windows Connect Now wizard (revert)------
113 | :: ----------------------------------------------------------
114 | echo --- Disable the Windows Connect Now wizard (revert)
115 | reg add "HKLM\Software\Policies\Microsoft\Windows\WCN\UI" /v "DisableWcnUi" /t REG_DWORD /d 0 /f
116 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "DisableFlashConfigRegistrar" /t REG_DWORD /d 1 /f
117 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "DisableInBand802DOT11Registrar" /t REG_DWORD /d 1 /f
118 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "DisableUPnPRegistrar" /t REG_DWORD /d 1 /f
119 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "DisableWPDRegistrar" /t REG_DWORD /d 1 /f
120 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "EnableRegistrars" /t REG_DWORD /d 1 /f
121 | :: ----------------------------------------------------------
--------------------------------------------------------------------------------
/batch_scripts/secure_window.bat:
--------------------------------------------------------------------------------
1 | :: ----------------------------------------------------------
2 | :: --------------Disable administrative shares---------------
3 | :: ----------------------------------------------------------
4 | echo --- Disable administrative shares
5 | reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /v "AutoShareWks" /t REG_DWORD /d 0 /f
6 | :: ----------------------------------------------------------
7 |
8 |
9 | :: ----------------------------------------------------------
10 | :: ---------------Disable AutoPlay and AutoRun---------------
11 | :: ----------------------------------------------------------
12 | echo --- Disable AutoPlay and AutoRun
13 | :: 255 (0xff) means all drives
14 | reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutoRun" /t REG_DWORD /d 255 /f
15 | reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoAutorun" /t REG_DWORD /d 1 /f
16 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "NoAutoplayfornonVolume" /t REG_DWORD /d 1 /f
17 | :: ----------------------------------------------------------
18 |
19 |
20 | :: ----------------------------------------------------------
21 | :: ----------------Disable remote Assistance-----------------
22 | :: ----------------------------------------------------------
23 | echo --- Disable remote Assistance
24 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Remote Assistance" /v "fAllowToGetHelp" /t REG_DWORD /d 0 /f
25 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Remote Assistance" /v "fAllowFullControl" /t REG_DWORD /d 0 /f
26 | :: ----------------------------------------------------------
27 |
28 |
29 | :: ----------------------------------------------------------
30 | :: ----------------Disable lock screen camera----------------
31 | :: ----------------------------------------------------------
32 | echo --- Disable lock screen camera
33 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v "NoLockScreenCamera" /t REG_DWORD /d 1 /f
34 | :: ----------------------------------------------------------
35 |
36 |
37 | :: ----------------------------------------------------------
38 | :: -Prevent the storage of the LAN Manager hash of passwords-
39 | :: ----------------------------------------------------------
40 | echo --- Prevent the storage of the LAN Manager hash of passwords
41 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "NoLMHash" /t REG_DWORD /d 1 /f
42 | :: ----------------------------------------------------------
43 |
44 |
45 | :: Disable Windows Installer Always install with elevated privileges
46 | echo --- Disable Windows Installer Always install with elevated privileges
47 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer" /v "AlwaysInstallElevated" /t REG_DWORD /d 0 /f
48 | :: ----------------------------------------------------------
49 |
50 |
51 | :: ----------------------------------------------------------
52 | :: ------Prevent WinRM from using Basic Authentication-------
53 | :: ----------------------------------------------------------
54 | echo --- Prevent WinRM from using Basic Authentication
55 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client" /v "AllowBasic" /t REG_DWORD /d 0 /f
56 | :: ----------------------------------------------------------
57 |
58 |
59 | :: ----------------------------------------------------------
60 | :: ---------Restrict anonymous enumeration of shares---------
61 | :: ----------------------------------------------------------
62 | echo --- Restrict anonymous enumeration of shares
63 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\LSA" /v "RestrictAnonymous" /t REG_DWORD /d 1 /f
64 | :: ----------------------------------------------------------
65 |
66 |
67 | :: ----------------------------------------------------------
68 | :: ------------Refuse less secure authentication-------------
69 | :: ----------------------------------------------------------
70 | echo --- Refuse less secure authentication
71 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "LmCompatibilityLevel" /t REG_DWORD /d 5 /f
72 | :: ----------------------------------------------------------
73 |
74 |
75 | :: Enable Structured Exception Handling Overwrite Protection (SEHOP)
76 | echo --- Enable Structured Exception Handling Overwrite Protection (SEHOP)
77 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel" /v "DisableExceptionChainValidation" /t REG_DWORD /d 0 /f
78 | :: ----------------------------------------------------------
79 |
80 |
81 | :: ----------------------------------------------------------
82 | :: -------Block Anonymous enumeration of SAM accounts--------
83 | :: ----------------------------------------------------------
84 | echo --- Block Anonymous enumeration of SAM accounts
85 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel" /v "RestrictAnonymousSAM" /t REG_DWORD /d 1 /f
86 | :: ----------------------------------------------------------
87 |
88 |
89 | :: ----------------------------------------------------------
90 | :: ---Restrict anonymous access to Named Pipes and Shares----
91 | :: ----------------------------------------------------------
92 | echo --- Restrict anonymous access to Named Pipes and Shares
93 | reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters" /v "RestrictNullSessAccess" /t REG_DWORD /d 1 /f
94 | :: ----------------------------------------------------------
95 |
96 |
97 | :: ----------------------------------------------------------
98 | :: ----------Disable the Windows Connect Now wizard----------
99 | :: ----------------------------------------------------------
100 | echo --- Disable the Windows Connect Now wizard
101 | reg add "HKLM\Software\Policies\Microsoft\Windows\WCN\UI" /v "DisableWcnUi" /t REG_DWORD /d 1 /f
102 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "DisableFlashConfigRegistrar" /t REG_DWORD /d 0 /f
103 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "DisableInBand802DOT11Registrar" /t REG_DWORD /d 0 /f
104 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "DisableUPnPRegistrar" /t REG_DWORD /d 0 /f
105 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "DisableWPDRegistrar" /t REG_DWORD /d 0 /f
106 | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars" /v "EnableRegistrars" /t REG_DWORD /d 0 /f
107 | :: ----------------------------------------------------------
108 |
109 |
110 | :: ----------------------------------------------------------
111 | :: --------------Disable unsafe SMBv1 protocol---------------
112 | :: ----------------------------------------------------------
113 | echo --- Disable unsafe SMBv1 protocol
114 | dism /online /Disable-Feature /FeatureName:"SMB1Protocol" /NoRestart
115 | dism /Online /Disable-Feature /FeatureName:"SMB1Protocol-Client" /NoRestart
116 | dism /Online /Disable-Feature /FeatureName:"SMB1Protocol-Server" /NoRestart
117 | :: ----------------------------------------------------------
118 |
119 |
120 | :: ----------------------------------------------------------
121 | :: -----Disable PowerShell 2.0 against downgrade attacks-----
122 | :: ----------------------------------------------------------
123 | echo --- Disable PowerShell 2.0 against downgrade attacks
124 | dism /online /Disable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2Root" /NoRestart
125 | dism /online /Disable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2" /NoRestart
126 | :: ----------------------------------------------------------
--------------------------------------------------------------------------------
/enforce_windows.ps1:
--------------------------------------------------------------------------------
1 | #Requires -RunAsAdministrator
2 | #
3 | # enforce_windows.ps1 Author: Oaker Min (brootware)
4 | # git clone https://github.com/brootware/privacy-sexy-lite.git
5 | # Usage: Type in powershell and press Ctrl+Shift+Enter or press and hold Ctrl+Shift. Click OK to make PowerShell run as administrator ./enforce_windows.ps1 ( defaults to the menu system )
6 | # command line arguments are valid, only catching 1 arguement
7 | #
8 | # Standard Disclaimer: Author assumes no liability for any damage done on your machine
9 |
10 | param (
11 | [string]$choice
12 | )
13 |
14 | # revision var
15 | $revision = "0.0.2"
16 |
17 | function check_for_admin {
18 | # Check to make sure script is run as administrator
19 | Write-Host "[+] Checking if script is running as administrator.."
20 | $currentPrincipal = New-Object Security.Principal.WindowsPrincipal( [Security.Principal.WindowsIdentity]::GetCurrent() )
21 | if (-Not $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
22 | Write-Host "[ERR] Please run this script as administrator`n" -ForegroundColor Red
23 | Read-Host "Press any key to continue"
24 | return
25 | }
26 | }
27 |
28 | function remove_bloatware {
29 | & '.\batch_scripts\remove_bloatware.bat'
30 | }
31 |
32 | function revert_some_bloatware {
33 | & '.\batch_scripts\revert_some_bloatware.bat'
34 | }
35 | function privacy_cleanup {
36 | & '.\batch_scripts\privacy_cleanup.bat'
37 | }
38 |
39 | function configure_window_privacy {
40 | & '.\batch_scripts\configure_window_privacy.bat'
41 | }
42 |
43 | function revert_configure_window_privacy {
44 | & '.\batch_scripts\revert_configure_window_privacy.bat'
45 | }
46 |
47 | function configure_programs {
48 | & '.\batch_scripts\configure_programs.bat'
49 | }
50 |
51 | function revert_configure_programs {
52 | & '.\batch_scripts\revert_configure_programs.bat'
53 | }
54 |
55 | function secure_window {
56 | & '.\batch_scripts\secure_window.bat'
57 | }
58 |
59 | function revert_secure_window {
60 | & '.\batch_scripts\revert_secure_window.bat'
61 | }
62 |
63 | function nuke_window {
64 | & '.\batch_scripts\nuke_window.bat'
65 | }
66 |
67 | function harden_window {
68 | configure_window_privacy
69 | configure_programs
70 | secure_window
71 | }
72 |
73 | function revert_hardening {
74 | revert_configure_window_privacy
75 | revert_configure_programs
76 | revert_secure_window
77 | }
78 |
79 | function privacy_bloat_cleanup {
80 | privacy_cleanup
81 | remove_bloatware
82 | }
83 |
84 | # asciiart DO NOT MOVE
85 | $asciiart = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("X19fX19fX19fXyAgICAgICAgLl9fICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX19fX19fX18gICAgICAgICAgICAgICAgICAgICAKXF9fX19fXyAgIFxfX19fX19ffF9ffF9fICBfX19fX19fICAgIF9fX18gX19fLl9fLi8gICBfX19fXy8gX19fXyBfX18gIF9fX19fXy5fXy4KIHwgICAgIF9fXy9cXyAgX18gXCAgXCAgXC8gL1xfXyAgXCBfLyBfX188ICAgfCAgfFxfX19fXyAgXF8vIF9fIFxcICBcLyAgPCAgIHwgIHwKIHwgICAgfCAgICAgfCAgfCBcLyAgfFwgICAvICAvIF9fIFxcICBcX19fXF9fXyAgfC8gICAgICAgIFwgIF9fXy8gPiAgICA8IFxfX18gIHwKIHxfX19ffCAgICAgfF9ffCAgfF9ffCBcXy8gIChfX19fICAvXF9fXyAgPiBfX19fL19fX19fX18gIC9cX19fICA+X18vXF8gXC8gX19fX3wKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXC8gICAgIFwvXC8gICAgICAgICAgICBcLyAgICAgXC8gICAgICBcL1wvICAgICAKCiAgICAgICAgICAgICAgICAgICAgKy0rLSstKy0rLSstKy0rICstKy0rICstKy0rLSstKy0rLSstKy0rLSsKICAgICAgICAgICAgICAgICAgICB8UHxvfHd8ZXxyfGV8ZHwgfGJ8eXwgfEJ8cnxvfG98dHx3fGF8cnxlfAogICAgICAgICAgICAgICAgICAgICstKy0rLSstKy0rLSstKyArLSstKyArLSstKy0rLSstKy0rLSstKy0r"))
86 |
87 | function exit_screen {
88 | Write-Host "$asciiart"
89 | Write-Host "`n`nYour privacy and security is now hardened 🎉💪"
90 | }
91 |
92 |
93 |
94 | function win_menu {
95 | Clear-Host
96 | Write-Host "$asciiart"
97 | Write-Host "`n Select an option from menu: Rev:$revision" # function call list
98 | Write-Host "`n Key Menu Option: Description:"
99 | Write-Host " --- ------------ ------------"
100 | Write-Host " 1 - Configure window privacy Enforce privacy on your window " # configure_window_privacy
101 | Write-Host " 2 - Revert window privacy config Revert privacy config on your window " # revert_configure_window_privacy
102 | Write-Host " 3 - Configure programs Enforce 3rd party programs privacy on your window " # configure_programs
103 | Write-Host " 4 - Revert Programs config Revert 3rd party programs privacy CONFIG on your window " # revert_configure_programs
104 | Write-Host " 5 - Secure your window Secure all the unused services on window " # secure_window
105 | Write-Host " 6 - Revert security configs Revert all the security configs on window" # revert_secure_window
106 | Write-Host " 7 - Lite privacy cleanup Small privacy clean up" # privacy_cleanup
107 | Write-Host " 8 - Remove bloatware Remove pre-installed windows store apps" # remove_bloatware
108 | Write-Host " 9 - Revert bloatware Revert removing some pre-installed windows store apps" # revert_some_bloatware
109 | Write-Host " 0 - Nuke window WARNING!!! This will remove all your windows credentials,os log and reset privacy settings\n" # nuke_window
110 | Write-Host " `nPress key for menu item selection or press Q to exit "
111 | $selection = ([System.Console]::ReadKey(("NoEcho"))).KeyChar
112 |
113 | switch ($selection) {
114 | 1 {
115 | configure_window_privacy
116 | } 2 {
117 | revert_configure_window_privacy
118 | } 3 {
119 | configure_programs
120 | } 4 {
121 | revert_configure_programs
122 | } 5 {
123 | secure_window
124 | } 6 {
125 | revert_secure_window
126 | } 7 {
127 | privacy_cleanup
128 | } 8 {
129 | remove_bloatware
130 | } 9 {
131 | revert_some_bloatware
132 | } 0 {
133 | nuke_window
134 | }
135 |
136 | q {
137 | Write-Host "`n`n Exiting enforce_windows.ps1 - Happy computing! `n"
138 | exit_screen
139 | return
140 | } Default {
141 | win_menu
142 | }
143 | }
144 | }
145 |
146 | function win_help {
147 | Write-Host "`n valid command line arguements are : `n `n menu brings you to main menu of the program `n" `
148 | " help shows help menu for arguments `n harden run all security and privacy enforcements`n" `
149 | " revert revert all enforcements `n cleanup remove non critical windows data`n" `
150 | " nuke remove all your OS history"
151 | return
152 | Write-Host "`n valid command line arguements are : `n `n harden run all security and privacy enforcements `n" `
153 | "revert revert all enforcements `n cleanup remove all your bash history,os log and reset privacy settings" `
154 | return
155 | }
156 |
157 | check_for_admin
158 | if ($choice -eq "") {
159 | win_menu
160 | }
161 | else {
162 | switch ($choice) {
163 | "menu" {
164 | win_menu
165 | }
166 | "help" {
167 | win_help
168 | }
169 | "harden" {
170 | harden_window
171 | }
172 | "revert" {
173 | revert_hardening
174 | }
175 | "cleanup" {
176 | privacy_bloat_cleanup
177 | }
178 | Default {
179 | win_help
180 | }
181 | }
182 | }
--------------------------------------------------------------------------------
/bash_scripts/secure_mac.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | secure_mac() {
3 | # ----------------------------------------------------------
4 | # ------------------Disable Captive portal------------------
5 | # ----------------------------------------------------------
6 | echo '--- Disable Captive portal'
7 | sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.captive.control.plist Active -bool false
8 | # ----------------------------------------------------------
9 |
10 | # ----------------------------------------------------------
11 | # ---------------Enable application firewall----------------
12 | # ----------------------------------------------------------
13 | echo '--- Enable application firewall'
14 | /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
15 | sudo defaults write /Library/Preferences/com.apple.alf globalstate -bool true
16 | defaults write com.apple.security.firewall EnableFirewall -bool true
17 | # ----------------------------------------------------------
18 |
19 | # ----------------------------------------------------------
20 | # -----------------Turn on firewall logging-----------------
21 | # ----------------------------------------------------------
22 | echo '--- Turn on firewall logging'
23 | /usr/libexec/ApplicationFirewall/socketfilterfw --setloggingmode on
24 | sudo defaults write /Library/Preferences/com.apple.alf loggingenabled -bool true
25 | # ----------------------------------------------------------
26 |
27 | # ----------------------------------------------------------
28 | # -------------------Turn on stealth mode-------------------
29 | # ----------------------------------------------------------
30 | echo '--- Turn on stealth mode'
31 | /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on
32 | sudo defaults write /Library/Preferences/com.apple.alf stealthenabled -bool true
33 | defaults write com.apple.security.firewall EnableStealthMode -bool true
34 | # ----------------------------------------------------------
35 |
36 | # ----------------------------------------------------------
37 | # -Disable remote login (incoming SSH and SFTP connections)-
38 | # ----------------------------------------------------------
39 | echo '--- Disable remote login (incoming SSH and SFTP connections)'
40 | echo 'yes' | sudo systemsetup -setremotelogin off
41 | # ----------------------------------------------------------
42 |
43 | # ----------------------------------------------------------
44 | # --------------Disable insecure TFTP service---------------
45 | # ----------------------------------------------------------
46 | echo '--- Disable insecure TFTP service'
47 | sudo launchctl disable 'system/com.apple.tftpd'
48 | # ----------------------------------------------------------
49 |
50 | # ----------------------------------------------------------
51 | # ----------Disable Bonjour multicast advertising-----------
52 | # ----------------------------------------------------------
53 | echo '--- Disable Bonjour multicast advertising'
54 | sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool true
55 | # ----------------------------------------------------------
56 |
57 | # ----------------------------------------------------------
58 | # -------------Disable insecure telnet protocol-------------
59 | # ----------------------------------------------------------
60 | echo '--- Disable insecure telnet protocol'
61 | sudo launchctl disable system/com.apple.telnetd
62 | # ----------------------------------------------------------
63 |
64 | # ----------------------------------------------------------
65 | # --Disable sharing of local printers with other computers--
66 | # ----------------------------------------------------------
67 | echo '--- Disable sharing of local printers with other computers'
68 | cupsctl --no-share-printers
69 | # ----------------------------------------------------------
70 |
71 | # ----------------------------------------------------------
72 | # -Disable printing from any address including the Internet-
73 | # ----------------------------------------------------------
74 | echo '--- Disable printing from any address including the Internet'
75 | cupsctl --no-remote-any
76 | # ----------------------------------------------------------
77 |
78 | # ----------------------------------------------------------
79 | # ----------Disable remote printer administration-----------
80 | # ----------------------------------------------------------
81 | echo '--- Disable remote printer administration'
82 | cupsctl --no-remote-admin
83 | # ----------------------------------------------------------
84 | }
85 |
86 | revert_seure_mac() {
87 | # ----------------------------------------------------------
88 | # -----------Enable application firewall (revert)-----------
89 | # ----------------------------------------------------------
90 | echo '--- Enable application firewall (revert)'
91 | /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
92 | sudo defaults write /Library/Preferences/com.apple.alf globalstate -bool false
93 | defaults write com.apple.security.firewall EnableFirewall -bool false
94 | # ----------------------------------------------------------
95 |
96 | # ----------------------------------------------------------
97 | # ------------Turn on firewall logging (revert)-------------
98 | # ----------------------------------------------------------
99 | echo '--- Turn on firewall logging (revert)'
100 | /usr/libexec/ApplicationFirewall/socketfilterfw --setloggingmode off
101 | sudo defaults write /Library/Preferences/com.apple.alf loggingenabled -bool false
102 | # ----------------------------------------------------------
103 |
104 | # ----------------------------------------------------------
105 | # --------------Turn on stealth mode (revert)---------------
106 | # ----------------------------------------------------------
107 | echo '--- Turn on stealth mode (revert)'
108 | /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode off
109 | sudo defaults write /Library/Preferences/com.apple.alf stealthenabled -bool false
110 | defaults write com.apple.security.firewall EnableStealthMode -bool false
111 | # ----------------------------------------------------------
112 |
113 | # Disable remote login (incoming SSH and SFTP connections) (revert)
114 | echo '--- Disable remote login (incoming SSH and SFTP connections) (revert)'
115 | sudo systemsetup -setremotelogin on
116 | # ----------------------------------------------------------
117 |
118 | # ----------------------------------------------------------
119 | # ----------Disable insecure TFTP service (revert)----------
120 | # ----------------------------------------------------------
121 | echo '--- Disable insecure TFTP service (revert)'
122 | sudo launchctl enable 'system/com.apple.tftpd'
123 | # ----------------------------------------------------------
124 |
125 | # ----------------------------------------------------------
126 | # ------Disable Bonjour multicast advertising (revert)------
127 | # ----------------------------------------------------------
128 | echo '--- Disable Bonjour multicast advertising (revert)'
129 | sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool false
130 | # ----------------------------------------------------------
131 |
132 | # ----------------------------------------------------------
133 | # --------Disable insecure telnet protocol (revert)---------
134 | # ----------------------------------------------------------
135 | echo '--- Disable insecure telnet protocol (revert)'
136 | sudo launchctl enable system/com.apple.telnetd
137 | # ----------------------------------------------------------
138 |
139 | # Disable sharing of local printers with other computers (revert)
140 | echo '--- Disable sharing of local printers with other computers (revert)'
141 | cupsctl --share-printers
142 | # ----------------------------------------------------------
143 |
144 | # Disable printing from any address including the Internet (revert)
145 | echo '--- Disable printing from any address including the Internet (revert)'
146 | cupsctl --remote-any
147 | # ----------------------------------------------------------
148 |
149 | # ----------------------------------------------------------
150 | # ------Disable remote printer administration (revert)------
151 | # ----------------------------------------------------------
152 | echo '--- Disable remote printer administration (revert)'
153 | cupsctl --remote-admin
154 | # ----------------------------------------------------------
155 |
156 | # ----------------------------------------------------------
157 | # -------------Disable Captive portal (revert)--------------
158 | # ----------------------------------------------------------
159 | echo '--- Disable Captive portal (revert)'
160 | sudo defaults delete /Library/Preferences/SystemConfiguration/com.apple.captive.control.plist Active
161 | # ----------------------------------------------------------
162 | }
163 |
--------------------------------------------------------------------------------
/batch_scripts/privacy_cleanup.bat:
--------------------------------------------------------------------------------
1 | :: ----------------------------------------------------------
2 | :: ------------Delete controversial default0 user------------
3 | :: ----------------------------------------------------------
4 | echo --- Delete controversial default0 user
5 | net user defaultuser0 /delete 2>nul
6 | :: ----------------------------------------------------------
7 |
8 |
9 | :: ----------------------------------------------------------
10 | :: --------Enable Reset Base in Dism Component Store---------
11 | :: ----------------------------------------------------------
12 | echo --- Enable Reset Base in Dism Component Store
13 | reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\SideBySide\Configuration" /v "DisableResetbase" /t "REG_DWORD" /d "0" /f
14 | :: ----------------------------------------------------------
15 |
16 |
17 | :: ----------------------------------------------------------
18 | :: -------------Remove Default Apps Associations-------------
19 | :: ----------------------------------------------------------
20 | echo --- Remove Default Apps Associations
21 | dism /online /Remove-DefaultAppAssociations
22 | :: ----------------------------------------------------------
23 |
24 |
25 | :: ----------------------------------------------------------
26 | :: -------------Clear (Reset) Network Data Usage-------------
27 | :: ----------------------------------------------------------
28 | echo --- Clear (Reset) Network Data Usage
29 | setlocal EnableDelayedExpansion
30 | SET /A dps_service_running=0
31 | SC queryex "DPS"|Find "STATE"|Find /v "RUNNING">Nul||(
32 | SET /A dps_service_running=1
33 | net stop DPS
34 | )
35 | del /F /S /Q /A "%windir%\System32\sru*"
36 | IF !dps_service_running! == 1 (
37 | net start DPS
38 | )
39 | endlocal
40 | :: ----------------------------------------------------------
41 |
42 |
43 | :: ----------------------------------------------------------
44 | :: --------------------Clear Flash traces--------------------
45 | :: ----------------------------------------------------------
46 | echo --- Clear Flash traces
47 | rd /s /q "%APPDATA%\Macromedia\Flash Player"
48 | :: ----------------------------------------------------------
49 |
50 |
51 | :: ----------------------------------------------------------
52 | :: -----------Clear Steam dumps, logs, and traces------------
53 | :: ----------------------------------------------------------
54 | echo --- Clear Steam dumps, logs, and traces
55 | del /f /q %ProgramFiles(x86)%\Steam\Dumps
56 | del /f /q %ProgramFiles(x86)%\Steam\Traces
57 | del /f /q %ProgramFiles(x86)%\Steam\appcache\*.log
58 | :: ----------------------------------------------------------
59 |
60 |
61 | :: ----------------------------------------------------------
62 | :: -----Clear Visual Studio telemetry and feedback data------
63 | :: ----------------------------------------------------------
64 | echo --- Clear Visual Studio telemetry and feedback data
65 | rmdir /s /q "%AppData%\vstelemetry" 2>nul
66 | rmdir /s /q "%LocalAppData%\Microsoft\VSApplicationInsights" 2>nul
67 | rmdir /s /q "%ProgramData%\Microsoft\VSApplicationInsights" 2>nul
68 | rmdir /s /q "%Temp%\Microsoft\VSApplicationInsights" 2>nul
69 | rmdir /s /q "%Temp%\VSFaultInfo" 2>nul
70 | rmdir /s /q "%Temp%\VSFeedbackPerfWatsonData" 2>nul
71 | rmdir /s /q "%Temp%\VSFeedbackVSRTCLogs" 2>nul
72 | rmdir /s /q "%Temp%\VSRemoteControl" 2>nul
73 | rmdir /s /q "%Temp%\VSTelem" 2>nul
74 | rmdir /s /q "%Temp%\VSTelem.Out" 2>nul
75 | :: ----------------------------------------------------------
76 |
77 |
78 | :: ----------------------------------------------------------
79 | :: ----------------Clear Dotnet CLI telemetry----------------
80 | :: ----------------------------------------------------------
81 | echo --- Clear Dotnet CLI telemetry
82 | rmdir /s /q "%USERPROFILE%\.dotnet\TelemetryStorageService" 2>nul
83 | :: ----------------------------------------------------------
84 |
85 |
86 | :: ----------------------------------------------------------
87 | :: -----------------Clear Windows temp files-----------------
88 | :: ----------------------------------------------------------
89 | echo --- Clear Windows temp files
90 | del /f /q %localappdata%\Temp\*
91 | rd /s /q "%WINDIR%\Temp"
92 | rd /s /q "%TEMP%"
93 | :: ----------------------------------------------------------
94 |
95 |
96 | :: ----------------------------------------------------------
97 | :: ----------------Clear main telemetry file-----------------
98 | :: ----------------------------------------------------------
99 | echo --- Clear main telemetry file
100 | if exist "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl" (
101 | takeown /f "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl" /r /d y
102 | icacls "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl" /grant administrators:F /t
103 | echo "" > "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl"
104 | echo Clear successful: "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl"
105 | ) else (
106 | echo "Main telemetry file does not exist. Good!"
107 | )
108 | :: ----------------------------------------------------------
109 |
110 |
111 | :: ----------------------------------------------------------
112 | :: ------------------Clear regedit last key------------------
113 | :: ----------------------------------------------------------
114 | echo --- Clear regedit last key
115 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" /va /f
116 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit" /va /f
117 | :: ----------------------------------------------------------
118 |
119 |
120 | :: ----------------------------------------------------------
121 | :: -----------------Clear regedit favorites------------------
122 | :: ----------------------------------------------------------
123 | echo --- Clear regedit favorites
124 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites" /va /f
125 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites" /va /f
126 | :: ----------------------------------------------------------
127 |
128 |
129 | :: ----------------------------------------------------------
130 | :: -----------Clear list of recent programs opened-----------
131 | :: ----------------------------------------------------------
132 | echo --- Clear list of recent programs opened
133 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedPidlMRU" /va /f
134 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedPidlMRULegacy" /va /f
135 | :: ----------------------------------------------------------
136 |
137 |
138 | :: ----------------------------------------------------------
139 | :: --------------Clear Adobe Media Browser MRU---------------
140 | :: ----------------------------------------------------------
141 | echo --- Clear Adobe Media Browser MRU
142 | reg delete "HKCU\Software\Adobe\MediaBrowser\MRU" /va /f
143 | :: ----------------------------------------------------------
144 |
145 |
146 | :: ----------------------------------------------------------
147 | :: --------------------Clear MSPaint MRU---------------------
148 | :: ----------------------------------------------------------
149 | echo --- Clear MSPaint MRU
150 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List" /va /f
151 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List" /va /f
152 | :: ----------------------------------------------------------
153 |
154 |
155 | :: ----------------------------------------------------------
156 | :: --------------------Clear Wordpad MRU---------------------
157 | :: ----------------------------------------------------------
158 | echo --- Clear Wordpad MRU
159 | reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Wordpad\Recent File List" /va /f
160 | :: ----------------------------------------------------------
161 |
162 |
163 | :: ----------------------------------------------------------
164 | :: -------------Clear Map Network Drive MRU MRU--------------
165 | :: ----------------------------------------------------------
166 | echo --- Clear Map Network Drive MRU MRU
167 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU" /va /f
168 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU" /va /f
169 | :: ----------------------------------------------------------
170 |
171 |
172 | :: ----------------------------------------------------------
173 | :: ----------Clear Windows Search Assistant history----------
174 | :: ----------------------------------------------------------
175 | echo --- Clear Windows Search Assistant history
176 | reg delete "HKCU\Software\Microsoft\Search Assistant\ACMru" /va /f
177 | :: ----------------------------------------------------------
178 |
179 |
180 | :: ----------------------------------------------------------
181 | :: ------Clear list of Recent Files Opened, by Filetype------
182 | :: ----------------------------------------------------------
183 | echo --- Clear list of Recent Files Opened, by Filetype
184 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs" /va /f
185 | reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs" /va /f
186 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU" /va /f
187 | :: ----------------------------------------------------------
188 |
189 |
190 | :: ----------------------------------------------------------
191 | :: -----Clear windows media player recent files and URLs-----
192 | :: ----------------------------------------------------------
193 | echo --- Clear windows media player recent files and URLs
194 | reg delete "HKCU\Software\Microsoft\MediaPlayer\Player\RecentFileList" /va /f
195 | reg delete "HKCU\Software\Microsoft\MediaPlayer\Player\RecentURLList" /va /f
196 | reg delete "HKLM\SOFTWARE\Microsoft\MediaPlayer\Player\RecentFileList" /va /f
197 | reg delete "HKLM\SOFTWARE\Microsoft\MediaPlayer\Player\RecentURLList" /va /f
198 | :: ----------------------------------------------------------
199 |
200 |
201 | :: ----------------------------------------------------------
202 | :: ------Clear Most Recent Application's Use of DirectX------
203 | :: ----------------------------------------------------------
204 | echo --- Clear Most Recent Application's Use of DirectX
205 | reg delete "HKCU\Software\Microsoft\Direct3D\MostRecentApplication" /va /f
206 | reg delete "HKLM\SOFTWARE\Microsoft\Direct3D\MostRecentApplication" /va /f
207 | :: ----------------------------------------------------------
208 |
209 |
210 | :: ----------------------------------------------------------
211 | :: ------------Clear Windows Run MRU & typedpaths------------
212 | :: ----------------------------------------------------------
213 | echo --- Clear Windows Run MRU ^& typedpaths
214 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /va /f
215 | reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\TypedPaths" /va /f
216 | :: ----------------------------------------------------------
217 |
218 |
219 | :: ----------------------------------------------------------
220 | :: --------------Clear recently accessed files---------------
221 | :: ----------------------------------------------------------
222 | echo --- Clear recently accessed files
223 | del /f /q "%APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations\*"
224 | :: ----------------------------------------------------------
225 |
226 |
227 | :: ----------------------------------------------------------
228 | :: --------------Clear Internet Explorer caches--------------
229 | :: ----------------------------------------------------------
230 | echo --- Clear Internet Explorer caches
231 | del /f /q "%localappdata%\Microsoft\Windows\INetCache\IE\*"
232 | rd /s /q "%localappdata%\Microsoft\Windows\WebCache"
233 | :: ----------------------------------------------------------
234 |
235 |
236 | :: ----------------------------------------------------------
237 | :: ------Clear Temporary Internet Files (browser cache)------
238 | :: ----------------------------------------------------------
239 | echo --- Clear Temporary Internet Files (browser cache)
240 | :: Windows XP
241 | rd /s /q %userprofile%\Local Settings\Temporary Internet Files
242 | :: Windows 7
243 | rd /s /q "%localappdata%\Microsoft\Windows\Temporary Internet Files"
244 | takeown /f "%localappdata%\Temporary Internet Files" /r /d y
245 | icacls "%localappdata%\Temporary Internet Files" /grant administrators:F /t
246 | rd /s /q "%localappdata%\Temporary Internet Files"
247 | :: Windows 8 and above
248 | rd /s /q "%localappdata%\Microsoft\Windows\INetCache"
249 | :: ----------------------------------------------------------
250 |
251 |
252 | :: ----------------------------------------------------------
253 | :: -----------Clear Internet Explorer Feeds Cache------------
254 | :: ----------------------------------------------------------
255 | echo --- Clear Internet Explorer Feeds Cache
256 | rd /s /q "%localappdata%\Microsoft\Feeds Cache"
257 | :: ----------------------------------------------------------
258 |
259 |
260 | :: ----------------------------------------------------------
261 | :: -------------Clear Internet Explorer DOMStore-------------
262 | :: ----------------------------------------------------------
263 | echo --- Clear Internet Explorer DOMStore
264 | rd /s /q "%localappdata%\Microsoft\InternetExplorer\DOMStore"
265 | :: ----------------------------------------------------------
266 |
267 |
268 | :: ----------------------------------------------------------
269 | :: ------------Clear Google Chrome crash reports-------------
270 | :: ----------------------------------------------------------
271 | echo --- Clear Google Chrome crash reports
272 | rd /s /q "%localappdata%\Google\Chrome\User Data\Crashpad\reports\"
273 | rd /s /q "%localappdata%\Google\CrashReports\"
274 | :: ----------------------------------------------------------
275 |
276 |
277 | :: ----------------------------------------------------------
278 | :: ------------Clear Software Reporter Tool logs-------------
279 | :: ----------------------------------------------------------
280 | echo --- Clear Software Reporter Tool logs
281 | del /f /q "%localappdata%\Google\Software Reporter Tool\*.log"
282 | :: ----------------------------------------------------------
283 |
284 |
285 | :: ----------------------------------------------------------
286 | :: ------------Clear browsing history and caches-------------
287 | :: ----------------------------------------------------------
288 | echo --- Clear browsing history and caches
289 | set ignoreFiles="content-prefs.sqlite" "permissions.sqlite" "favicons.sqlite"
290 | for %%d in ("%APPDATA%\Mozilla\Firefox\Profiles\"
291 | "%USERPROFILE%\Local Settings\Application Data\Mozilla\Firefox\Profiles\"
292 | ) do (
293 | IF EXIST %%d (
294 | FOR /d %%p IN (%%d*) DO (
295 | for /f "delims=" %%f in ('dir /b /s "%%p\*.sqlite" 2^>nul') do (
296 | set "continue="
297 | for %%i in (%ignoreFiles%) do (
298 | if %%i == "%%~nxf" (
299 | set continue=1
300 | )
301 | )
302 | if not defined continue (
303 | del /q /s /f %%f
304 | )
305 | )
306 | )
307 | )
308 | )
309 | :: ----------------------------------------------------------
310 |
311 |
312 | :: ----------------------------------------------------------
313 | :: -------------------Clear Webpage Icons--------------------
314 | :: ----------------------------------------------------------
315 | echo --- Clear Webpage Icons
316 | :: Windows XP
317 | del /q /s /f "%USERPROFILE%\Local Settings\Application Data\Safari\WebpageIcons.db"
318 | :: Windows Vista and later
319 | del /q /s /f "%localappdata%\Apple Computer\Safari\WebpageIcons.db"
320 | :: ----------------------------------------------------------
321 |
322 |
323 | :: ----------------------------------------------------------
324 | :: --------------------Clear Safari cache--------------------
325 | :: ----------------------------------------------------------
326 | echo --- Clear Safari cache
327 | :: Windows XP
328 | del /q /s /f "%USERPROFILE%\Local Settings\Application Data\Apple Computer\Safari\Cache.db"
329 | :: Windows Vista and later
330 | del /q /s /f "%localappdata%\Apple Computer\Safari\Cache.db"
331 | :: ----------------------------------------------------------
332 |
333 |
334 | :: ----------------------------------------------------------
335 | :: Clear Optional Component Manager and COM+ components logs-
336 | :: ----------------------------------------------------------
337 | echo --- Clear Optional Component Manager and COM+ components logs
338 | del /f /q %SystemRoot%\comsetup.log
339 | :: ----------------------------------------------------------
340 |
341 |
342 | :: ----------------------------------------------------------
343 | :: ------Clear Distributed Transaction Coordinator logs------
344 | :: ----------------------------------------------------------
345 | echo --- Clear Distributed Transaction Coordinator logs
346 | del /f /q %SystemRoot%\DtcInstall.log
347 | :: ----------------------------------------------------------
348 |
349 |
350 | :: ----------------------------------------------------------
351 | :: ------Clear Windows Deployment Upgrade Process Logs-------
352 | :: ----------------------------------------------------------
353 | echo --- Clear Windows Deployment Upgrade Process Logs
354 | del /f /q %SystemRoot%\setupact.log
355 | del /f /q %SystemRoot%\setuperr.log
356 | :: ----------------------------------------------------------
357 |
358 |
359 | :: ----------------------------------------------------------
360 | :: -----------------Clear Windows Setup Logs-----------------
361 | :: ----------------------------------------------------------
362 | echo --- Clear Windows Setup Logs
363 | del /f /q %SystemRoot%\setupapi.log
364 | del /f /q %SystemRoot%\Panther\*
365 | del /f /q %SystemRoot%\inf\setupapi.app.log
366 | del /f /q %SystemRoot%\inf\setupapi.dev.log
367 | del /f /q %SystemRoot%\inf\setupapi.offline.log
368 | :: ----------------------------------------------------------
369 |
370 |
371 | :: ----------------------------------------------------------
372 | :: --------Clear Windows System Assessment Tool logs---------
373 | :: ----------------------------------------------------------
374 | echo --- Clear Windows System Assessment Tool logs
375 | del /f /q %SystemRoot%\Performance\WinSAT\winsat.log
376 | :: ----------------------------------------------------------
377 |
378 |
379 | :: ----------------------------------------------------------
380 | :: ---------------Clear Password change events---------------
381 | :: ----------------------------------------------------------
382 | echo --- Clear Password change events
383 | del /f /q %SystemRoot%\debug\PASSWD.LOG
384 | :: ----------------------------------------------------------
385 |
386 |
387 | :: ----------------------------------------------------------
388 | :: --------------Clear user web cache database---------------
389 | :: ----------------------------------------------------------
390 | echo --- Clear user web cache database
391 | del /f /q %localappdata%\Microsoft\Windows\WebCache\*.*
392 | :: ----------------------------------------------------------
393 |
394 |
395 | :: ----------------------------------------------------------
396 | :: ----Clear system temp folder when no one is logged in-----
397 | :: ----------------------------------------------------------
398 | echo --- Clear system temp folder when no one is logged in
399 | del /f /q %SystemRoot%\ServiceProfiles\LocalService\AppData\Local\Temp\*.*
400 | :: ----------------------------------------------------------
401 |
402 |
403 | :: Clear DISM (Deployment Image Servicing and Management) Logs
404 | echo --- Clear DISM (Deployment Image Servicing and Management) Logs
405 | del /f /q %SystemRoot%\Logs\CBS\CBS.log
406 | del /f /q %SystemRoot%\Logs\DISM\DISM.log
407 | :: ----------------------------------------------------------
408 |
409 |
410 | :: ----------------------------------------------------------
411 | :: ---------------Common Language Runtime Logs---------------
412 | :: ----------------------------------------------------------
413 | echo --- Common Language Runtime Logs
414 | del /f /q "%LocalAppData%\Microsoft\CLR_v4.0\UsageTraces\*"
415 | del /f /q "%LocalAppData%\Microsoft\CLR_v4.0_32\UsageTraces\*"
416 | :: ----------------------------------------------------------
417 |
418 |
419 | :: ----------------------------------------------------------
420 | :: ------------Network Setup Service Events Logs-------------
421 | :: ----------------------------------------------------------
422 | echo --- Network Setup Service Events Logs
423 | del /f /q "%SystemRoot%\Logs\NetSetup\*"
424 | :: ----------------------------------------------------------
425 |
426 |
427 | :: ----------------------------------------------------------
428 | :: ----------Clear Windows update and SFC scan logs----------
429 | :: ----------------------------------------------------------
430 | echo --- Clear Windows update and SFC scan logs
431 | del /f /q %SystemRoot%\Temp\CBS\*
432 | :: ----------------------------------------------------------
433 |
434 |
435 | :: ----------------------------------------------------------
436 | :: ---------Clear Windows Update Medic Service logs----------
437 | :: ----------------------------------------------------------
438 | echo --- Clear Windows Update Medic Service logs
439 | takeown /f %SystemRoot%\Logs\waasmedic /r /d y
440 | icacls %SystemRoot%\Logs\waasmedic /grant administrators:F /t
441 | rd /s /q %SystemRoot%\Logs\waasmedic
442 | :: ----------------------------------------------------------
443 |
444 |
445 | :: ----------------------------------------------------------
446 | :: -----------Clear Cryptographic Services Traces------------
447 | :: ----------------------------------------------------------
448 | echo --- Clear Cryptographic Services Traces
449 | del /f /q %SystemRoot%\System32\catroot2\dberr.txt
450 | del /f /q %SystemRoot%\System32\catroot2.log
451 | del /f /q %SystemRoot%\System32\catroot2.jrs
452 | del /f /q %SystemRoot%\System32\catroot2.edb
453 | del /f /q %SystemRoot%\System32\catroot2.chk
454 | :: ----------------------------------------------------------
455 |
--------------------------------------------------------------------------------
/bash_scripts/nuke_history.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | nuke_history() {
3 | # ----------------------------------------------------------
4 | # --------------------Clear bash history--------------------
5 | # ----------------------------------------------------------
6 | echo -e '\n--- Clear bash history'
7 | rm -f ~/.bash_history
8 | # ----------------------------------------------------------
9 |
10 | # ----------------------------------------------------------
11 | # --------------------Clear zsh history---------------------
12 | # ----------------------------------------------------------
13 | echo -e '\n--- Clear zsh history'
14 | rm -f ~/.zsh_history
15 | # ----------------------------------------------------------
16 |
17 | # ----------------------------------------------------------
18 | # --------------Clear system application logs---------------
19 | # ----------------------------------------------------------
20 | echo -e '\n--- Clear system application logs'
21 | sudo rm -rfv /Library/Logs/*
22 | # ----------------------------------------------------------
23 |
24 | # ----------------------------------------------------------
25 | # ---------------------Clear Mail logs----------------------
26 | # ----------------------------------------------------------
27 | echo -e '\n--- Clear Mail logs'
28 | rm -rfv ~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail/*
29 | # ----------------------------------------------------------
30 |
31 | # Clear audit logs (login, logout, authentication and other user activity)
32 | echo -e '\n--- Clear audit logs (login, logout, authentication and other user activity)'
33 | sudo rm -rfv /var/audit/*
34 | sudo rm -rfv /private/var/audit/*
35 | # ----------------------------------------------------------
36 |
37 | # ----------------------------------------------------------
38 | # --------------Clear user logs (user reports)--------------
39 | # ----------------------------------------------------------
40 | echo -e '\n--- Clear user logs (user reports)'
41 | sudo rm -rfv ~/Library/Logs/*
42 | # ----------------------------------------------------------
43 |
44 | # ----------------------------------------------------------
45 | # ---------------------Clear daily logs---------------------
46 | # ----------------------------------------------------------
47 | echo -e '\n--- Clear daily logs'
48 | sudo rm -fv /System/Library/LaunchDaemons/com.apple.periodic-*.plist
49 | # ----------------------------------------------------------
50 |
51 | # ----------------------------------------------------------
52 | # ------Clear receipt logs for installed packages/apps------
53 | # ----------------------------------------------------------
54 | echo -e '\n--- Clear receipt logs for installed packages/apps'
55 | sudo rm -rfv /var/db/receipts/*
56 | sudo rm -vf /Library/Receipts/InstallHistory.plist
57 | # ----------------------------------------------------------
58 |
59 | # ----------------------------------------------------------
60 | # ------------------Clear diagnostics logs------------------
61 | # ----------------------------------------------------------
62 | echo -e '\n--- Clear diagnostics logs'
63 | sudo rm -rfv /private/var/db/diagnostics/*
64 | sudo rm -rfv /var/db/diagnostics/*
65 | # ----------------------------------------------------------
66 |
67 | # ----------------------------------------------------------
68 | # -------------Clear shared-cache strings data--------------
69 | # ----------------------------------------------------------
70 | echo -e '\n--- Clear shared-cache strings data'
71 | sudo rm -rfv /private/var/db/uuidtext/
72 | sudo rm -rfv /var/db/uuidtext/
73 | # ----------------------------------------------------------
74 |
75 | # ----------------------------------------------------------
76 | # --------------Clear Apple System Logs (ASL)---------------
77 | # ----------------------------------------------------------
78 | echo -e '\n--- Clear Apple System Logs (ASL)'
79 | sudo rm -rfv /private/var/log/asl/*
80 | sudo rm -rfv /var/log/asl/*
81 | sudo rm -fv /var/log/asl.log # Legacy ASL (10.4)
82 | sudo rm -fv /var/log/asl.db
83 | # ----------------------------------------------------------
84 |
85 | # ----------------------------------------------------------
86 | # --------------------Clear install logs--------------------
87 | # ----------------------------------------------------------
88 | echo -e '\n--- Clear install logs'
89 | sudo rm -fv /var/log/install.log
90 | # ----------------------------------------------------------
91 |
92 | # ----------------------------------------------------------
93 | # ------------------Clear all system logs-------------------
94 | # ----------------------------------------------------------
95 | echo -e '\n--- Clear all system logs'
96 | sudo rm -rfv /var/log/*
97 | # ----------------------------------------------------------
98 |
99 | # ----------------------------------------------------------
100 | # -----------Clear Google Chrome browsing history-----------
101 | # ----------------------------------------------------------
102 | echo -e '\n--- Clear Google Chrome browsing history'
103 | rm -rfv ~/Library/Application\ Support/Google/Chrome/Default/History &>/dev/null
104 | rm -rfv ~/Library/Application\ Support/Google/Chrome/Default/History-journal &>/dev/null
105 | # ----------------------------------------------------------
106 |
107 | # ----------------------------------------------------------
108 | # ----------------Google Chrome Cache Files-----------------
109 | # ----------------------------------------------------------
110 | echo -e '\n--- Google Chrome Cache Files'
111 | sudo rm -rfv ~/Library/Application\ Support/Google/Chrome/Default/Application\ Cache/* &>/dev/null
112 | # ----------------------------------------------------------
113 |
114 | # ----------------------------------------------------------
115 | # --------------Clear Safari browsing history---------------
116 | # ----------------------------------------------------------
117 | echo -e '\n--- Clear Safari browsing history'
118 | rm -f ~/Library/Safari/History.db
119 | rm -f ~/Library/Safari/History.db-lock
120 | rm -f ~/Library/Safari/History.db-shm
121 | rm -f ~/Library/Safari/History.db-wal
122 | # For older versions of Safari
123 | rm -f ~/Library/Safari/History.plist # URL, visit count, webpage title, last visited timestamp, redirected URL, autocomplete
124 | rm -f ~/Library/Safari/HistoryIndex.sk # History index
125 | # ----------------------------------------------------------
126 |
127 | # ----------------------------------------------------------
128 | # --------------Clear Safari downloads history--------------
129 | # ----------------------------------------------------------
130 | echo -e '\n--- Clear Safari downloads history'
131 | rm -f ~/Library/Safari/Downloads.plist
132 | # ----------------------------------------------------------
133 |
134 | # ----------------------------------------------------------
135 | # ------------------Clear Safari top sites------------------
136 | # ----------------------------------------------------------
137 | echo -e '\n--- Clear Safari top sites'
138 | rm -f ~/Library/Safari/TopSites.plist
139 | # ----------------------------------------------------------
140 |
141 | # ----------------------------------------------------------
142 | # ------Clear Safari last session (open tabs) history-------
143 | # ----------------------------------------------------------
144 | echo -e '\n--- Clear Safari last session (open tabs) history'
145 | rm -f ~/Library/Safari/LastSession.plist
146 | # ----------------------------------------------------------
147 |
148 | # ----------------------------------------------------------
149 | # -------------Clear copy of the Safari history-------------
150 | # ----------------------------------------------------------
151 | echo -e '\n--- Clear copy of the Safari history'
152 | rm -rfv ~/Library/Caches/Metadata/Safari/History
153 | # ----------------------------------------------------------
154 |
155 | # ----------------------------------------------------------
156 | # ---Clear search history embedded in Safari preferences----
157 | # ----------------------------------------------------------
158 | echo -e '\n--- Clear search history embedded in Safari preferences'
159 | defaults write ~/Library/Preferences/com.apple.Safari RecentSearchStrings '( )'
160 | # ----------------------------------------------------------
161 |
162 | # ----------------------------------------------------------
163 | # -------------------Clear Safari cookies-------------------
164 | # ----------------------------------------------------------
165 | echo -e '\n--- Clear Safari cookies'
166 | rm -f ~/Library/Cookies/Cookies.binarycookies
167 | # Used before Safari 5.1
168 | rm -f ~/Library/Cookies/Cookies.plist
169 | # ----------------------------------------------------------
170 |
171 | # ----------------------------------------------------------
172 | # -------Clear Safari zoom level preferences per site-------
173 | # ----------------------------------------------------------
174 | echo -e '\n--- Clear Safari zoom level preferences per site'
175 | rm -f ~/Library/Safari/PerSiteZoomPreferences.plist
176 | # ----------------------------------------------------------
177 |
178 | # Clear URLs that are allowed to display notifications in Safari
179 | echo -e '\n--- Clear URLs that are allowed to display notifications in Safari'
180 | rm -f ~/Library/Safari/UserNotificationPreferences.plist
181 | # ----------------------------------------------------------
182 |
183 | # Clear Safari per-site preferences for Downloads, Geolocation, PopUps, and Autoplays
184 | echo -e '\n--- Clear Safari per-site preferences for Downloads, Geolocation, PopUps, and Autoplays'
185 | rm -f ~/Library/Safari/PerSitePreferences.db
186 | # ----------------------------------------------------------
187 |
188 | # ----------------------------------------------------------
189 | # ------Clear Safari cached blobs, URLs and timestamps------
190 | # ----------------------------------------------------------
191 | echo -e '\n--- Clear Safari cached blobs, URLs and timestamps'
192 | rm -f ~/Library/Caches/com.apple.Safari/Cache.db
193 | # ----------------------------------------------------------
194 |
195 | # ----------------------------------------------------------
196 | # -----Clear Safari web page icons displayed on URL bar-----
197 | # ----------------------------------------------------------
198 | echo -e '\n--- Clear Safari web page icons displayed on URL bar'
199 | rm -f ~/Library/Safari/WebpageIcons.db
200 | # ----------------------------------------------------------
201 |
202 | # ----------------------------------------------------------
203 | # --------Clear Safari webpage previews (thumbnails)--------
204 | # ----------------------------------------------------------
205 | echo -e '\n--- Clear Safari webpage previews (thumbnails)'
206 | rm -rfv ~/Library/Caches/com.apple.Safari/Webpage\ Previews
207 | # ----------------------------------------------------------
208 |
209 | # ----------------------------------------------------------
210 | # -------------------Clear Firefox cache--------------------
211 | # ----------------------------------------------------------
212 | echo -e '\n--- Clear Firefox cache'
213 | sudo rm -rf ~/Library/Caches/Mozilla/
214 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/netpredictions.sqlite
215 | # ----------------------------------------------------------
216 |
217 | # ----------------------------------------------------------
218 | # ---------------Delete Firefox form history----------------
219 | # ----------------------------------------------------------
220 | echo -e '\n--- Delete Firefox form history'
221 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/formhistory.sqlite
222 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/formhistory.dat
223 | # ----------------------------------------------------------
224 |
225 | # ----------------------------------------------------------
226 | # -------------Delete Firefox site preferences--------------
227 | # ----------------------------------------------------------
228 | echo -e '\n--- Delete Firefox site preferences'
229 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/content-prefs.sqlite
230 | # ----------------------------------------------------------
231 |
232 | # Delete Firefox session restore data (loads after the browser closes or crashes)
233 | echo -e '\n--- Delete Firefox session restore data (loads after the browser closes or crashes)'
234 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/sessionCheckpoints.json
235 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/sessionstore*.js*
236 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/sessionstore.bak*
237 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/sessionstore-backups/previous.js*
238 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/sessionstore-backups/recovery.js*
239 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/sessionstore-backups/recovery.bak*
240 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/sessionstore-backups/previous.bak*
241 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/sessionstore-backups/upgrade.js*-20*
242 | # ----------------------------------------------------------
243 |
244 | # ----------------------------------------------------------
245 | # -----------------Delete Firefox passwords-----------------
246 | # ----------------------------------------------------------
247 | echo -e '\n--- Delete Firefox passwords'
248 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/signons.txt
249 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/signons2.txt
250 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/signons3.txt
251 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/signons.sqlite
252 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/logins.json
253 | # ----------------------------------------------------------
254 |
255 | # ----------------------------------------------------------
256 | # ---------------Delete Firefox HTML5 cookies---------------
257 | # ----------------------------------------------------------
258 | echo -e '\n--- Delete Firefox HTML5 cookies'
259 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/webappsstore.sqlite
260 | # ----------------------------------------------------------
261 |
262 | # ----------------------------------------------------------
263 | # ---------------Delete Firefox crash reports---------------
264 | # ----------------------------------------------------------
265 | echo -e '\n--- Delete Firefox crash reports'
266 | rm -rfv ~/Library/Application\ Support/Firefox/Crash\ Reports/
267 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/minidumps/*.dmp
268 | # ----------------------------------------------------------
269 |
270 | # ----------------------------------------------------------
271 | # ---------------Delete Firefox backup files----------------
272 | # ----------------------------------------------------------
273 | echo -e '\n--- Delete Firefox backup files'
274 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/bookmarkbackups/*.json
275 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/bookmarkbackups/*.jsonlz4
276 | # ----------------------------------------------------------
277 |
278 | # ----------------------------------------------------------
279 | # ------------------Delete Firefox cookies------------------
280 | # ----------------------------------------------------------
281 | echo -e '\n--- Delete Firefox cookies'
282 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/cookies.txt
283 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/cookies.sqlite
284 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/cookies.sqlite-shm
285 | rm -fv ~/Library/Application\ Support/Firefox/Profiles/*/cookies.sqlite-wal
286 | rm -rfv ~/Library/Application\ Support/Firefox/Profiles/*/storage/default/http*
287 | # ----------------------------------------------------------
288 |
289 | # ----------------------------------------------------------
290 | # --------------------Clear Adobe cache---------------------
291 | # ----------------------------------------------------------
292 | echo -e '\n--- Clear Adobe cache'
293 | sudo rm -rfv ~/Library/Application\ Support/Adobe/Common/Media\ Cache\ Files/* &>/dev/null
294 | # ----------------------------------------------------------
295 |
296 | # ----------------------------------------------------------
297 | # --------------------Clear Gradle cache--------------------
298 | # ----------------------------------------------------------
299 | echo -e '\n--- Clear Gradle cache'
300 | if [ -d "/Users/${HOST}/.gradle/caches" ]; then
301 | rm -rfv ~/.gradle/caches/ &>/dev/null
302 | fi
303 | # ----------------------------------------------------------
304 |
305 | # ----------------------------------------------------------
306 | # -------------------Clear Dropbox cache--------------------
307 | # ----------------------------------------------------------
308 | echo -e '\n--- Clear Dropbox cache'
309 | if [ -d "/Users/${HOST}/Dropbox" ]; then
310 | sudo rm -rfv ~/Dropbox/.dropbox.cache/* &>/dev/null
311 | fi
312 | # ----------------------------------------------------------
313 |
314 | # ----------------------------------------------------------
315 | # -----------Clear Google Drive file stream cache-----------
316 | # ----------------------------------------------------------
317 | echo -e '\n--- Clear Google Drive file stream cache'
318 | killall "Google Drive File Stream"
319 | rm -rfv ~/Library/Application\ Support/Google/DriveFS/[0-9a-zA-Z]*/content_cache &>/dev/null
320 | # ----------------------------------------------------------
321 |
322 | # ----------------------------------------------------------
323 | # -------------------Clear Composer cache-------------------
324 | # ----------------------------------------------------------
325 | echo -e '\n--- Clear Composer cache'
326 | if type "composer" &>/dev/null; then
327 | composer clearcache &>/dev/null
328 | fi
329 | # ----------------------------------------------------------
330 |
331 | # ----------------------------------------------------------
332 | # -------------------Clear Homebrew cache-------------------
333 | # ----------------------------------------------------------
334 | echo -e '\n--- Clear Homebrew cache'
335 | if type "brew" &>/dev/null; then
336 | brew cleanup -s &>/dev/null
337 | rm -rfv $(brew --cache) &>/dev/null
338 | brew tap --repair &>/dev/null
339 | fi
340 | # ----------------------------------------------------------
341 |
342 | # ----------------------------------------------------------
343 | # -----------Clear any old versions of Ruby gems------------
344 | # ----------------------------------------------------------
345 | echo -e '\n--- Clear any old versions of Ruby gems'
346 | if type "gem" &>/dev/null; then
347 | gem cleanup &>/dev/null
348 | fi
349 | # ----------------------------------------------------------
350 |
351 | # ----------------------------------------------------------
352 | # -----------------------Clear Docker-----------------------
353 | # ----------------------------------------------------------
354 | echo -e '\n--- Clear Docker'
355 | if type "docker" &>/dev/null; then
356 | docker system prune -af
357 | fi
358 | # ----------------------------------------------------------
359 |
360 | # ----------------------------------------------------------
361 | # ---------------Clear Pyenv-VirtualEnv cache---------------
362 | # ----------------------------------------------------------
363 | echo -e '\n--- Clear Pyenv-VirtualEnv cache'
364 | if [ "$PYENV_VIRTUALENV_CACHE_PATH" ]; then
365 | rm -rfv $PYENV_VIRTUALENV_CACHE_PATH &>/dev/null
366 | fi
367 | # ----------------------------------------------------------
368 |
369 | # ----------------------------------------------------------
370 | # ---------------------Clear NPM cache----------------------
371 | # ----------------------------------------------------------
372 | echo -e '\n--- Clear NPM cache'
373 | if type "npm" &>/dev/null; then
374 | npm cache clean --force
375 | fi
376 | # ----------------------------------------------------------
377 |
378 | # ----------------------------------------------------------
379 | # ---------------------Clear Yarn cache---------------------
380 | # ----------------------------------------------------------
381 | echo -e '\n--- Clear Yarn cache'
382 | if type "yarn" &>/dev/null; then
383 | echo -e '\nCleanup Yarn Cache...'
384 | yarn cache clean --force
385 | fi
386 | # ----------------------------------------------------------
387 |
388 | # ----------------------------------------------------------
389 | # ------------------Clear iOS applications------------------
390 | # ----------------------------------------------------------
391 | echo -e '\n--- Clear iOS applications'
392 | rm -rfv ~/Music/iTunes/iTunes\ Media/Mobile\ Applications/* &>/dev/null
393 | # ----------------------------------------------------------
394 |
395 | # ----------------------------------------------------------
396 | # ------------------Clear iOS photo caches------------------
397 | # ----------------------------------------------------------
398 | echo -e '\n--- Clear iOS photo caches'
399 | rm -rf ~/Pictures/iPhoto\ Library/iPod\ Photo\ Cache/*
400 | # ----------------------------------------------------------
401 |
402 | # ----------------------------------------------------------
403 | # ----------------Remove iOS Device Backups-----------------
404 | # ----------------------------------------------------------
405 | echo -e '\n--- Remove iOS Device Backups'
406 | rm -rfv ~/Library/Application\ Support/MobileSync/Backup/* &>/dev/null
407 | # ----------------------------------------------------------
408 |
409 | # ----------------------------------------------------------
410 | # -------------------Clear iOS Simulators-------------------
411 | # ----------------------------------------------------------
412 | echo -e '\n--- Clear iOS Simulators'
413 | if type "xcrun" &>/dev/null; then
414 | osascript -e 'tell application "com.apple.CoreSimulator.CoreSimulatorService" to quit'
415 | osascript -e 'tell application "iOS Simulator" to quit'
416 | osascript -e 'tell application "Simulator" to quit'
417 | xcrun simctl shutdown all
418 | xcrun simctl erase all
419 | fi
420 | # ----------------------------------------------------------
421 |
422 | # ----------------------------------------------------------
423 | # ---------Clear the list of iOS devices connected----------
424 | # ----------------------------------------------------------
425 | echo -e '\n--- Clear the list of iOS devices connected'
426 | sudo defaults delete /Users/$USER/Library/Preferences/com.apple.iPod.plist "conn:128:Last Connect"
427 | sudo defaults delete /Users/$USER/Library/Preferences/com.apple.iPod.plist Devices
428 | sudo defaults delete /Library/Preferences/com.apple.iPod.plist "conn:128:Last Connect"
429 | sudo defaults delete /Library/Preferences/com.apple.iPod.plist Devices
430 | sudo rm -rfv /var/db/lockdown/*
431 | # ----------------------------------------------------------
432 |
433 | # ----------------------------------------------------------
434 | # -----------------Reset camera permissions-----------------
435 | # ----------------------------------------------------------
436 | echo -e '\n--- Reset camera permissions'
437 | tccutil reset Camera
438 | # ----------------------------------------------------------
439 |
440 | # ----------------------------------------------------------
441 | # ---------------Reset microphone permissions---------------
442 | # ----------------------------------------------------------
443 | echo -e '\n--- Reset microphone permissions'
444 | tccutil reset Microphone
445 | # ----------------------------------------------------------
446 |
447 | # ----------------------------------------------------------
448 | # -------------Reset accessibility permissions--------------
449 | # ----------------------------------------------------------
450 | echo -e '\n--- Reset accessibility permissions'
451 | tccutil reset Accessibility
452 | # ----------------------------------------------------------
453 |
454 | # ----------------------------------------------------------
455 | # -------------Reset screen capture permissions-------------
456 | # ----------------------------------------------------------
457 | echo -e '\n--- Reset screen capture permissions'
458 | tccutil reset ScreenCapture
459 | # ----------------------------------------------------------
460 |
461 | # ----------------------------------------------------------
462 | # ---------------Reset reminders permissions----------------
463 | # ----------------------------------------------------------
464 | echo -e '\n--- Reset reminders permissions'
465 | tccutil reset Reminders
466 | # ----------------------------------------------------------
467 |
468 | # ----------------------------------------------------------
469 | # -----------------Reset photos permissions-----------------
470 | # ----------------------------------------------------------
471 | echo -e '\n--- Reset photos permissions'
472 | tccutil reset Photos
473 | # ----------------------------------------------------------
474 |
475 | # ----------------------------------------------------------
476 | # ----------------Reset calendar permissions----------------
477 | # ----------------------------------------------------------
478 | echo -e '\n--- Reset calendar permissions'
479 | tccutil reset Calendar
480 | # ----------------------------------------------------------
481 |
482 | # ----------------------------------------------------------
483 | # ------------Reset full disk access permissions------------
484 | # ----------------------------------------------------------
485 | echo -e '\n--- Reset full disk access permissions'
486 | tccutil reset SystemPolicyAllFiles
487 | # ----------------------------------------------------------
488 |
489 | # ----------------------------------------------------------
490 | # ----------------Reset contacts permissions----------------
491 | # ----------------------------------------------------------
492 | echo -e '\n--- Reset contacts permissions'
493 | tccutil reset SystemPolicyAllFiles
494 | # ----------------------------------------------------------
495 |
496 | # ----------------------------------------------------------
497 | # -------------Reset desktop folder permissions-------------
498 | # ----------------------------------------------------------
499 | echo -e '\n--- Reset desktop folder permissions'
500 | tccutil reset SystemPolicyDesktopFolder
501 | # ----------------------------------------------------------
502 |
503 | # ----------------------------------------------------------
504 | # ------------Reset documents folder permissions------------
505 | # ----------------------------------------------------------
506 | echo -e '\n--- Reset documents folder permissions'
507 | tccutil reset SystemPolicyDocumentsFolder
508 | # ----------------------------------------------------------
509 |
510 | # ----------------------------------------------------------
511 | # ---------------Reset downloads permissions----------------
512 | # ----------------------------------------------------------
513 | echo -e '\n--- Reset downloads permissions'
514 | tccutil reset SystemPolicyDownloadsFolder
515 | # ----------------------------------------------------------
516 |
517 | # ----------------------------------------------------------
518 | # ----------------Reset all app permissions-----------------
519 | # ----------------------------------------------------------
520 | echo -e '\n--- Reset all app permissions'
521 | tccutil reset All
522 | # ----------------------------------------------------------
523 |
524 | # ----------------------------------------------------------
525 | # ---------------Clear CUPS printer job cache---------------
526 | # ----------------------------------------------------------
527 | echo -e '\n--- Clear CUPS printer job cache'
528 | sudo rm -rfv /var/spool/cups/c0*
529 | sudo rm -rfv /var/spool/cups/tmp/*
530 | sudo rm -rfv /var/spool/cups/cache/job.cache*
531 | # ----------------------------------------------------------
532 |
533 | # ----------------------------------------------------------
534 | # ----------------Empty trash on all volumes----------------
535 | # ----------------------------------------------------------
536 | echo -e '\n--- Empty trash on all volumes'
537 | # on all mounted volumes
538 | sudo rm -rfv /Volumes/*/.Trashes/* &>/dev/null
539 | # on main HDD
540 | sudo rm -rfv ~/.Trash/* &>/dev/null
541 | # ----------------------------------------------------------
542 |
543 | # ----------------------------------------------------------
544 | # -----------------Clear system cache files-----------------
545 | # ----------------------------------------------------------
546 | echo -e '\n--- Clear system cache files'
547 | sudo rm -rfv /Library/Caches/* &>/dev/null
548 | sudo rm -rfv /System/Library/Caches/* &>/dev/null
549 | sudo rm -rfv ~/Library/Caches/* &>/dev/null
550 | # ----------------------------------------------------------
551 |
552 | # ----------------------------------------------------------
553 | # ----------Clear XCode Derived Data and Archives-----------
554 | # ----------------------------------------------------------
555 | echo -e '\n--- Clear XCode Derived Data and Archives'
556 | rm -rfv ~/Library/Developer/Xcode/DerivedData/* &>/dev/null
557 | rm -rfv ~/Library/Developer/Xcode/Archives/* &>/dev/null
558 | rm -rfv ~/Library/Developer/Xcode/iOS Device Logs/* &>/dev/null
559 | # ----------------------------------------------------------
560 |
561 | # ----------------------------------------------------------
562 | # ---------------------Clear DNS cache----------------------
563 | # ----------------------------------------------------------
564 | echo -e '\n--- Clear DNS cache'
565 | sudo dscacheutil -flushcache
566 | sudo killall -HUP mDNSResponder
567 | # ----------------------------------------------------------
568 |
569 | # ----------------------------------------------------------
570 | # ------------------Purge inactive memory-------------------
571 | # ----------------------------------------------------------
572 | echo -e '\n--- Purge inactive memory'
573 | sudo purge
574 | # ----------------------------------------------------------
575 | }
576 |
--------------------------------------------------------------------------------
/batch_scripts/nuke_window.bat:
--------------------------------------------------------------------------------
1 | :: ----------------------------------------------------------
2 | :: ----Clear credentials from Windows Credential Manager-----
3 | :: ----------------------------------------------------------
4 | echo --- Clear credentials from Windows Credential Manager
5 | cmdkey.exe /list > "%TEMP%\List.txt"
6 | findstr.exe Target "%TEMP%\List.txt" > "%TEMP%\tokensonly.txt"
7 | FOR /F "tokens=1,2 delims= " %%G IN (%TEMP%\tokensonly.txt) DO cmdkey.exe /delete:%%H
8 | del "%TEMP%\List.txt" /s /f /q
9 | del "%TEMP%\tokensonly.txt" /s /f /q
10 | :: ----------------------------------------------------------
11 |
12 |
13 | :: ----------------------------------------------------------
14 | :: ------------Delete controversial default0 user------------
15 | :: ----------------------------------------------------------
16 | echo --- Delete controversial default0 user
17 | net user defaultuser0 /delete 2>nul
18 | :: ----------------------------------------------------------
19 |
20 |
21 | :: ----------------------------------------------------------
22 | :: ---------------------Empty trash bin----------------------
23 | :: ----------------------------------------------------------
24 | echo --- Empty trash bin
25 | PowerShell -ExecutionPolicy Unrestricted -Command "$bin = (New-Object -ComObject Shell.Application).NameSpace(10); $bin.items() | ForEach {; Write-Host "^""Deleting $($_.Name) from Recycle Bin"^""; Remove-Item $_.Path -Recurse -Force; }"
26 | :: ----------------------------------------------------------
27 |
28 |
29 | :: ----------------------------------------------------------
30 | :: --------Enable Reset Base in Dism Component Store---------
31 | :: ----------------------------------------------------------
32 | echo --- Enable Reset Base in Dism Component Store
33 | reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\SideBySide\Configuration" /v "DisableResetbase" /t "REG_DWORD" /d "0" /f
34 | :: ----------------------------------------------------------
35 |
36 |
37 | :: ----------------------------------------------------------
38 | :: ---------Clear Windows Product Key from Registry----------
39 | :: ----------------------------------------------------------
40 | echo --- Clear Windows Product Key from Registry
41 | cscript.exe //nologo "%SystemRoot%\system32\slmgr.vbs" /cpky
42 | :: ----------------------------------------------------------
43 |
44 |
45 | :: ----------------------------------------------------------
46 | :: -----------Clear volume backups (shadow copies)-----------
47 | :: ----------------------------------------------------------
48 | echo --- Clear volume backups (shadow copies)
49 | vssadmin delete shadows /all /quiet
50 | :: ----------------------------------------------------------
51 |
52 |
53 | :: ----------------------------------------------------------
54 | :: -------------Remove Default Apps Associations-------------
55 | :: ----------------------------------------------------------
56 | echo --- Remove Default Apps Associations
57 | dism /online /Remove-DefaultAppAssociations
58 | :: ----------------------------------------------------------
59 |
60 |
61 | :: ----------------------------------------------------------
62 | :: -------------Clear (Reset) Network Data Usage-------------
63 | :: ----------------------------------------------------------
64 | echo --- Clear (Reset) Network Data Usage
65 | setlocal EnableDelayedExpansion
66 | SET /A dps_service_running=0
67 | SC queryex "DPS"|Find "STATE"|Find /v "RUNNING">Nul||(
68 | SET /A dps_service_running=1
69 | net stop DPS
70 | )
71 | del /F /S /Q /A "%windir%\System32\sru*"
72 | IF !dps_service_running! == 1 (
73 | net start DPS
74 | )
75 | endlocal
76 | :: ----------------------------------------------------------
77 |
78 |
79 | :: ----------------------------------------------------------
80 | :: -----------Clear previous Windows installations-----------
81 | :: ----------------------------------------------------------
82 | echo --- Clear previous Windows installations
83 | if exist "%SystemDrive%\Windows.old" (
84 | takeown /f "%SystemDrive%\Windows.old" /a /r /d y
85 | icacls "%SystemDrive%\Windows.old" /grant administrators:F /t
86 | rd /s /q "%SystemDrive%\Windows.old"
87 | echo Deleted previous installation from "%SystemDrive%\Windows.old\"
88 | ) else (
89 | echo No previous Windows installation has been found
90 | )
91 | :: ----------------------------------------------------------
92 |
93 |
94 | :: ----------------------------------------------------------
95 | :: ------------------Clear Listary indexes-------------------
96 | :: ----------------------------------------------------------
97 | echo --- Clear Listary indexes
98 | del /f /s /q %appdata%\Listary\UserData > nul
99 | :: ----------------------------------------------------------
100 |
101 |
102 | :: ----------------------------------------------------------
103 | :: ---------------------Clear Java cache---------------------
104 | :: ----------------------------------------------------------
105 | echo --- Clear Java cache
106 | rd /s /q "%APPDATA%\Sun\Java\Deployment\cache"
107 | :: ----------------------------------------------------------
108 |
109 |
110 | :: ----------------------------------------------------------
111 | :: --------------------Clear Flash traces--------------------
112 | :: ----------------------------------------------------------
113 | echo --- Clear Flash traces
114 | rd /s /q "%APPDATA%\Macromedia\Flash Player"
115 | :: ----------------------------------------------------------
116 |
117 |
118 | :: ----------------------------------------------------------
119 | :: -----------Clear Steam dumps, logs, and traces------------
120 | :: ----------------------------------------------------------
121 | echo --- Clear Steam dumps, logs, and traces
122 | del /f /q %ProgramFiles(x86)%\Steam\Dumps
123 | del /f /q %ProgramFiles(x86)%\Steam\Traces
124 | del /f /q %ProgramFiles(x86)%\Steam\appcache\*.log
125 | :: ----------------------------------------------------------
126 |
127 |
128 | :: ----------------------------------------------------------
129 | :: -----Clear Visual Studio telemetry and feedback data------
130 | :: ----------------------------------------------------------
131 | echo --- Clear Visual Studio telemetry and feedback data
132 | rmdir /s /q "%AppData%\vstelemetry" 2>nul
133 | rmdir /s /q "%LocalAppData%\Microsoft\VSApplicationInsights" 2>nul
134 | rmdir /s /q "%ProgramData%\Microsoft\VSApplicationInsights" 2>nul
135 | rmdir /s /q "%Temp%\Microsoft\VSApplicationInsights" 2>nul
136 | rmdir /s /q "%Temp%\VSFaultInfo" 2>nul
137 | rmdir /s /q "%Temp%\VSFeedbackPerfWatsonData" 2>nul
138 | rmdir /s /q "%Temp%\VSFeedbackVSRTCLogs" 2>nul
139 | rmdir /s /q "%Temp%\VSRemoteControl" 2>nul
140 | rmdir /s /q "%Temp%\VSTelem" 2>nul
141 | rmdir /s /q "%Temp%\VSTelem.Out" 2>nul
142 | :: ----------------------------------------------------------
143 |
144 |
145 | :: ----------------------------------------------------------
146 | :: ----------------Clear Dotnet CLI telemetry----------------
147 | :: ----------------------------------------------------------
148 | echo --- Clear Dotnet CLI telemetry
149 | rmdir /s /q "%USERPROFILE%\.dotnet\TelemetryStorageService" 2>nul
150 | :: ----------------------------------------------------------
151 |
152 |
153 | :: ----------------------------------------------------------
154 | :: ------------------Clear regedit last key------------------
155 | :: ----------------------------------------------------------
156 | echo --- Clear regedit last key
157 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" /va /f
158 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit" /va /f
159 | :: ----------------------------------------------------------
160 |
161 |
162 | :: ----------------------------------------------------------
163 | :: -----------------Clear regedit favorites------------------
164 | :: ----------------------------------------------------------
165 | echo --- Clear regedit favorites
166 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites" /va /f
167 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites" /va /f
168 | :: ----------------------------------------------------------
169 |
170 |
171 | :: ----------------------------------------------------------
172 | :: -----------Clear list of recent programs opened-----------
173 | :: ----------------------------------------------------------
174 | echo --- Clear list of recent programs opened
175 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedPidlMRU" /va /f
176 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedPidlMRULegacy" /va /f
177 | :: ----------------------------------------------------------
178 |
179 |
180 | :: ----------------------------------------------------------
181 | :: --------------Clear Adobe Media Browser MRU---------------
182 | :: ----------------------------------------------------------
183 | echo --- Clear Adobe Media Browser MRU
184 | reg delete "HKCU\Software\Adobe\MediaBrowser\MRU" /va /f
185 | :: ----------------------------------------------------------
186 |
187 |
188 | :: ----------------------------------------------------------
189 | :: --------------------Clear MSPaint MRU---------------------
190 | :: ----------------------------------------------------------
191 | echo --- Clear MSPaint MRU
192 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List" /va /f
193 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List" /va /f
194 | :: ----------------------------------------------------------
195 |
196 |
197 | :: ----------------------------------------------------------
198 | :: --------------------Clear Wordpad MRU---------------------
199 | :: ----------------------------------------------------------
200 | echo --- Clear Wordpad MRU
201 | reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Wordpad\Recent File List" /va /f
202 | :: ----------------------------------------------------------
203 |
204 |
205 | :: ----------------------------------------------------------
206 | :: -------------Clear Map Network Drive MRU MRU--------------
207 | :: ----------------------------------------------------------
208 | echo --- Clear Map Network Drive MRU MRU
209 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU" /va /f
210 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU" /va /f
211 | :: ----------------------------------------------------------
212 |
213 |
214 | :: ----------------------------------------------------------
215 | :: ----------Clear Windows Search Assistant history----------
216 | :: ----------------------------------------------------------
217 | echo --- Clear Windows Search Assistant history
218 | reg delete "HKCU\Software\Microsoft\Search Assistant\ACMru" /va /f
219 | :: ----------------------------------------------------------
220 |
221 |
222 | :: ----------------------------------------------------------
223 | :: ------Clear list of Recent Files Opened, by Filetype------
224 | :: ----------------------------------------------------------
225 | echo --- Clear list of Recent Files Opened, by Filetype
226 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs" /va /f
227 | reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs" /va /f
228 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU" /va /f
229 | :: ----------------------------------------------------------
230 |
231 |
232 | :: ----------------------------------------------------------
233 | :: -----Clear windows media player recent files and URLs-----
234 | :: ----------------------------------------------------------
235 | echo --- Clear windows media player recent files and URLs
236 | reg delete "HKCU\Software\Microsoft\MediaPlayer\Player\RecentFileList" /va /f
237 | reg delete "HKCU\Software\Microsoft\MediaPlayer\Player\RecentURLList" /va /f
238 | reg delete "HKLM\SOFTWARE\Microsoft\MediaPlayer\Player\RecentFileList" /va /f
239 | reg delete "HKLM\SOFTWARE\Microsoft\MediaPlayer\Player\RecentURLList" /va /f
240 | :: ----------------------------------------------------------
241 |
242 |
243 | :: ----------------------------------------------------------
244 | :: ------Clear Most Recent Application's Use of DirectX------
245 | :: ----------------------------------------------------------
246 | echo --- Clear Most Recent Application's Use of DirectX
247 | reg delete "HKCU\Software\Microsoft\Direct3D\MostRecentApplication" /va /f
248 | reg delete "HKLM\SOFTWARE\Microsoft\Direct3D\MostRecentApplication" /va /f
249 | :: ----------------------------------------------------------
250 |
251 |
252 | :: ----------------------------------------------------------
253 | :: ------------Clear Windows Run MRU & typedpaths------------
254 | :: ----------------------------------------------------------
255 | echo --- Clear Windows Run MRU ^& typedpaths
256 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /va /f
257 | reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\TypedPaths" /va /f
258 | :: ----------------------------------------------------------
259 |
260 |
261 | :: ----------------------------------------------------------
262 | :: --------------Clear recently accessed files---------------
263 | :: ----------------------------------------------------------
264 | echo --- Clear recently accessed files
265 | del /f /q "%APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations\*"
266 | :: ----------------------------------------------------------
267 |
268 |
269 | :: ----------------------------------------------------------
270 | :: ---------------------Clear user pins----------------------
271 | :: ----------------------------------------------------------
272 | echo --- Clear user pins
273 | del /f /q "%APPDATA%\Microsoft\Windows\Recent\CustomDestinations\*"
274 | :: ----------------------------------------------------------
275 |
276 |
277 | :: ----------------------------------------------------------
278 | :: -Clear all Opera data (user profiles, settings, and data)-
279 | :: ----------------------------------------------------------
280 | echo --- Clear all Opera data (user profiles, settings, and data)
281 | :: Windows XP
282 | rd /s /q "%USERPROFILE%\Local Settings\Application Data\Opera\Opera"
283 | :: Windows Vista and later
284 | rd /s /q "%localappdata%\Opera\Opera"
285 | rd /s /q "%APPDATA%\Opera\Opera"
286 | :: ----------------------------------------------------------
287 |
288 |
289 | :: ----------------------------------------------------------
290 | :: --------------Clear Internet Explorer caches--------------
291 | :: ----------------------------------------------------------
292 | echo --- Clear Internet Explorer caches
293 | del /f /q "%localappdata%\Microsoft\Windows\INetCache\IE\*"
294 | rd /s /q "%localappdata%\Microsoft\Windows\WebCache"
295 | :: ----------------------------------------------------------
296 |
297 |
298 | :: ----------------------------------------------------------
299 | :: -----------Clear Internet Explorer recent URLs------------
300 | :: ----------------------------------------------------------
301 | echo --- Clear Internet Explorer recent URLs
302 | reg delete "HKCU\SOFTWARE\Microsoft\Internet Explorer\TypedURLs" /va /f
303 | reg delete "HKCU\SOFTWARE\Microsoft\Internet Explorer\TypedURLsTime" /va /f
304 | :: ----------------------------------------------------------
305 |
306 |
307 | :: ----------------------------------------------------------
308 | :: ------Clear Temporary Internet Files (browser cache)------
309 | :: ----------------------------------------------------------
310 | echo --- Clear Temporary Internet Files (browser cache)
311 | :: Windows XP
312 | rd /s /q %userprofile%\Local Settings\Temporary Internet Files
313 | :: Windows 7
314 | rd /s /q "%localappdata%\Microsoft\Windows\Temporary Internet Files"
315 | takeown /f "%localappdata%\Temporary Internet Files" /r /d y
316 | icacls "%localappdata%\Temporary Internet Files" /grant administrators:F /t
317 | rd /s /q "%localappdata%\Temporary Internet Files"
318 | :: Windows 8 and above
319 | rd /s /q "%localappdata%\Microsoft\Windows\INetCache"
320 | :: ----------------------------------------------------------
321 |
322 |
323 | :: ----------------------------------------------------------
324 | :: -----------Clear Internet Explorer Feeds Cache------------
325 | :: ----------------------------------------------------------
326 | echo --- Clear Internet Explorer Feeds Cache
327 | rd /s /q "%localappdata%\Microsoft\Feeds Cache"
328 | :: ----------------------------------------------------------
329 |
330 |
331 | :: ----------------------------------------------------------
332 | :: -------------Clear Internet Explorer cookies--------------
333 | :: ----------------------------------------------------------
334 | echo --- Clear Internet Explorer cookies
335 | :: Windows 7 browsers
336 | rd /s /q "%APPDATA%\Microsoft\Windows\Cookies"
337 | :: Windows 8 and higher
338 | rd /s /q "%localappdata%\Microsoft\Windows\INetCookies"
339 | :: ----------------------------------------------------------
340 |
341 |
342 | :: ----------------------------------------------------------
343 | :: -------------Clear Internet Explorer DOMStore-------------
344 | :: ----------------------------------------------------------
345 | echo --- Clear Internet Explorer DOMStore
346 | rd /s /q "%localappdata%\Microsoft\InternetExplorer\DOMStore"
347 | :: ----------------------------------------------------------
348 |
349 |
350 | :: ----------------------------------------------------------
351 | :: ----------Clear all Internet Explorer user data-----------
352 | :: ----------------------------------------------------------
353 | echo --- Clear all Internet Explorer user data
354 | rd /s /q "%localappdata%\Microsoft\Internet Explorer"
355 | :: ----------------------------------------------------------
356 |
357 |
358 | :: ----------------------------------------------------------
359 | :: ------------Clear Google Chrome crash reports-------------
360 | :: ----------------------------------------------------------
361 | echo --- Clear Google Chrome crash reports
362 | rd /s /q "%localappdata%\Google\Chrome\User Data\Crashpad\reports\"
363 | rd /s /q "%localappdata%\Google\CrashReports\"
364 | :: ----------------------------------------------------------
365 |
366 |
367 | :: ----------------------------------------------------------
368 | :: ------------Clear Software Reporter Tool logs-------------
369 | :: ----------------------------------------------------------
370 | echo --- Clear Software Reporter Tool logs
371 | del /f /q "%localappdata%\Google\Software Reporter Tool\*.log"
372 | :: ----------------------------------------------------------
373 |
374 |
375 | :: ----------------------------------------------------------
376 | :: ----------------Clear all Chrome user data----------------
377 | :: ----------------------------------------------------------
378 | echo --- Clear all Chrome user data
379 | :: Windows XP
380 | rd /s /q "%USERPROFILE%\Local Settings\Application Data\Google\Chrome\User Data"
381 | :: Windows Vista and later
382 | rd /s /q "%localappdata%\Google\Chrome\User Data"
383 | :: ----------------------------------------------------------
384 |
385 |
386 | :: ----------------------------------------------------------
387 | :: ------------Clear browsing history and caches-------------
388 | :: ----------------------------------------------------------
389 | echo --- Clear browsing history and caches
390 | set ignoreFiles="content-prefs.sqlite" "permissions.sqlite" "favicons.sqlite"
391 | for %%d in ("%APPDATA%\Mozilla\Firefox\Profiles\"
392 | "%USERPROFILE%\Local Settings\Application Data\Mozilla\Firefox\Profiles\"
393 | ) do (
394 | IF EXIST %%d (
395 | FOR /d %%p IN (%%d*) DO (
396 | for /f "delims=" %%f in ('dir /b /s "%%p\*.sqlite" 2^>nul') do (
397 | set "continue="
398 | for %%i in (%ignoreFiles%) do (
399 | if %%i == "%%~nxf" (
400 | set continue=1
401 | )
402 | )
403 | if not defined continue (
404 | del /q /s /f %%f
405 | )
406 | )
407 | )
408 | )
409 | )
410 | :: ----------------------------------------------------------
411 |
412 |
413 | :: ----------------------------------------------------------
414 | :: ---Clear all Firefox user profiles, settings, and data----
415 | :: ----------------------------------------------------------
416 | echo --- Clear all Firefox user profiles, settings, and data
417 | rd /s /q "%localappdata%\Mozilla\Firefox\Profiles"
418 | rd /s /q "%APPDATA%\Mozilla\Firefox\Profiles"
419 | :: ----------------------------------------------------------
420 |
421 |
422 | :: ----------------------------------------------------------
423 | :: -------------------Clear Webpage Icons--------------------
424 | :: ----------------------------------------------------------
425 | echo --- Clear Webpage Icons
426 | :: Windows XP
427 | del /q /s /f "%USERPROFILE%\Local Settings\Application Data\Safari\WebpageIcons.db"
428 | :: Windows Vista and later
429 | del /q /s /f "%localappdata%\Apple Computer\Safari\WebpageIcons.db"
430 | :: ----------------------------------------------------------
431 |
432 |
433 | :: ----------------------------------------------------------
434 | :: --------------------Clear Safari cache--------------------
435 | :: ----------------------------------------------------------
436 | echo --- Clear Safari cache
437 | :: Windows XP
438 | del /q /s /f "%USERPROFILE%\Local Settings\Application Data\Apple Computer\Safari\Cache.db"
439 | :: Windows Vista and later
440 | del /q /s /f "%localappdata%\Apple Computer\Safari\Cache.db"
441 | :: ----------------------------------------------------------
442 |
443 |
444 | :: ----------------------------------------------------------
445 | :: -------------------Clear Safari cookies-------------------
446 | :: ----------------------------------------------------------
447 | echo --- Clear Safari cookies
448 | :: Windows XP
449 | del /q /s /f "%USERPROFILE%\Local Settings\Application Data\Apple Computer\Safari\Cookies.db"
450 | :: Windows Vista and later
451 | del /q /s /f "%localappdata%\Apple Computer\Safari\Cookies.db"
452 | :: ----------------------------------------------------------
453 |
454 |
455 | :: ----------------------------------------------------------
456 | :: Clear all Safari data (user profiles, settings, and data)-
457 | :: ----------------------------------------------------------
458 | echo --- Clear all Safari data (user profiles, settings, and data)
459 | :: Windows XP
460 | rd /s /q "%USERPROFILE%\Local Settings\Application Data\Apple Computer\Safari"
461 | :: Windows Vista and later
462 | rd /s /q "%AppData%\Apple Computer\Safari"
463 | :: ----------------------------------------------------------
464 |
465 |
466 | :: ----------------------------------------------------------
467 | :: ------------------Clear thumbnail cache-------------------
468 | :: ----------------------------------------------------------
469 | echo --- Clear thumbnail cache
470 | del /f /s /q /a %LocalAppData%\Microsoft\Windows\Explorer\*.db
471 | :: ----------------------------------------------------------
472 |
473 |
474 | :: ----------------------------------------------------------
475 | :: -----------------Clear Windows temp files-----------------
476 | :: ----------------------------------------------------------
477 | echo --- Clear Windows temp files
478 | del /f /q %localappdata%\Temp\*
479 | rd /s /q "%WINDIR%\Temp"
480 | rd /s /q "%TEMP%"
481 | :: ----------------------------------------------------------
482 |
483 |
484 | :: ----------------------------------------------------------
485 | :: ----------------Clear main telemetry file-----------------
486 | :: ----------------------------------------------------------
487 | echo --- Clear main telemetry file
488 | if exist "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl" (
489 | takeown /f "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl" /r /d y
490 | icacls "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl" /grant administrators:F /t
491 | echo "" > "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl"
492 | echo Clear successful: "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl"
493 | ) else (
494 | echo "Main telemetry file does not exist. Good!"
495 | )
496 | :: ----------------------------------------------------------
497 |
498 |
499 | :: ----------------------------------------------------------
500 | :: -------------Clear Event Logs in Event Viewer-------------
501 | :: ----------------------------------------------------------
502 | echo --- Clear Event Logs in Event Viewer
503 | REM https://social.technet.microsoft.com/Forums/en-US/f6788f7d-7d04-41f1-a64e-3af9f700e4bd/failed-to-clear-log-microsoftwindowsliveidoperational-access-is-denied?forum=win10itprogeneral
504 | wevtutil sl Microsoft-Windows-LiveId/Operational /ca:O:BAG:SYD:(A;;0x1;;;SY)(A;;0x5;;;BA)(A;;0x1;;;LA)
505 | for /f "tokens=*" %%i in ('wevtutil.exe el') DO (
506 | echo Deleting event log: "%%i"
507 | wevtutil.exe cl %1 "%%i"
508 | )
509 | :: ----------------------------------------------------------
510 |
511 |
512 | :: ----------------------------------------------------------
513 | :: -----------Clean Windows Defender scan history------------
514 | :: ----------------------------------------------------------
515 | echo --- Clean Windows Defender scan history
516 | del "%ProgramData%\Microsoft\Windows Defender\Scans\History\" /s /f /q
517 | :: ----------------------------------------------------------
518 |
519 |
520 | :: ----------------------------------------------------------
521 | :: Clear Optional Component Manager and COM+ components logs-
522 | :: ----------------------------------------------------------
523 | echo --- Clear Optional Component Manager and COM+ components logs
524 | del /f /q %SystemRoot%\comsetup.log
525 | :: ----------------------------------------------------------
526 |
527 |
528 | :: ----------------------------------------------------------
529 | :: ------Clear Distributed Transaction Coordinator logs------
530 | :: ----------------------------------------------------------
531 | echo --- Clear Distributed Transaction Coordinator logs
532 | del /f /q %SystemRoot%\DtcInstall.log
533 | :: ----------------------------------------------------------
534 |
535 |
536 | :: ----------------------------------------------------------
537 | :: --------Clear Pending File Rename Operations logs---------
538 | :: ----------------------------------------------------------
539 | echo --- Clear Pending File Rename Operations logs
540 | del /f /q %SystemRoot%\PFRO.log
541 | :: ----------------------------------------------------------
542 |
543 |
544 | :: ----------------------------------------------------------
545 | :: ------Clear Windows Deployment Upgrade Process Logs-------
546 | :: ----------------------------------------------------------
547 | echo --- Clear Windows Deployment Upgrade Process Logs
548 | del /f /q %SystemRoot%\setupact.log
549 | del /f /q %SystemRoot%\setuperr.log
550 | :: ----------------------------------------------------------
551 |
552 |
553 | :: ----------------------------------------------------------
554 | :: -----------------Clear Windows Setup Logs-----------------
555 | :: ----------------------------------------------------------
556 | echo --- Clear Windows Setup Logs
557 | del /f /q %SystemRoot%\setupapi.log
558 | del /f /q %SystemRoot%\Panther\*
559 | del /f /q %SystemRoot%\inf\setupapi.app.log
560 | del /f /q %SystemRoot%\inf\setupapi.dev.log
561 | del /f /q %SystemRoot%\inf\setupapi.offline.log
562 | :: ----------------------------------------------------------
563 |
564 |
565 | :: ----------------------------------------------------------
566 | :: --------Clear Windows System Assessment Tool logs---------
567 | :: ----------------------------------------------------------
568 | echo --- Clear Windows System Assessment Tool logs
569 | del /f /q %SystemRoot%\Performance\WinSAT\winsat.log
570 | :: ----------------------------------------------------------
571 |
572 |
573 | :: ----------------------------------------------------------
574 | :: ---------------Clear Password change events---------------
575 | :: ----------------------------------------------------------
576 | echo --- Clear Password change events
577 | del /f /q %SystemRoot%\debug\PASSWD.LOG
578 | :: ----------------------------------------------------------
579 |
580 |
581 | :: ----------------------------------------------------------
582 | :: --------------Clear user web cache database---------------
583 | :: ----------------------------------------------------------
584 | echo --- Clear user web cache database
585 | del /f /q %localappdata%\Microsoft\Windows\WebCache\*.*
586 | :: ----------------------------------------------------------
587 |
588 |
589 | :: ----------------------------------------------------------
590 | :: ----Clear system temp folder when no one is logged in-----
591 | :: ----------------------------------------------------------
592 | echo --- Clear system temp folder when no one is logged in
593 | del /f /q %SystemRoot%\ServiceProfiles\LocalService\AppData\Local\Temp\*.*
594 | :: ----------------------------------------------------------
595 |
596 |
597 | :: Clear DISM (Deployment Image Servicing and Management) Logs
598 | echo --- Clear DISM (Deployment Image Servicing and Management) Logs
599 | del /f /q %SystemRoot%\Logs\CBS\CBS.log
600 | del /f /q %SystemRoot%\Logs\DISM\DISM.log
601 | :: ----------------------------------------------------------
602 |
603 |
604 | :: ----------------------------------------------------------
605 | :: -------Clear WUAgent (Windows Update History) logs--------
606 | :: ----------------------------------------------------------
607 | echo --- Clear WUAgent (Windows Update History) logs
608 | setlocal EnableDelayedExpansion
609 | SET /A wuau_service_running=0
610 | SC queryex "wuauserv"|Find "STATE"|Find /v "RUNNING">Nul||(
611 | SET /A wuau_service_running=1
612 | net stop wuauserv
613 | )
614 | del /q /s /f "%SystemRoot%\SoftwareDistribution"
615 | IF !wuau_service_running! == 1 (
616 | net start wuauserv
617 | )
618 | endlocal
619 | :: ----------------------------------------------------------
620 |
621 |
622 | :: ----------------------------------------------------------
623 | :: --------Clear Server-initiated Healing Events Logs--------
624 | :: ----------------------------------------------------------
625 | echo --- Clear Server-initiated Healing Events Logs
626 | del /f /q "%SystemRoot%\Logs\SIH\*"
627 | :: ----------------------------------------------------------
628 |
629 |
630 | :: ----------------------------------------------------------
631 | :: ---------------Common Language Runtime Logs---------------
632 | :: ----------------------------------------------------------
633 | echo --- Common Language Runtime Logs
634 | del /f /q "%LocalAppData%\Microsoft\CLR_v4.0\UsageTraces\*"
635 | del /f /q "%LocalAppData%\Microsoft\CLR_v4.0_32\UsageTraces\*"
636 | :: ----------------------------------------------------------
637 |
638 |
639 | :: ----------------------------------------------------------
640 | :: ------------Network Setup Service Events Logs-------------
641 | :: ----------------------------------------------------------
642 | echo --- Network Setup Service Events Logs
643 | del /f /q "%SystemRoot%\Logs\NetSetup\*"
644 | :: ----------------------------------------------------------
645 |
646 |
647 | :: ----------------------------------------------------------
648 | :: ----------Disk Cleanup tool (Cleanmgr.exe) Logs-----------
649 | :: ----------------------------------------------------------
650 | echo --- Disk Cleanup tool (Cleanmgr.exe) Logs
651 | del /f /q "%SystemRoot%\System32\LogFiles\setupcln\*"
652 | :: ----------------------------------------------------------
653 |
654 |
655 | :: ----------------------------------------------------------
656 | :: ----------Clear Windows update and SFC scan logs----------
657 | :: ----------------------------------------------------------
658 | echo --- Clear Windows update and SFC scan logs
659 | del /f /q %SystemRoot%\Temp\CBS\*
660 | :: ----------------------------------------------------------
661 |
662 |
663 | :: ----------------------------------------------------------
664 | :: ---------Clear Windows Update Medic Service logs----------
665 | :: ----------------------------------------------------------
666 | echo --- Clear Windows Update Medic Service logs
667 | takeown /f %SystemRoot%\Logs\waasmedic /r /d y
668 | icacls %SystemRoot%\Logs\waasmedic /grant administrators:F /t
669 | rd /s /q %SystemRoot%\Logs\waasmedic
670 | :: ----------------------------------------------------------
671 |
672 |
673 | :: ----------------------------------------------------------
674 | :: -----------Clear Cryptographic Services Traces------------
675 | :: ----------------------------------------------------------
676 | echo --- Clear Cryptographic Services Traces
677 | del /f /q %SystemRoot%\System32\catroot2\dberr.txt
678 | del /f /q %SystemRoot%\System32\catroot2.log
679 | del /f /q %SystemRoot%\System32\catroot2.jrs
680 | del /f /q %SystemRoot%\System32\catroot2.edb
681 | del /f /q %SystemRoot%\System32\catroot2.chk
682 | :: ----------------------------------------------------------
683 |
684 |
685 | :: ----------------------------------------------------------
686 | :: ----------------Windows Update Events Logs----------------
687 | :: ----------------------------------------------------------
688 | echo --- Windows Update Events Logs
689 | del /f /q "%SystemRoot%\Logs\SIH\*"
690 | :: ----------------------------------------------------------
691 |
692 |
693 | :: ----------------------------------------------------------
694 | :: -------------------Windows Update Logs--------------------
695 | :: ----------------------------------------------------------
696 | echo --- Windows Update Logs
697 | del /f /q "%SystemRoot%\Traces\WindowsUpdate\*"
698 | :: ----------------------------------------------------------
--------------------------------------------------------------------------------
/batch_scripts/remove_bloatware.bat:
--------------------------------------------------------------------------------
1 | :: ----------------------------------------------------------
2 | :: ------------Delete controversial default0 user------------
3 | :: ----------------------------------------------------------
4 | echo --- Delete controversial default0 user
5 | net user defaultuser0 /delete 2>nul
6 | :: ----------------------------------------------------------
7 |
8 |
9 | :: ----------------------------------------------------------
10 | :: --------Enable Reset Base in Dism Component Store---------
11 | :: ----------------------------------------------------------
12 | echo --- Enable Reset Base in Dism Component Store
13 | reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\SideBySide\Configuration" /v "DisableResetbase" /t "REG_DWORD" /d "0" /f
14 | :: ----------------------------------------------------------
15 |
16 |
17 | :: ----------------------------------------------------------
18 | :: -------------Remove Default Apps Associations-------------
19 | :: ----------------------------------------------------------
20 | echo --- Remove Default Apps Associations
21 | dism /online /Remove-DefaultAppAssociations
22 | :: ----------------------------------------------------------
23 |
24 |
25 | :: ----------------------------------------------------------
26 | :: -------------Clear (Reset) Network Data Usage-------------
27 | :: ----------------------------------------------------------
28 | echo --- Clear (Reset) Network Data Usage
29 | setlocal EnableDelayedExpansion
30 | SET /A dps_service_running=0
31 | SC queryex "DPS"|Find "STATE"|Find /v "RUNNING">Nul||(
32 | SET /A dps_service_running=1
33 | net stop DPS
34 | )
35 | del /F /S /Q /A "%windir%\System32\sru*"
36 | IF !dps_service_running! == 1 (
37 | net start DPS
38 | )
39 | endlocal
40 | :: ----------------------------------------------------------
41 |
42 |
43 | :: ----------------------------------------------------------
44 | :: --------------------Clear Flash traces--------------------
45 | :: ----------------------------------------------------------
46 | echo --- Clear Flash traces
47 | rd /s /q "%APPDATA%\Macromedia\Flash Player"
48 | :: ----------------------------------------------------------
49 |
50 |
51 | :: ----------------------------------------------------------
52 | :: -----------Clear Steam dumps, logs, and traces------------
53 | :: ----------------------------------------------------------
54 | echo --- Clear Steam dumps, logs, and traces
55 | del /f /q %ProgramFiles(x86)%\Steam\Dumps
56 | del /f /q %ProgramFiles(x86)%\Steam\Traces
57 | del /f /q %ProgramFiles(x86)%\Steam\appcache\*.log
58 | :: ----------------------------------------------------------
59 |
60 |
61 | :: ----------------------------------------------------------
62 | :: -----Clear Visual Studio telemetry and feedback data------
63 | :: ----------------------------------------------------------
64 | echo --- Clear Visual Studio telemetry and feedback data
65 | rmdir /s /q "%AppData%\vstelemetry" 2>nul
66 | rmdir /s /q "%LocalAppData%\Microsoft\VSApplicationInsights" 2>nul
67 | rmdir /s /q "%ProgramData%\Microsoft\VSApplicationInsights" 2>nul
68 | rmdir /s /q "%Temp%\Microsoft\VSApplicationInsights" 2>nul
69 | rmdir /s /q "%Temp%\VSFaultInfo" 2>nul
70 | rmdir /s /q "%Temp%\VSFeedbackPerfWatsonData" 2>nul
71 | rmdir /s /q "%Temp%\VSFeedbackVSRTCLogs" 2>nul
72 | rmdir /s /q "%Temp%\VSRemoteControl" 2>nul
73 | rmdir /s /q "%Temp%\VSTelem" 2>nul
74 | rmdir /s /q "%Temp%\VSTelem.Out" 2>nul
75 | :: ----------------------------------------------------------
76 |
77 |
78 | :: ----------------------------------------------------------
79 | :: ----------------Clear Dotnet CLI telemetry----------------
80 | :: ----------------------------------------------------------
81 | echo --- Clear Dotnet CLI telemetry
82 | rmdir /s /q "%USERPROFILE%\.dotnet\TelemetryStorageService" 2>nul
83 | :: ----------------------------------------------------------
84 |
85 |
86 | :: ----------------------------------------------------------
87 | :: -----------------Clear Windows temp files-----------------
88 | :: ----------------------------------------------------------
89 | echo --- Clear Windows temp files
90 | del /f /q %localappdata%\Temp\*
91 | rd /s /q "%WINDIR%\Temp"
92 | rd /s /q "%TEMP%"
93 | :: ----------------------------------------------------------
94 |
95 |
96 | :: ----------------------------------------------------------
97 | :: ----------------Clear main telemetry file-----------------
98 | :: ----------------------------------------------------------
99 | echo --- Clear main telemetry file
100 | if exist "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl" (
101 | takeown /f "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl" /r /d y
102 | icacls "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl" /grant administrators:F /t
103 | echo "" > "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl"
104 | echo Clear successful: "%ProgramData%\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl"
105 | ) else (
106 | echo "Main telemetry file does not exist. Good!"
107 | )
108 | :: ----------------------------------------------------------
109 |
110 |
111 | :: ----------------------------------------------------------
112 | :: ------------------Clear regedit last key------------------
113 | :: ----------------------------------------------------------
114 | echo --- Clear regedit last key
115 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" /va /f
116 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit" /va /f
117 | :: ----------------------------------------------------------
118 |
119 |
120 | :: ----------------------------------------------------------
121 | :: -----------------Clear regedit favorites------------------
122 | :: ----------------------------------------------------------
123 | echo --- Clear regedit favorites
124 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites" /va /f
125 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites" /va /f
126 | :: ----------------------------------------------------------
127 |
128 |
129 | :: ----------------------------------------------------------
130 | :: -----------Clear list of recent programs opened-----------
131 | :: ----------------------------------------------------------
132 | echo --- Clear list of recent programs opened
133 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedPidlMRU" /va /f
134 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedPidlMRULegacy" /va /f
135 | :: ----------------------------------------------------------
136 |
137 |
138 | :: ----------------------------------------------------------
139 | :: --------------Clear Adobe Media Browser MRU---------------
140 | :: ----------------------------------------------------------
141 | echo --- Clear Adobe Media Browser MRU
142 | reg delete "HKCU\Software\Adobe\MediaBrowser\MRU" /va /f
143 | :: ----------------------------------------------------------
144 |
145 |
146 | :: ----------------------------------------------------------
147 | :: --------------------Clear MSPaint MRU---------------------
148 | :: ----------------------------------------------------------
149 | echo --- Clear MSPaint MRU
150 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List" /va /f
151 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List" /va /f
152 | :: ----------------------------------------------------------
153 |
154 |
155 | :: ----------------------------------------------------------
156 | :: --------------------Clear Wordpad MRU---------------------
157 | :: ----------------------------------------------------------
158 | echo --- Clear Wordpad MRU
159 | reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Wordpad\Recent File List" /va /f
160 | :: ----------------------------------------------------------
161 |
162 |
163 | :: ----------------------------------------------------------
164 | :: -------------Clear Map Network Drive MRU MRU--------------
165 | :: ----------------------------------------------------------
166 | echo --- Clear Map Network Drive MRU MRU
167 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU" /va /f
168 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU" /va /f
169 | :: ----------------------------------------------------------
170 |
171 |
172 | :: ----------------------------------------------------------
173 | :: ----------Clear Windows Search Assistant history----------
174 | :: ----------------------------------------------------------
175 | echo --- Clear Windows Search Assistant history
176 | reg delete "HKCU\Software\Microsoft\Search Assistant\ACMru" /va /f
177 | :: ----------------------------------------------------------
178 |
179 |
180 | :: ----------------------------------------------------------
181 | :: ------Clear list of Recent Files Opened, by Filetype------
182 | :: ----------------------------------------------------------
183 | echo --- Clear list of Recent Files Opened, by Filetype
184 | reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs" /va /f
185 | reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs" /va /f
186 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU" /va /f
187 | :: ----------------------------------------------------------
188 |
189 |
190 | :: ----------------------------------------------------------
191 | :: -----Clear windows media player recent files and URLs-----
192 | :: ----------------------------------------------------------
193 | echo --- Clear windows media player recent files and URLs
194 | reg delete "HKCU\Software\Microsoft\MediaPlayer\Player\RecentFileList" /va /f
195 | reg delete "HKCU\Software\Microsoft\MediaPlayer\Player\RecentURLList" /va /f
196 | reg delete "HKLM\SOFTWARE\Microsoft\MediaPlayer\Player\RecentFileList" /va /f
197 | reg delete "HKLM\SOFTWARE\Microsoft\MediaPlayer\Player\RecentURLList" /va /f
198 | :: ----------------------------------------------------------
199 |
200 |
201 | :: ----------------------------------------------------------
202 | :: ------Clear Most Recent Application's Use of DirectX------
203 | :: ----------------------------------------------------------
204 | echo --- Clear Most Recent Application's Use of DirectX
205 | reg delete "HKCU\Software\Microsoft\Direct3D\MostRecentApplication" /va /f
206 | reg delete "HKLM\SOFTWARE\Microsoft\Direct3D\MostRecentApplication" /va /f
207 | :: ----------------------------------------------------------
208 |
209 |
210 | :: ----------------------------------------------------------
211 | :: ------------Clear Windows Run MRU & typedpaths------------
212 | :: ----------------------------------------------------------
213 | echo --- Clear Windows Run MRU ^& typedpaths
214 | reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /va /f
215 | reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\TypedPaths" /va /f
216 | :: ----------------------------------------------------------
217 |
218 |
219 | :: ----------------------------------------------------------
220 | :: --------------Clear recently accessed files---------------
221 | :: ----------------------------------------------------------
222 | echo --- Clear recently accessed files
223 | del /f /q "%APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations\*"
224 | :: ----------------------------------------------------------
225 |
226 |
227 | :: ----------------------------------------------------------
228 | :: --------------Clear Internet Explorer caches--------------
229 | :: ----------------------------------------------------------
230 | echo --- Clear Internet Explorer caches
231 | del /f /q "%localappdata%\Microsoft\Windows\INetCache\IE\*"
232 | rd /s /q "%localappdata%\Microsoft\Windows\WebCache"
233 | :: ----------------------------------------------------------
234 |
235 |
236 | :: ----------------------------------------------------------
237 | :: ------Clear Temporary Internet Files (browser cache)------
238 | :: ----------------------------------------------------------
239 | echo --- Clear Temporary Internet Files (browser cache)
240 | :: Windows XP
241 | rd /s /q %userprofile%\Local Settings\Temporary Internet Files
242 | :: Windows 7
243 | rd /s /q "%localappdata%\Microsoft\Windows\Temporary Internet Files"
244 | takeown /f "%localappdata%\Temporary Internet Files" /r /d y
245 | icacls "%localappdata%\Temporary Internet Files" /grant administrators:F /t
246 | rd /s /q "%localappdata%\Temporary Internet Files"
247 | :: Windows 8 and above
248 | rd /s /q "%localappdata%\Microsoft\Windows\INetCache"
249 | :: ----------------------------------------------------------
250 |
251 |
252 | :: ----------------------------------------------------------
253 | :: -----------Clear Internet Explorer Feeds Cache------------
254 | :: ----------------------------------------------------------
255 | echo --- Clear Internet Explorer Feeds Cache
256 | rd /s /q "%localappdata%\Microsoft\Feeds Cache"
257 | :: ----------------------------------------------------------
258 |
259 |
260 | :: ----------------------------------------------------------
261 | :: -------------Clear Internet Explorer DOMStore-------------
262 | :: ----------------------------------------------------------
263 | echo --- Clear Internet Explorer DOMStore
264 | rd /s /q "%localappdata%\Microsoft\InternetExplorer\DOMStore"
265 | :: ----------------------------------------------------------
266 |
267 |
268 | :: ----------------------------------------------------------
269 | :: ------------Clear Google Chrome crash reports-------------
270 | :: ----------------------------------------------------------
271 | echo --- Clear Google Chrome crash reports
272 | rd /s /q "%localappdata%\Google\Chrome\User Data\Crashpad\reports\"
273 | rd /s /q "%localappdata%\Google\CrashReports\"
274 | :: ----------------------------------------------------------
275 |
276 |
277 | :: ----------------------------------------------------------
278 | :: ------------Clear Software Reporter Tool logs-------------
279 | :: ----------------------------------------------------------
280 | echo --- Clear Software Reporter Tool logs
281 | del /f /q "%localappdata%\Google\Software Reporter Tool\*.log"
282 | :: ----------------------------------------------------------
283 |
284 |
285 | :: ----------------------------------------------------------
286 | :: ------------Clear browsing history and caches-------------
287 | :: ----------------------------------------------------------
288 | echo --- Clear browsing history and caches
289 | set ignoreFiles="content-prefs.sqlite" "permissions.sqlite" "favicons.sqlite"
290 | for %%d in ("%APPDATA%\Mozilla\Firefox\Profiles\"
291 | "%USERPROFILE%\Local Settings\Application Data\Mozilla\Firefox\Profiles\"
292 | ) do (
293 | IF EXIST %%d (
294 | FOR /d %%p IN (%%d*) DO (
295 | for /f "delims=" %%f in ('dir /b /s "%%p\*.sqlite" 2^>nul') do (
296 | set "continue="
297 | for %%i in (%ignoreFiles%) do (
298 | if %%i == "%%~nxf" (
299 | set continue=1
300 | )
301 | )
302 | if not defined continue (
303 | del /q /s /f %%f
304 | )
305 | )
306 | )
307 | )
308 | )
309 | :: ----------------------------------------------------------
310 |
311 |
312 | :: ----------------------------------------------------------
313 | :: -------------------Clear Webpage Icons--------------------
314 | :: ----------------------------------------------------------
315 | echo --- Clear Webpage Icons
316 | :: Windows XP
317 | del /q /s /f "%USERPROFILE%\Local Settings\Application Data\Safari\WebpageIcons.db"
318 | :: Windows Vista and later
319 | del /q /s /f "%localappdata%\Apple Computer\Safari\WebpageIcons.db"
320 | :: ----------------------------------------------------------
321 |
322 |
323 | :: ----------------------------------------------------------
324 | :: --------------------Clear Safari cache--------------------
325 | :: ----------------------------------------------------------
326 | echo --- Clear Safari cache
327 | :: Windows XP
328 | del /q /s /f "%USERPROFILE%\Local Settings\Application Data\Apple Computer\Safari\Cache.db"
329 | :: Windows Vista and later
330 | del /q /s /f "%localappdata%\Apple Computer\Safari\Cache.db"
331 | :: ----------------------------------------------------------
332 |
333 |
334 | :: ----------------------------------------------------------
335 | :: Clear Optional Component Manager and COM+ components logs-
336 | :: ----------------------------------------------------------
337 | echo --- Clear Optional Component Manager and COM+ components logs
338 | del /f /q %SystemRoot%\comsetup.log
339 | :: ----------------------------------------------------------
340 |
341 |
342 | :: ----------------------------------------------------------
343 | :: ------Clear Distributed Transaction Coordinator logs------
344 | :: ----------------------------------------------------------
345 | echo --- Clear Distributed Transaction Coordinator logs
346 | del /f /q %SystemRoot%\DtcInstall.log
347 | :: ----------------------------------------------------------
348 |
349 |
350 | :: ----------------------------------------------------------
351 | :: ------Clear Windows Deployment Upgrade Process Logs-------
352 | :: ----------------------------------------------------------
353 | echo --- Clear Windows Deployment Upgrade Process Logs
354 | del /f /q %SystemRoot%\setupact.log
355 | del /f /q %SystemRoot%\setuperr.log
356 | :: ----------------------------------------------------------
357 |
358 |
359 | :: ----------------------------------------------------------
360 | :: -----------------Clear Windows Setup Logs-----------------
361 | :: ----------------------------------------------------------
362 | echo --- Clear Windows Setup Logs
363 | del /f /q %SystemRoot%\setupapi.log
364 | del /f /q %SystemRoot%\Panther\*
365 | del /f /q %SystemRoot%\inf\setupapi.app.log
366 | del /f /q %SystemRoot%\inf\setupapi.dev.log
367 | del /f /q %SystemRoot%\inf\setupapi.offline.log
368 | :: ----------------------------------------------------------
369 |
370 |
371 | :: ----------------------------------------------------------
372 | :: --------Clear Windows System Assessment Tool logs---------
373 | :: ----------------------------------------------------------
374 | echo --- Clear Windows System Assessment Tool logs
375 | del /f /q %SystemRoot%\Performance\WinSAT\winsat.log
376 | :: ----------------------------------------------------------
377 |
378 |
379 | :: ----------------------------------------------------------
380 | :: ---------------Clear Password change events---------------
381 | :: ----------------------------------------------------------
382 | echo --- Clear Password change events
383 | del /f /q %SystemRoot%\debug\PASSWD.LOG
384 | :: ----------------------------------------------------------
385 |
386 |
387 | :: ----------------------------------------------------------
388 | :: --------------Clear user web cache database---------------
389 | :: ----------------------------------------------------------
390 | echo --- Clear user web cache database
391 | del /f /q %localappdata%\Microsoft\Windows\WebCache\*.*
392 | :: ----------------------------------------------------------
393 |
394 |
395 | :: ----------------------------------------------------------
396 | :: ----Clear system temp folder when no one is logged in-----
397 | :: ----------------------------------------------------------
398 | echo --- Clear system temp folder when no one is logged in
399 | del /f /q %SystemRoot%\ServiceProfiles\LocalService\AppData\Local\Temp\*.*
400 | :: ----------------------------------------------------------
401 |
402 |
403 | :: Clear DISM (Deployment Image Servicing and Management) Logs
404 | echo --- Clear DISM (Deployment Image Servicing and Management) Logs
405 | del /f /q %SystemRoot%\Logs\CBS\CBS.log
406 | del /f /q %SystemRoot%\Logs\DISM\DISM.log
407 | :: ----------------------------------------------------------
408 |
409 |
410 | :: ----------------------------------------------------------
411 | :: ---------------Common Language Runtime Logs---------------
412 | :: ----------------------------------------------------------
413 | echo --- Common Language Runtime Logs
414 | del /f /q "%LocalAppData%\Microsoft\CLR_v4.0\UsageTraces\*"
415 | del /f /q "%LocalAppData%\Microsoft\CLR_v4.0_32\UsageTraces\*"
416 | :: ----------------------------------------------------------
417 |
418 |
419 | :: ----------------------------------------------------------
420 | :: ------------Network Setup Service Events Logs-------------
421 | :: ----------------------------------------------------------
422 | echo --- Network Setup Service Events Logs
423 | del /f /q "%SystemRoot%\Logs\NetSetup\*"
424 | :: ----------------------------------------------------------
425 |
426 |
427 | :: ----------------------------------------------------------
428 | :: ----------Clear Windows update and SFC scan logs----------
429 | :: ----------------------------------------------------------
430 | echo --- Clear Windows update and SFC scan logs
431 | del /f /q %SystemRoot%\Temp\CBS\*
432 | :: ----------------------------------------------------------
433 |
434 |
435 | :: ----------------------------------------------------------
436 | :: ---------Clear Windows Update Medic Service logs----------
437 | :: ----------------------------------------------------------
438 | echo --- Clear Windows Update Medic Service logs
439 | takeown /f %SystemRoot%\Logs\waasmedic /r /d y
440 | icacls %SystemRoot%\Logs\waasmedic /grant administrators:F /t
441 | rd /s /q %SystemRoot%\Logs\waasmedic
442 | :: ----------------------------------------------------------
443 |
444 |
445 | :: ----------------------------------------------------------
446 | :: -----------Clear Cryptographic Services Traces------------
447 | :: ----------------------------------------------------------
448 | echo --- Clear Cryptographic Services Traces
449 | del /f /q %SystemRoot%\System32\catroot2\dberr.txt
450 | del /f /q %SystemRoot%\System32\catroot2.log
451 | del /f /q %SystemRoot%\System32\catroot2.jrs
452 | del /f /q %SystemRoot%\System32\catroot2.edb
453 | del /f /q %SystemRoot%\System32\catroot2.chk
454 | :: ----------------------------------------------------------
455 |
456 |
457 | :: ----------------------------------------------------------
458 | :: ------------------Uninstall Cortana app-------------------
459 | :: ----------------------------------------------------------
460 | echo --- Uninstall Cortana app
461 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.549981C3F5F10' | Remove-AppxPackage"
462 | :: ----------------------------------------------------------
463 |
464 |
465 | :: ----------------------------------------------------------
466 | :: ---------------------Feedback Hub app---------------------
467 | :: ----------------------------------------------------------
468 | echo --- Feedback Hub app
469 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.WindowsFeedbackHub' | Remove-AppxPackage"
470 | :: ----------------------------------------------------------
471 |
472 |
473 | :: ----------------------------------------------------------
474 | :: ---------------------Windows Maps app---------------------
475 | :: ----------------------------------------------------------
476 | echo --- Windows Maps app
477 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.WindowsMaps' | Remove-AppxPackage"
478 | :: ----------------------------------------------------------
479 |
480 |
481 | :: ----------------------------------------------------------
482 | :: ----------------Microsoft Advertising app-----------------
483 | :: ----------------------------------------------------------
484 | echo --- Microsoft Advertising app
485 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.Advertising.Xaml' | Remove-AppxPackage"
486 | :: ----------------------------------------------------------
487 |
488 |
489 | :: ----------------------------------------------------------
490 | :: ------------------Network Speed Test app------------------
491 | :: ----------------------------------------------------------
492 | echo --- Network Speed Test app
493 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.NetworkSpeedTest' | Remove-AppxPackage"
494 | :: ----------------------------------------------------------
495 |
496 |
497 | :: ----------------------------------------------------------
498 | :: ---------------------MSN Weather app----------------------
499 | :: ----------------------------------------------------------
500 | echo --- MSN Weather app
501 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.BingWeather' | Remove-AppxPackage"
502 | :: ----------------------------------------------------------
503 |
504 |
505 | :: ----------------------------------------------------------
506 | :: ----------------------MSN Sports app----------------------
507 | :: ----------------------------------------------------------
508 | echo --- MSN Sports app
509 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.BingSports' | Remove-AppxPackage"
510 | :: ----------------------------------------------------------
511 |
512 |
513 | :: ----------------------------------------------------------
514 | :: -----------------------MSN News app-----------------------
515 | :: ----------------------------------------------------------
516 | echo --- MSN News app
517 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.BingNews' | Remove-AppxPackage"
518 | :: ----------------------------------------------------------
519 |
520 |
521 | :: ----------------------------------------------------------
522 | :: ----------------------MSN Money app-----------------------
523 | :: ----------------------------------------------------------
524 | echo --- MSN Money app
525 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.BingFinance' | Remove-AppxPackage"
526 | :: ----------------------------------------------------------
527 |
528 |
529 | :: ----------------------------------------------------------
530 | :: ----------------------My Office app-----------------------
531 | :: ----------------------------------------------------------
532 | echo --- My Office app
533 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.MicrosoftOfficeHub' | Remove-AppxPackage"
534 | :: ----------------------------------------------------------
535 |
536 |
537 | :: ----------------------------------------------------------
538 | :: ----------------Xbox Console Companion app----------------
539 | :: ----------------------------------------------------------
540 | echo --- Xbox Console Companion app
541 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.XboxApp' | Remove-AppxPackage"
542 | :: ----------------------------------------------------------
543 |
544 |
545 | :: ----------------------------------------------------------
546 | :: -------------Xbox Live in-game experience app-------------
547 | :: ----------------------------------------------------------
548 | echo --- Xbox Live in-game experience app
549 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.Xbox.TCUI' | Remove-AppxPackage"
550 | :: ----------------------------------------------------------
551 |
552 |
553 | :: ----------------------------------------------------------
554 | :: --------------------Xbox Game Bar app---------------------
555 | :: ----------------------------------------------------------
556 | echo --- Xbox Game Bar app
557 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.XboxGamingOverlay' | Remove-AppxPackage"
558 | :: ----------------------------------------------------------
559 |
560 |
561 | :: ----------------------------------------------------------
562 | :: --------------Xbox Game Bar Plugin appcache---------------
563 | :: ----------------------------------------------------------
564 | echo --- Xbox Game Bar Plugin appcache
565 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.XboxGameOverlay' | Remove-AppxPackage"
566 | :: ----------------------------------------------------------
567 |
568 |
569 | :: ----------------------------------------------------------
570 | :: ----------------Xbox Identity Provider app----------------
571 | :: ----------------------------------------------------------
572 | echo --- Xbox Identity Provider app
573 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.XboxIdentityProvider' | Remove-AppxPackage"
574 | :: ----------------------------------------------------------
575 |
576 |
577 | :: ----------------------------------------------------------
578 | :: -------------Xbox Speech To Text Overlay app--------------
579 | :: ----------------------------------------------------------
580 | echo --- Xbox Speech To Text Overlay app
581 | PowerShell -ExecutionPolicy Unrestricted -Command "Get-AppxPackage 'Microsoft.XboxSpeechToTextOverlay' | Remove-AppxPackage"
582 | :: ----------------------------------------------------------
583 |
584 |
585 | :: ----------------------------------------------------------
586 | :: ----------------Holographic First Run app-----------------
587 | :: ----------------------------------------------------------
588 | echo --- Holographic First Run app
589 | PowerShell -ExecutionPolicy Unrestricted -Command "$package = Get-AppxPackage -AllUsers 'Microsoft.Windows.Holographic.FirstRun'; if (!$package) {; Write-Host 'Not installed'; exit 0; }; $directories = @($package.InstallLocation, "^""$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)"^""); foreach($dir in $directories) {; if ( !$dir -Or !(Test-Path "^""$dir"^"") ) { continue }; cmd /c ('takeown /f "^""' + $dir + '"^"" /r /d y 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership' }; cmd /c ('icacls "^""' + $dir + '"^"" /grant administrators:F /t 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership' }; $files = Get-ChildItem -File -Path $dir -Recurse -Force; foreach($file in $files) {; if($file.Name.EndsWith('.OLD')) { continue }; $newName = $file.FullName + '.OLD'; Write-Host "^""Rename '$($file.FullName)' to '$newName'"^""; Move-Item -LiteralPath "^""$($file.FullName)"^"" -Destination "^""$newName"^"" -Force; }; }"
590 | :: ----------------------------------------------------------
591 |
592 |
593 | :: ----------------------------------------------------------
594 | :: -----Windows 10 Family Safety / Parental Controls app-----
595 | :: ----------------------------------------------------------
596 | echo --- Windows 10 Family Safety / Parental Controls app
597 | PowerShell -ExecutionPolicy Unrestricted -Command "$package = Get-AppxPackage -AllUsers 'Microsoft.Windows.ParentalControls'; if (!$package) {; Write-Host 'Not installed'; exit 0; }; $directories = @($package.InstallLocation, "^""$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)"^""); foreach($dir in $directories) {; if ( !$dir -Or !(Test-Path "^""$dir"^"") ) { continue }; cmd /c ('takeown /f "^""' + $dir + '"^"" /r /d y 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership' }; cmd /c ('icacls "^""' + $dir + '"^"" /grant administrators:F /t 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership' }; $files = Get-ChildItem -File -Path $dir -Recurse -Force; foreach($file in $files) {; if($file.Name.EndsWith('.OLD')) { continue }; $newName = $file.FullName + '.OLD'; Write-Host "^""Rename '$($file.FullName)' to '$newName'"^""; Move-Item -LiteralPath "^""$($file.FullName)"^"" -Destination "^""$newName"^"" -Force; }; }"
598 | :: ----------------------------------------------------------
599 |
600 |
601 | :: ----------------------------------------------------------
602 | :: -------------------Windows Feedback app-------------------
603 | :: ----------------------------------------------------------
604 | echo --- Windows Feedback app
605 | PowerShell -ExecutionPolicy Unrestricted -Command "$package = Get-AppxPackage -AllUsers 'Microsoft.WindowsFeedback'; if (!$package) {; Write-Host 'Not installed'; exit 0; }; $directories = @($package.InstallLocation, "^""$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)"^""); foreach($dir in $directories) {; if ( !$dir -Or !(Test-Path "^""$dir"^"") ) { continue }; cmd /c ('takeown /f "^""' + $dir + '"^"" /r /d y 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership' }; cmd /c ('icacls "^""' + $dir + '"^"" /grant administrators:F /t 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership' }; $files = Get-ChildItem -File -Path $dir -Recurse -Force; foreach($file in $files) {; if($file.Name.EndsWith('.OLD')) { continue }; $newName = $file.FullName + '.OLD'; Write-Host "^""Rename '$($file.FullName)' to '$newName'"^""; Move-Item -LiteralPath "^""$($file.FullName)"^"" -Destination "^""$newName"^"" -Force; }; }"
606 | :: ----------------------------------------------------------
607 |
608 |
609 | :: ----------------------------------------------------------
610 | :: ---------------------CBS Preview app----------------------
611 | :: ----------------------------------------------------------
612 | echo --- CBS Preview app
613 | PowerShell -ExecutionPolicy Unrestricted -Command "$package = Get-AppxPackage -AllUsers 'Windows.CBSPreview'; if (!$package) {; Write-Host 'Not installed'; exit 0; }; $directories = @($package.InstallLocation, "^""$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)"^""); foreach($dir in $directories) {; if ( !$dir -Or !(Test-Path "^""$dir"^"") ) { continue }; cmd /c ('takeown /f "^""' + $dir + '"^"" /r /d y 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership' }; cmd /c ('icacls "^""' + $dir + '"^"" /grant administrators:F /t 1> nul'); if($LASTEXITCODE) { throw 'Failed to take ownership' }; $files = Get-ChildItem -File -Path $dir -Recurse -Force; foreach($file in $files) {; if($file.Name.EndsWith('.OLD')) { continue }; $newName = $file.FullName + '.OLD'; Write-Host "^""Rename '$($file.FullName)' to '$newName'"^""; Move-Item -LiteralPath "^""$($file.FullName)"^"" -Destination "^""$newName"^"" -Force; }; }"
614 | :: ----------------------------------------------------------
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------