├── LICENSE ├── README.md ├── files ├── apps │ ├── check.json │ ├── choco-apps.config │ └── winget.json └── startup │ └── Shells.psm1 ├── resume.psm1 └── set.psm1 /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](https://badgen.net/github/license/caglaryalcin/after-format) 2 | 3 | ![Alt Text](https://github.com/caglaryalcin/caglaryalcin/blob/main/main.gif) 4 | 5 | ## Description 6 | 7 | If you new formatted your computer on Windows 11(all versions) you can run this script. 8 | 9 | This script allows Windows 1x users to control data collection, privacy and security functions and does exactly the following; (Some are optional: y/n) 10 | 11 |
System Settings  12 | 13 | ![image](https://github.com/user-attachments/assets/df445708-a6eb-4cc0-9a64-fd5983d0a502) 14 | 15 | - It asks if you want region change to turkey 16 | - It asks if you want change your hostname 17 | - It asks if you want disable windows defender 18 | - It asks if you want date format and keyboard layout 19 | - It asks you to select all folder views in the explorer as 'Details' and set the separator settings as shown by the arrows in the picture 20 | 21 | ![image](https://github.com/user-attachments/assets/6a5a335f-1ffe-4427-94a0-75d01204668e) 22 | 23 | - Ask if you want to add a "startup" task to run at startup (recommended) 24 | - Bringing back the old classic right-click context menu and additional buttons 25 | 26 | ![image](https://github.com/user-attachments/assets/1066a699-f11c-4266-a481-cc000da1b451) 27 | ![image](https://github.com/user-attachments/assets/572b299c-a032-4394-b625-7e092e1bfbed) 28 | 29 | - Taskbar aligns left 30 | - Disabling snap 31 | - Adding ohmypush to Windows Terminal 32 | 33 | ![image](https://github.com/user-attachments/assets/154e85b6-0872-45ee-b6bb-846655846890) 34 | 35 | - Disabling gallery folder 36 | - Desktop button in taskbar is enabled 37 | - Disabling sync your settings 38 | - Disabling spotligt 39 | - Disabling toast and apps notifications on lock screen 40 | - Disabling windows media player diagnostics 41 | - Disabling extension of windows search with bing 42 | - Default old photo viewer 43 | - Setting dark mode for applications 44 | - Setting dark mode for system 45 | - Setting control panel view to large icons 46 | - Disabling user interface and device recognition features 47 | - Enabling numlock after startup 48 | - Disabling windows beep sound 49 | - Disabling ipv6 stack 50 | - Disabling virtual ethernet adapters 51 | - Setting cloud flare dns 52 | - Configuring windows explorer settings 53 | - Expanding for file explorer 54 | - Hiding recycle bin shortcut from desktop 55 | - Disabling hiberfil.sys 56 | - Disabling display and sleep mode timeouts 57 | - Disabling updates for other microsoft products 58 | - Disabling cortana 59 | - Disabling bing search in start menu 60 | - Disabling smartscreen filter 61 | - Disabling sensors 62 | - Disabling tailored experiences 63 | - Disabling xbox features 64 | - Disabling blocking of downloaded files 65 | - Disabling nightly wake-up for automatic maintenance 66 | - Disabling storage sense 67 | - Disabling built-in adobe flash in ie and edge 68 | - Disabling edge preload 69 | - Disabling internet explorer first run wizard 70 | - Disabling windows media player online access 71 | - Disabling action center (notification center) 72 | - Disabling system restore for system drive 73 | - Setting low uac level 74 | - Removing unnecessary tasks 75 | - Enabling clearing of recent files on exit 76 | - Disabling recent files lists 77 | - Disabling search for app in store for unknown extensions 78 | - Hiding Recently Added, Recommended Settings, Apps, Personalized Sites and Section from list from the start menu 79 | - Stopping and disabling unnecessary services 80 | - Disabling news and interest on taskbar 81 | - Hiding people icon from taskbar 82 | - Hiding taskview icon from taskbar 83 | - Hiding multitaskview icon from taskbar 84 | - Showing small icons in taskbar 85 | - Hiding taskbar search 86 | - Removing chat from taskbar 87 | - Removing widgets from taskbar 88 | - Enabling telnet client 89 | - Setting automatic kill of unsaved changes when trying to log out, restart or close 90 | 91 | ![image](https://github.com/user-attachments/assets/869227a1-a299-4e20-8450-b0ba279409ff) 92 | 93 | - Removing Quota on the disk menu 94 | - Setting password never expires for local admins 95 | - Disabling Account Notifications 96 | - Setting End task button 97 | - Disabling Location Notifications 98 | - Enabling Sudo 99 | - Removing shortcut name 100 | 101 | ![image](https://github.com/user-attachments/assets/5d44a918-bf3f-49df-a27a-105b461a07e3) 102 | 103 | - Unpinning all start menu tiles 104 | 105 |
106 | 107 |
Privacy Settings  108 | 109 | ![image](https://github.com/user-attachments/assets/ed4a0085-fe62-4e33-967a-4a3a1ccdd812) 110 | 111 | - Disabling telemetry 112 | - Blocking telemetry in host file 113 | - Disabling feedback 114 | - Disabling activity history 115 | - Disabling clipboard history 116 | - Disabling user steps recorder 117 | - Turning off text suggestions for hardware keyboard 118 | - Disabling app launch tracking 119 | - Disabling website access to language list 120 | - Stopping and disabling Connected User Experiences and Telemetry service 121 | - Disabling advertising ID 122 | - Disabling Wi-Fi Sense 123 | - Disabling application suggestions 124 | - Disabling UWP apps background access 125 | - Disabling access to voice activation from UWP apps 126 | - Disabling access to notifications from UWP apps 127 | - Disabling access to account info from UWP apps 128 | - Disabling access to contacts from UWP apps 129 | - Disabling access to calendar from UWP apps 130 | - Disabling access to phone calls from UWP apps 131 | - Disabling access to call history from UWP apps 132 | - Disabling access to email from UWP apps 133 | - Disabling access to tasks from UWP apps 134 | - Disabling access to messaging from UWP apps 135 | - Disabling access to radios from UWP apps 136 | - Disabling access to other devices from UWP apps 137 | - Disabling access to diagnostic information from UWP apps 138 | - Disabling access to libraries and file system from UWP apps 139 | - Disabling UWP apps swap file 140 | - Disabling automatic maps updates 141 | - Disabling windows update automatic restart 142 | - Disabling windows update automatic downloads 143 | 144 |
145 |
Install Softwares  146 | 147 | ![image](https://github.com/user-attachments/assets/048bf752-293e-474e-944d-f15fe9dcecb6) 148 | 149 | > 💡It asks if you want to install the following softwares or not. If an error is received while loading packets with chocolatey, it will try to load them with winget. 150 | 151 | ![image](https://github.com/user-attachments/assets/88b71d2a-3e78-4ecf-aeb8-df98f7952a3d) 152 | 153 | - Chrome 154 | - Brave 155 | - Firefox 156 | - Steam 157 | - Epic Games 158 | - HWMonitor 159 | - CrystalDisk Info 160 | - VMware Workstation 161 | - VirtualBox 162 | - Signal 163 | - VSCode (with extensions) 164 | - Notepad 165 | - Windows SDK 166 | - Node.js 167 | - Python 168 | - Git 169 | - AnyDesk 170 | - Terminal 171 | - Speedtest cli 172 | - GitHub 173 | - VLC 174 | - TreeSize 175 | - Total Commander 176 | - Wireshark 177 | - Deluge 178 | - DBeaver 179 | - Cryptomator 180 | - Microsoft Teams 181 | - SteelSeries 182 | - Java 183 | - 7zip 184 | - Lightshot 185 | - Twinkle Tray 186 | - Codec Pack Mega 187 | - Malwarebytes 188 | - Internet Download Manager 189 | - Cloudflare Warp 190 | - OpenRGB 191 | - Tailscale 192 | - WinFsp for Cryptomator 193 | - NVCleanstall 194 | - Rufus 195 | - Regshot 196 | 197 |
198 | 199 |
Remove Unused apps/Softwares  200 | 201 | ![image](https://github.com/user-attachments/assets/6166868e-7eef-4012-b530-ee6c10eb6674) 202 | 203 | - Uninstalling default third party applications 204 | - It asks if you want disable Microsoft Copilot. 205 | - Uninstalling windows media player 206 | - Uninstalling work folders client 207 | - Uninstalling microsoft XPS document writer 208 | - Removing default fax printer 209 | - Uninstalling windows fax and scan services 210 | - Removing 3D folders 211 | - Microsoft edge privacy settings are being adjusted 212 | - It asks if you want remove unnecessary tasks 213 | - It asks if you want uninstall windows onedrive 214 | - It asks if you want uninstall windows edge 215 | 216 |
217 | 218 |
Startup Script  219 | 220 | ![image](https://github.com/user-attachments/assets/b2cc1a6e-7354-4f0b-a572-6a181bcd2a43) 221 | 222 | > [!TIP] 223 | > This script adds a task named 'startup' to the task scheduler. This task does exactly the following; 224 | 225 | > [!IMPORTANT] 226 | > startup task > This task starts 3 minutes after the computer is turned on, runs again every 3 hours and performs the following operations. 227 | 228 | - Time zone is set to Turkey 229 | - Language bar is set to appear in the taskbar 230 | - It does expand for file explorer ribbon 231 | - It does removing stick keys 232 | - f12 is disabled for snipping tool 233 | - It does remove toggle keys 234 | - It does remove unnecessary tasks(update and such) in task scheduler 235 | - It does remove windows defender icon in taskbar 236 | - Disables unnecessary applications that open on connection 237 | - It does remove microsoft edge updates in task scheduler 238 | - It does remove google chrome updates in task scheduler 239 | - It does enable shot desktop button 240 | - Sync windows localtime 241 | 242 | > upgrade-packages > This task runs 3 minutes after the computer is turned on and performs the following operations. 243 | 244 | - Updates all applications and packages with winget. 245 | 246 |
247 | 248 | ## Start the script 249 | > [!WARNING] 250 | > Great care went into making sure this script does not unintentionally break any OS functionality, but use at your own risk! 251 | 252 | > [!NOTE] 253 | > This script takes about 60 minutes with 100mbps internet. 254 | 255 | > [!IMPORTANT] 256 | > Powershell must be run as admin 257 | 258 | ```powershell 259 | iwr "set.caglaryalcin.com" -UseB | iex 260 | ``` 261 | -------------------------------------------------------------------------------- /files/apps/check.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/winget-packages.schema.2.0.json", 3 | "CreationDate": "2023-07-01", 4 | "Sources": [ 5 | { 6 | "Packages": [ 7 | {"PackageIdentifier": ["Chocolatey"]}, 8 | {"PackageIdentifier": ["Chrome"]}, 9 | {"PackageIdentifier": ["Brave"]}, 10 | {"PackageIdentifier": ["Firefox"]}, 11 | {"PackageIdentifier": ["Steam"]}, 12 | {"PackageIdentifier": ["Epic"]}, 13 | {"PackageIdentifier": ["HWMonitor"]}, 14 | {"PackageIdentifier": ["Crystal"]}, 15 | {"PackageIdentifier": ["AnyDesk"]}, 16 | {"PackageIdentifier": ["Speedtest"]}, 17 | {"PackageIdentifier": ["TreeSize"]}, 18 | {"PackageIdentifier": ["Commander"]}, 19 | {"PackageIdentifier": ["qBittorrent"]}, 20 | {"PackageIdentifier": ["7-zip", "7zip"]}, 21 | {"PackageIdentifier": ["Flameshot"]}, 22 | {"PackageIdentifier": ["twinkle"]}, 23 | {"PackageIdentifier": ["Codec"]}, 24 | {"PackageIdentifier": ["Download"]}, 25 | {"PackageIdentifier": ["rufus"]}, 26 | {"PackageIdentifier": ["powertoys"]}, 27 | {"PackageIdentifier": ["VLC"]}, 28 | {"PackageIdentifier": ["Signal"]}, 29 | {"PackageIdentifier": ["Teams"]}, 30 | {"PackageIdentifier": ["Code"]}, 31 | {"PackageIdentifier": ["notepad"]}, 32 | {"PackageIdentifier": ["*SDK"]}, 33 | {"PackageIdentifier": ["Nodejs"]}, 34 | {"PackageIdentifier": ["Python"]}, 35 | {"PackageIdentifier": ["Git"]}, 36 | {"PackageIdentifier": ["GitHub"]}, 37 | {"PackageIdentifier": ["dbeaver"]}, 38 | {"PackageIdentifier": ["webview"]}, 39 | {"PackageIdentifier": ["runtime"]}, 40 | {"PackageIdentifier": ["dotnet"]}, 41 | {"PackageIdentifier": ["Malwarebytes"]}, 42 | {"PackageIdentifier": ["OhMyPosh"]} 43 | ] 44 | } 45 | ] 46 | } -------------------------------------------------------------------------------- /files/apps/choco-apps.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /files/apps/winget.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://aka.ms/winget-packages.schema.2.0.json", 3 | "CreationDate": "2023-07-01", 4 | "Sources": [ 5 | { 6 | "Packages": [ 7 | {"PackageIdentifier": "Chocolatey.Chocolatey"}, 8 | {"PackageIdentifier": "Google.Chrome"}, 9 | {"PackageIdentifier": "Brave.Brave"}, 10 | {"PackageIdentifier": "Mozilla.Firefox"}, 11 | {"PackageIdentifier": "Valve.Steam"}, 12 | {"PackageIdentifier": "EpicGames.EpicGamesLauncher"}, 13 | {"PackageIdentifier": "CPUID.HWMonitor"}, 14 | {"PackageIdentifier": "CrystalDewWorld.CrystalDiskInfo"}, 15 | {"PackageIdentifier": "AnyDeskSoftwareGmbH.AnyDesk"}, 16 | {"PackageIdentifier": "Ookla.Speedtest.CLI"}, 17 | {"PackageIdentifier": "JAMSoftware.TreeSize.Free"}, 18 | {"PackageIdentifier": "Ghisler.TotalCommander"}, 19 | {"PackageIdentifier": "qBittorrent.qBittorrent.Beta"}, 20 | {"PackageIdentifier": "7zip.7zip"}, 21 | {"PackageIdentifier": "Flameshot.Flameshot"}, 22 | {"PackageIdentifier": "xanderfrangos.twinkletray"}, 23 | {"PackageIdentifier": "CodecGuide.K-LiteCodecPack.Mega"}, 24 | {"PackageIdentifier": "Tonec.InternetDownloadManager"}, 25 | {"PackageIdentifier": "Rufus.Rufus"}, 26 | {"PackageIdentifier": "Rem0o.FanControl"}, 27 | {"PackageIdentifier": "Microsoft.PowerToys"}, 28 | {"PackageIdentifier": "VideoLAN.VLC"}, 29 | {"PackageIdentifier": "OpenWhisperSystems.Signal"}, 30 | {"PackageIdentifier": "Microsoft.Teams"}, 31 | {"PackageIdentifier": "Microsoft.VisualStudioCode"}, 32 | {"PackageIdentifier": "Notepad++.Notepad++"}, 33 | {"PackageIdentifier": "Microsoft.WindowsSDK.10.0.18362"}, 34 | {"PackageIdentifier": "OpenJS.NodeJS"}, 35 | {"PackageIdentifier": "Python.Python.3.8"}, 36 | {"PackageIdentifier": "Git.Git"}, 37 | { 38 | "PackageIdentifier": "GitHub.GitHubDesktop", 39 | "InstallerType": "exe" 40 | }, 41 | {"PackageIdentifier": "dbeaver.dbeaver"}, 42 | {"PackageIdentifier": "Microsoft.EdgeWebView2Runtime"}, 43 | {"PackageIdentifier": "Microsoft.DotNet.DesktopRuntime.8"}, 44 | {"PackageIdentifier": "Malwarebytes.Malwarebytes"}, 45 | {"PackageIdentifier": "JanDeDobbeleer.OhMyPosh"} 46 | ] 47 | } 48 | ] 49 | } -------------------------------------------------------------------------------- /files/startup/Shells.psm1: -------------------------------------------------------------------------------- 1 | #region Set MAP 2 | 3 | $ErrorActionPreference = 'SilentlyContinue' 4 | New-PSDrive -PSProvider Registry -Name HKCU -Root HKEY_CURRENT_USER 5 | New-PSDrive -PSProvider Registry -Name HKLM -Root HKEY_LOCAL_MACHINE 6 | New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS 7 | $ErrorActionPreference = 'Continue' 8 | 9 | 10 | Function TRFormats { 11 | Set-TimeZone -Name "Turkey Standard Time" 12 | Set-Culture tr-TR 13 | Set-ItemProperty -Path "HKCU:\Control Panel\International" -name ShortDate -value "dd/MM/yyyy" 14 | } 15 | 16 | TRFormats 17 | 18 | # Show language bar 19 | Function ShowLanguageBar { 20 | Set-WinLanguageBarOption -UseLegacySwitchMode 21 | Set-WinLanguageBarOption 22 | } 23 | 24 | ShowLanguageBar 25 | 26 | # Remove Toggle and Sticky Keys and File Explorer Ribbon Settings 27 | Function RibbonandKeys { 28 | # File Explorer Ribbon Settings 29 | $path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Ribbon" 30 | 31 | if (-Not (Test-Path $path)) { 32 | New-Item -Path $path | Out-Null 33 | } 34 | 35 | $settings = @{ 36 | "MinimizedStateTabletModeOff" = 0; 37 | "Minimized" = 0; 38 | } 39 | 40 | foreach ($name in $settings.Keys) { 41 | Set-ItemProperty -Path $path -Name $name -Value $settings[$name] -Type DWord 42 | } 43 | 44 | # Remove Toggle and Sticky Keys 45 | $combinedSettings = @{ 46 | "HKCU:\Control Panel\Accessibility\StickyKeys" = @{ "Flags" = "506" }; # 506 Off, 510 On 47 | "HKCU:\Control Panel\Accessibility\Keyboard Response" = @{ "Flags" = "122" }; # 122 Off, 126 On 48 | "HKCU:\Control Panel\Accessibility\ToggleKeys" = @{ "Flags" = "58" }; # 58 Off, 62 On 49 | "HKCU:\Keyboard Layout\Toggle" = @{ "Language HotKey" = "3"; "Layout HotKey" = "3" }; 50 | } 51 | 52 | foreach ($path in $combinedSettings.Keys) { 53 | if (-not (Test-Path $path)) { 54 | New-Item -Path $path -Force | Out-Null 55 | } 56 | 57 | foreach ($prop in $combinedSettings[$path].GetEnumerator()) { 58 | Set-ItemProperty -Path $path -Name $prop.Key -Value $prop.Value -Type String 59 | } 60 | } 61 | } 62 | 63 | RibbonandKeys 64 | 65 | # Remove Tasks in Task Scheduler 66 | Function RemoveTasks { 67 | Write-Host "Removing Unnecessary Tasks..." -NoNewline 68 | 69 | $taskPatterns = @("OneDrive*", "MicrosoftEdge*", "Google*", "Brave*", "Intel*", 70 | "update*", "klcp*", "MSI*", "*Adobe*", "CCleaner*", "G2M*", "Opera*", 71 | "Overwolf*", "User*", "CreateExplorer*", "{*", "*Samsung*", "*npcap*", 72 | "*Consolidator*", "*Dropbox*", "*Heimdal*", "*klcp*", "*UsbCeip*", 73 | "*DmClient*", "*Office Auto*", "*Office Feature*", "*OfficeTelemetry*", 74 | "*GPU*", "Xbl*", "Autorun*", "BackgroundDownload*", "ScheduledDefrag", 75 | "ProactiveScan", "SilentCleanup", "UsageDataReportin", "ReconcileFeatures", 76 | "PenSyncDataAvailable", "LocalUserSyncDataAvailable", "MouseSyncDataAvailable", 77 | "TouchpadSyncDataAvailable", "Synchronize Language Settings", "PrinterCleanupTask", 78 | "SpeechModelDownloadTask", "QueueReporting", "Scheduled Start", "Firefox Back*") 79 | 80 | $allTasks = Get-ScheduledTask 81 | 82 | foreach ($pattern in $taskPatterns) { 83 | $filteredTasks = $allTasks | Where-Object { $_.TaskName -like $pattern } 84 | foreach ($task in $filteredTasks) { 85 | Unregister-ScheduledTask -TaskName $task.TaskName -Confirm:$false 86 | } 87 | } 88 | } 89 | 90 | RemoveTasks 91 | 92 | # Hide Defender Tray Icon 93 | Function HideDefenderTrayIcon { 94 | $defenderPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Systray" 95 | $runPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" 96 | 97 | # Ensure the registry key exists 98 | If (!(Test-Path $defenderPath)) { 99 | New-Item -Path $defenderPath -Force *>$null 100 | } 101 | 102 | # Set the property to hide the systray icon 103 | Set-ItemProperty -Path $defenderPath -Name "HideSystray" -Type DWord -Value 1 104 | 105 | # Check OS build version and remove specific properties 106 | $osBuild = [System.Environment]::OSVersion.Version.Build 107 | Switch ($osBuild) { 108 | 14393 { 109 | if (Test-Path $runPath) { 110 | Remove-ItemProperty -Path $runPath -Name "WindowsDefender" -ErrorAction SilentlyContinue 111 | } 112 | } 113 | { $_ -ge 15063 } { 114 | if (Test-Path $runPath) { 115 | Remove-ItemProperty -Path $runPath -Name "SecurityHealth" -ErrorAction SilentlyContinue 116 | } 117 | } 118 | } 119 | } 120 | 121 | HideDefenderTrayIcon 122 | 123 | # Disable Startup App 124 | Function DisableStartupApps { 125 | $StartPaths = @( 126 | "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run32\", 127 | "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\", 128 | "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run\", 129 | "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run\", 130 | "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\", 131 | "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce\", 132 | "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run\" 133 | ) 134 | 135 | $StartFilePaths = @( 136 | "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp", 137 | "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" 138 | ) 139 | 140 | $removeList = @( 141 | "Security*", "*Teams*", "Microsoft team*", "*Update*", #Microsoft & Updates 142 | "NVD*", "NVI*", "NVN*", "NVP*", "*NVT*", #Nvidia 143 | "*CCX*", "Adobe*", "*CC*", #Adobe 144 | "*uTorrent*", "*Deluge*", #Torrent 145 | "FACEIT*", "*Riot*", "*Epic*", "*Vanguard*", "*Blitz*", #Gaming 146 | "*Brave*", "Google*", "*Chrome*", "*Opera*", "*vivaldi", "*Edge*", "*Yandex*", "*Firefox*", "*Librewolf*", #Browsers 147 | "*EADM*", "*Java*", "*cisco*", "*npcap*", "*IDMan*", "*Disc*", "*CORS*", "*Next*", "*One*", "*iTunes*", "*iTunes*", "*Ai*", "*Skype*", 148 | "*vmware*", "*Any*", "Tailscale*", "Docker*", "GarminExpress" #Other 149 | ) 150 | 151 | # Remove from registry 152 | foreach ($path in $StartPaths) { 153 | foreach ($item in $removeList) { 154 | Remove-ItemProperty -Path $path -Name $item 155 | } 156 | } 157 | 158 | # Remove from startup folders 159 | foreach ($folder in $StartFilePaths) { 160 | Get-ChildItem -Path $folder -Recurse | 161 | Where-Object { 162 | $item = $_.Name 163 | foreach ($pattern in $removeList) { 164 | if ($item -like $pattern) { 165 | return $true 166 | } 167 | } 168 | return $false 169 | } | 170 | Remove-Item -Force -Recurse 171 | } 172 | 173 | } 174 | 175 | DisableStartupApps 176 | 177 | # Remove Edge Updates 178 | 179 | Function RemoveEdgeUpdates { 180 | # Remove Edge lnk file 181 | Get-ChildItem -Path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp" -Force | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue 182 | 183 | # Registry keys and files to remove 184 | $registryPaths = @( 185 | "HKLM:\SYSTEM\CurrentControlSet\Services\edgeupdate", 186 | "HKLM:\SYSTEM\CurrentControlSet\Services\edgeupdatem", 187 | "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{9459C573-B17A-45AE-9F64-1857B5D58CEE}" 188 | ) 189 | 190 | # Check if registry keys exist and remove them if they do 191 | foreach ($path in $registryPaths) { 192 | if (Test-Path $path) { 193 | Remove-Item -Path $path -Recurse -Force 194 | } 195 | } 196 | 197 | # Services to stop and disable 198 | $edgeservices = @("edgeupdate", "edgeupdatem") 199 | 200 | # Check if services exist, stop them, disable them, and delete them 201 | foreach ($service in $edgeservices) { 202 | $serviceObject = Get-Service -Name $service -ErrorAction SilentlyContinue 203 | if ($serviceObject -ne $null) { 204 | Stop-Service -Name $service -Force -ErrorAction SilentlyContinue 205 | Set-Service -Name $service -Status stopped -StartupType disabled -ErrorAction SilentlyContinue 206 | sc.exe delete $service *>$null 2>&1 207 | } 208 | } 209 | } 210 | 211 | RemoveEdgeUpdates 212 | 213 | # Remove Chrome Updates 214 | Function RemoveChromeUpdates { 215 | # Registry keys and files to remove 216 | $registryPaths = @( 217 | "HKLM:\SYSTEM\CurrentControlSet\Services\gupdate", 218 | "HKLM:\SYSTEM\CurrentControlSet\Services\gupdatem", 219 | "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{8A69D345-D564-463c-AFF1-A69D9E530F96}" 220 | ) 221 | 222 | # Check if registry keys exist and remove them if they do 223 | foreach ($path in $registryPaths) { 224 | if (Test-Path $path) { 225 | Remove-Item -Path $path -Recurse -Force 226 | } 227 | } 228 | 229 | # Services to stop and disable 230 | $chromeservices = @("gupdate", "gupdatem") 231 | 232 | # Check if services exist, stop them, disable them, and delete them 233 | foreach ($service in $chromeservices) { 234 | $serviceObject = Get-Service -Name $service -ErrorAction SilentlyContinue 235 | if ($serviceObject -ne $null) { 236 | if ($serviceObject.Status -ne 'Stopped' -or $serviceObject.StartType -ne 'Disabled') { 237 | Stop-Service -Name $service -Force -ErrorAction SilentlyContinue 238 | Set-Service -Name $service -StartupType Disabled -ErrorAction SilentlyContinue 239 | sc.exe delete $service *>$null 2>&1 240 | } 241 | } 242 | } 243 | } 244 | 245 | RemoveChromeUpdates 246 | 247 | # Sync Time 248 | Function SyncTime { 249 | Set-Service -Name "W32Time" -StartupType Automatic 250 | Restart-Service -Name "W32Time" -Force 251 | 252 | w32tm /resync /force *>$null 253 | w32tm /config /manualpeerlist:time.windows.com, 0x1 /syncfromflags:manual /reliable:yes /update *>$null 254 | } 255 | 256 | SyncTime 257 | 258 | Function UpdateRegistrySettings { 259 | param ( 260 | [string]$Path, 261 | [string]$Name, 262 | [object]$Value, 263 | [string]$Type = "DWord" 264 | ) 265 | Set-ItemProperty -Path $Path -Name $Name -Value $Value -Type $Type 266 | } 267 | 268 | Function ApplySettings { 269 | # Disable Print Screen key for Snipping Tool 270 | UpdateRegistrySettings -Path "HKCU:\Control Panel\Keyboard" -Name "PrintScreenKeyForSnippingEnabled" -Value 0 271 | 272 | # Disable search box in taskbar 273 | UpdateRegistrySettings -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Value 0 274 | 275 | # Set windows 11 taskbar corner overflow icons 276 | $registryPath = "HKCU:\Control Panel\NotifyIconSettings" 277 | Get-ChildItem -Path $registryPath | ForEach-Object { 278 | UpdateRegistrySettings -Path "$registryPath\$($_.PSChildName)" -Name "IsPromoted" -Value 1 279 | } 280 | 281 | # Show Desktop Button 282 | $advancedPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" 283 | if (-not (Test-Path $advancedPath)) { 284 | New-Item -Path $advancedPath -Force | Out-Null 285 | } 286 | UpdateRegistrySettings -Path $advancedPath -Name "TaskbarSd" -Value 1 287 | } 288 | 289 | ApplySettings -------------------------------------------------------------------------------- /resume.psm1: -------------------------------------------------------------------------------- 1 | ########## 2 | #region Priority 3 | ########## 4 | 5 | Function Priority { 6 | $ErrorActionPreference = 'SilentlyContinue' 7 | New-PSDrive -PSProvider Registry -Name HKCU -Root HKEY_CURRENT_USER | Out-Null 8 | New-PSDrive -PSProvider Registry -Name HKLM -Root HKEY_LOCAL_MACHINE | Out-Null 9 | New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS | Out-Null 10 | New-PSDrive -Name "HKCR" -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" | Out-Null 11 | } 12 | 13 | Priority 14 | 15 | Function Silent { 16 | $Global:ProgressPreference = 'SilentlyContinue' 17 | } 18 | 19 | ########## 20 | #endregion Priority 21 | ########## 22 | 23 | $wingetWarnings = @() 24 | Function InstallSoftwares { 25 | Write-Host "---------Adjusting System Settings" -ForegroundColor Blue -BackgroundColor Gray 26 | Write-Host "Chapter completed." 27 | Write-Host `n"---------Adjusting Privacy Settings" -ForegroundColor Blue -BackgroundColor Gray 28 | Write-Host "Chapter completed." 29 | 30 | Write-Host `n"---------Installing Softwares" -ForegroundColor Blue -BackgroundColor Gray 31 | 32 | Write-Host `n"Installing/upgrading winget..." -NoNewline 33 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 34 | 35 | # Create a directory for logs 36 | New-Item -Path "C:\packages-logs" -ItemType Directory -Force | Out-Null 37 | 38 | $appsToClose = @{ 39 | "github-desktop" = "GithubDesktop"; 40 | "cloudflare-warp" = "Cloudflare WARP" 41 | } 42 | 43 | # This script block will continuously check for specified processes and stop them if found 44 | $scriptBlock = { 45 | Param($processNames) 46 | while ($true) { 47 | foreach ($process in $processNames) { 48 | Get-Process | Where-Object { $_.Name -eq $process } | Stop-Process -Force -ErrorAction SilentlyContinue 49 | } 50 | Start-Sleep -Seconds 2 51 | } 52 | } 53 | 54 | # Start the background job for monitoring and stopping processes 55 | $job = Start-Job -ScriptBlock $scriptBlock -ArgumentList $appsToClose.Values 56 | 57 | $jsonContent = Invoke-RestMethod -Uri "https://raw.githubusercontent.com/caglaryalcin/after-format/main/files/apps/winget.json" 58 | $packages = $jsonContent.Sources.Packages 59 | 60 | foreach ($pkg in $packages) { 61 | $packageName = $pkg.PackageIdentifier 62 | $installerType = $pkg.InstallerType 63 | Write-Host "Installing $packageName..." -NoNewLine 64 | 65 | # Install the packages 66 | Start-Sleep -Milliseconds 5 67 | if ($installerType) { 68 | $result = & winget install $packageName -e --installer-type $installerType --silent --accept-source-agreements --accept-package-agreements --force 2>&1 | Out-String 69 | } 70 | else { 71 | $result = & winget install $packageName -e --silent --accept-source-agreements --accept-package-agreements --force 2>&1 | Out-String 72 | } 73 | 74 | # Check if the installation was successful 75 | if ($LASTEXITCODE -ne 0 -or $result -match "does not match" -or $result -match "fail") { 76 | Write-Host "[WARNING]" -ForegroundColor Red -BackgroundColor Black 77 | $wingetWarnings += $packageName 78 | $logFile = "C:\packages-logs\${packageName}_winget_install.log" 79 | $result | Out-File -FilePath $logFile -Force 80 | Write-Host "[Check the log file at $logFile for details.]" 81 | } 82 | else { 83 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 84 | } 85 | 86 | } 87 | 88 | # Once all installations are done, stop the background job 89 | Stop-Job -Job $job 90 | Remove-Job -Job $job 91 | 92 | # Kill the processes of power toys 93 | $processName = "PowerToys*" 94 | while ($true) { 95 | Start-Sleep -Seconds 2 96 | $process = Get-Process -Name $processName -ErrorAction SilentlyContinue 97 | if ($process) { 98 | Stop-Process -Id $process.Id -Force 99 | break 100 | } 101 | } 102 | } 103 | 104 | InstallSoftwares 105 | 106 | Function Get-InstalledProgram { 107 | param ( 108 | [Parameter(Mandatory = $true)] 109 | [string]$programName 110 | ) 111 | 112 | if ($wingetWarnings -contains $programName) { 113 | return $true 114 | } 115 | 116 | $installedProgram = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, 117 | HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall, 118 | HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall | 119 | Get-ItemProperty | 120 | Where-Object { $_.DisplayName -like "*$programName*" } | 121 | Select-Object -First 1 122 | 123 | if (-not $installedProgram) { 124 | $installedProgram = Get-AppxPackage | Where-Object { $_.Name -like "*$programName*" } | Select-Object -First 1 125 | } 126 | 127 | # check other paths 128 | $paths = @( 129 | 'C:\programdata\', 130 | 'C:\Program Files (x86)\', 131 | 'C:\Program Files\' 132 | ) 133 | 134 | foreach ($path in $paths) { 135 | if (-not $installedProgram) { 136 | $chocoPrograms = Get-ChildItem -Path $path -Directory -ErrorAction SilentlyContinue | Where-Object { $_.Name -like "*$programName*" } 137 | if ($null -ne $chocoPrograms -and $chocoPrograms.Count -gt 0) { 138 | $installedProgram = $true 139 | break 140 | } 141 | } 142 | } 143 | 144 | return $null -ne $installedProgram 145 | } 146 | 147 | Write-Host `n"----------------" -ForegroundColor Yellow 148 | Write-Host @" 149 | Detecting programs that cannot be installed with winget... 150 | 151 | "@ 152 | Function chocoinstall { 153 | $chocoExecutablePath = Join-Path -Path 'C:\ProgramData\chocolatey\bin' -ChildPath 'choco.exe' 154 | 155 | if (-not (Test-Path -Path $chocoExecutablePath)) { 156 | try { 157 | Write-Host "Installing Chocolatey..." -NoNewline 158 | 159 | # Disable Chocolatey's first run customization 160 | If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main")) { 161 | New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main" -Force | Out-Null 162 | } 163 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main" -Name "DisableFirstRunCustomize" -Value 1 -Type DWord 164 | 165 | # Install Chocolatey 166 | Set-ExecutionPolicy Bypass -Scope Process -Force 167 | [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 168 | Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) *>$null 169 | Start-Sleep 10 170 | 171 | # Check if Chocolatey is installed 172 | if (Test-Path -Path $chocoExecutablePath) { 173 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 174 | } 175 | else { 176 | $errorMessage = "Chocolatey installation failed or Chocolatey is not available in PATH." 177 | Write-Host "[WARNING] $errorMessage" -ForegroundColor Red -BackgroundColor Black 178 | throw $errorMessage 179 | } 180 | 181 | # Disable -y requirement for all packages 182 | choco feature enable -n allowGlobalConfirmation *>$null 183 | 184 | # Set the Chocolatey path to the environment variable 185 | $env:PATH += ";C:\ProgramData\chocolatey\bin" 186 | [System.Environment]::SetEnvironmentVariable('Path', $env:Path + ';C:\ProgramData\chocolatey\bin', [System.EnvironmentVariableTarget]::Machine) 187 | } 188 | catch { 189 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 190 | } 191 | } 192 | else { 193 | $env:PATH += ";C:\ProgramData\chocolatey\bin" 194 | [System.Environment]::SetEnvironmentVariable('Path', $env:Path + ';C:\ProgramData\chocolatey\bin', [System.EnvironmentVariableTarget]::Machine) 195 | } 196 | } 197 | 198 | chocoinstall 199 | 200 | $checkJsonUrl = "https://raw.githubusercontent.com/caglaryalcin/after-format/main/files/apps/check.json" 201 | $jsonContent = Invoke-RestMethod -Uri $checkJsonUrl 202 | $packagesToCheck = $jsonContent.Sources.Packages 203 | 204 | $chocoAppsConfigUrl = "https://raw.githubusercontent.com/caglaryalcin/after-format/main/files/apps/choco-apps.config" 205 | [xml]$chocoConfig = Invoke-RestMethod -Uri $chocoAppsConfigUrl 206 | 207 | foreach ($pkg in $packagesToCheck) { 208 | $isInstalled = $false 209 | 210 | foreach ($identifier in $pkg.PackageIdentifier) { 211 | if (Get-InstalledProgram -programName $identifier) { 212 | $isInstalled = $true 213 | break 214 | } 215 | } 216 | 217 | if (-not $isInstalled) { 218 | foreach ($identifier in $pkg.PackageIdentifier) { 219 | $chocoPackageId = $chocoConfig.packages.package | Where-Object { $_.id -match $identifier } | Select-Object -ExpandProperty id 220 | 221 | if ($chocoPackageId) { 222 | Write-Host "$identifier" -ForegroundColor Red -BackgroundColor Black -NoNewline 223 | Write-Host " not installed" -NoNewline 224 | Write-Host " with winget." -NoNewline 225 | Write-Host "Trying with" -NoNewLine 226 | Write-Host " chocolatey..." -Foregroundcolor Yellow -NoNewline 227 | $result = choco install $chocoPackageId --ignore-checksums --force -y -Verbose -Timeout 0 2>&1 | Out-String 228 | if ($result -match "was successful*") { 229 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 230 | break 231 | } 232 | else { 233 | Write-Host "[WARNING]" -ForegroundColor Red -BackgroundColor Black 234 | $logFile = "C:\packages-logs\${identifier}_choco_install.log" 235 | $result | Out-File -FilePath $logFile -Force 236 | Write-Host "[Check the log file at $logFile for details.]" 237 | } 238 | } 239 | else { 240 | ## 241 | } 242 | } 243 | } 244 | } 245 | 246 | Write-Host @" 247 | ---------------- 248 | 249 | "@ -ForegroundColor Yellow 250 | 251 | Function SafeTaskKill { 252 | param($processName) 253 | 254 | taskkill /f /im $processName *>$null 255 | 256 | if ($LASTEXITCODE -ne 0 -and $LASTEXITCODE -ne 128) { 257 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 258 | } 259 | } 260 | 261 | SafeTaskKill "GithubDesktop.exe" 262 | SafeTaskKill "Cloudflare WARP.exe" 263 | SafeTaskKill "steam.exe" 264 | SafeTaskKill "AnyDesk.exe" 265 | Function Install-VSCodeExtensions { 266 | Write-Host "Installing Microsoft Visual Studio Code Extensions..." -NoNewline 267 | Start-Sleep 5 268 | $vsCodePath = "$env:USERPROFILE\AppData\Local\Programs\Microsoft VS Code\bin\code.cmd" # for winget installations 269 | 270 | if (-not (Test-Path "$env:USERPROFILE\AppData\Local\Programs\Microsoft VS Code")) { 271 | $vsCodePath = "C:\Program Files\Microsoft VS Code\bin\code.cmd" # for chocolatey installations 272 | } 273 | 274 | $docker = "eamodio.gitlens", "davidanson.vscode-markdownlint", "ms-azuretools.vscode-docker", "formulahendry.docker-explorer", "p1c2u.docker-compose", "ms-vscode-remote.remote-containers" 275 | $autocomplete = "formulahendry.auto-close-tag", "formulahendry.auto-rename-tag", "formulahendry.auto-complete-tag", "streetsidesoftware.code-spell-checker", 276 | "redhat.vscode-xml", "dotjoshjohnson.xml" 277 | $design = "pkief.material-icon-theme" 278 | $vspowershell = "ms-vscode.powershell", "tobysmith568.run-in-powershell", "ms-vscode-remote.remote-wsl" 279 | $frontend = "emin.vscode-react-native-kit", "msjsdiag.vscode-react-native", "pranaygp.vscode-css-peek", "rodrigovallades.es7-react-js-snippets", 280 | "dsznajder.es7-react-js-snippets", "dbaeumer.vscode-eslint", "christian-kohler.path-intellisense", "esbenp.prettier-vscode", "ms-python.python", 281 | "naumovs.color-highlight", "meezilla.json", "oliversturm.fix-json" 282 | $github = "github.vscode-pull-request-github", "github.copilot" 283 | $linux = "rogalmic.bash-debug", "shakram02.bash-beautify", "mads-hartmann.bash-ide-vscode", "redhat.vscode-yaml" 284 | $vsextensions = $docker + $autocomplete + $design + $vspowershell + $frontend + $github + $linux 285 | 286 | $installed = & $vsCodePath --list-extensions 287 | 288 | foreach ($vse in $vsextensions) { 289 | if ($installed -contains $vse) { 290 | Write-Host "$vse already installed." -ForegroundColor Gray 291 | } 292 | else { 293 | & $vsCodePath --install-extension $vse *>$null 294 | Start-Sleep -Seconds 3 # Give some time for the extension to install 295 | $updatedInstalled = & $vsCodePath --list-extensions 296 | } 297 | } 298 | 299 | $allExtensionsInstalled = $True 300 | foreach ($vse in $vsextensions) { 301 | if (-not ($updatedInstalled -contains $vse)) { 302 | $allExtensionsInstalled = $False 303 | break 304 | } 305 | } 306 | 307 | if ($allExtensionsInstalled) { 308 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 309 | } 310 | else { 311 | Write-Host "[INFO] VSCode's $vse plugin failed to install" -ForegroundColor Yellow -BackgroundColor Black 312 | } 313 | } 314 | 315 | Install-VSCodeExtensions 316 | 317 | # Visual Studio Code json path 318 | $settingsPath = "$env:USERPROFILE\AppData\Roaming\Code\User\settings.json" 319 | 320 | # Get json content 321 | $jsonContent = @" 322 | { 323 | "workbench.colorTheme": "Visual Studio Dark", 324 | "workbench.iconTheme": "material-icon-theme" 325 | } 326 | "@ 327 | 328 | # Create or rewrite json file 329 | Set-Content -Path $settingsPath -Value $jsonContent -Force 330 | 331 | # 7-Zip on PS 332 | try { 333 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 334 | Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force *>$null 335 | Set-PSRepository -Name 'PSGallery' -SourceLocation "https://www.powershellgallery.com/api/v2" -InstallationPolicy Trusted *>$null 336 | Install-Module -Name 7Zip4PowerShell -Force *>$null 337 | 338 | if (-Not (Get-Module -ListAvailable -Name 7Zip4PowerShell)) { throw "7Zip4PowerShell module not installed" } 339 | } 340 | catch { 341 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 342 | } 343 | 344 | # Malwarebytes trial reset 345 | Function MalwarebytesReset { 346 | Write-Host "Adding task for Malwarebytes trial version reset..." -NoNewline 347 | 348 | $taskName = "Malwarebytes-Reset" 349 | $taskPath = "\" 350 | $taskDescription = "A task that resets the Malwarebytes Premium trial by changing the MachineGuid registry value" 351 | $currentTime = (Get-Date).ToString("HH:mm") 352 | $currentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name 353 | $powerShellScript = { 354 | New-Guid | ForEach-Object { 355 | Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Cryptography' -Name 'MachineGuid' -Value $_.Guid 356 | } 357 | } 358 | 359 | $taskAction = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-Command $powerShellScript" 360 | 361 | $taskTrigger = New-ScheduledTaskTrigger -Daily -DaysInterval 13 -At $currentTime 362 | $taskSettings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -Hidden 363 | $taskprincipal = New-ScheduledTaskPrincipal -UserId $currentUser -RunLevel Highest 364 | 365 | $task = New-ScheduledTask -Action $taskAction -Principal $taskPrincipal -Trigger $taskTrigger -Settings $taskSettings -Description $taskDescription 366 | 367 | $result = Register-ScheduledTask -TaskName $taskName -TaskPath $taskPath -InputObject $task 368 | 369 | if ($result) { 370 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 371 | } 372 | else { 373 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 374 | } 375 | } 376 | 377 | MalwarebytesReset 378 | 379 | # webview2 is being forcibly reloaded because it is necessary 380 | try { 381 | Write-Host "Reinstalling Microsoft Edge WebView2 Runtime..." -NoNewline 382 | Silent 383 | winget install Microsoft.EdgeWebView2Runtime -e --silent --accept-source-agreements --accept-package-agreements --force *>$null 384 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 385 | } 386 | catch { 387 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 388 | 389 | } 390 | 391 | ########## 392 | #region Remove Unused Apps/Softwares 393 | ########## 394 | Function UnusedApps { 395 | # Remove temp softwares task 396 | $taskName = "softwares" 397 | Unregister-ScheduledTask -TaskName $taskName -Confirm:$false 398 | 399 | Write-Host `n"---------Remove Unused Apps/Softwares" -ForegroundColor Blue -BackgroundColor Gray 400 | 401 | Write-Host `n"Do you want " -NoNewline 402 | Write-Host "Uninstall Unused Apps & Softwares?" -ForegroundColor Yellow -NoNewline 403 | Write-Host "(y/n): " -ForegroundColor Green -NoNewline 404 | $response = Read-Host 405 | 406 | if ($response -eq 'y' -or $response -eq 'Y') { 407 | 408 | # Remove Apps 409 | Function UninstallThirdPartyBloat { 410 | Write-Host "Uninstalling Default Third Party Applications..." -NoNewline 411 | 412 | $UninstallAppxPackages = 413 | "Microsoft.WindowsAlarms", #Alarm and clock app for Windows. 414 | "Microsoft.549981C3F5F10", #Code likely represents a specific app or service, specifics unknown without context. 415 | "Microsoft.WindowsFeedbackHub", #Platform for user feedback on Windows. 416 | "Microsoft.Bing*", #Bing search engine related services and apps. 417 | "Microsoft.Zune*", #Media software for music and videos, now discontinued. 418 | "Microsoft.PowerAutomateDesktop", #Automation tool for desktop workflows. 419 | "Microsoft.WindowsSoundRecorder", #Audio recording app for Windows. 420 | "Microsoft.MicrosoftSolitaireCollection", #Solitaire game collection. 421 | "Microsoft.GamingApp", #Likely related to Xbox or Windows gaming services. 422 | "*microsoft.windowscomm**", #Likely refers to communication services in Windows, specifics unclear. 423 | "MicrosoftCorporationII.QuickAssist", #Remote assistance app by Microsoft. 424 | "Microsoft.Todos", #Task management app. 425 | "Microsoft.SkypeApp", #Skype communication app for Windows. 426 | "Microsoft.Microsoft3DViewer", #App for viewing 3D models. 427 | "Microsoft.Wallet", #Digital wallet app, now discontinued. 428 | "Microsoft.WebMediaExtensions", #Extensions for media formats in web browsers. 429 | "MicrosoftWindows.Client.WebExperience", #Likely related to the web browsing experience in Windows, specifics unclear. 430 | "Clipchamp.Clipchamp", #Video editing app. 431 | "Microsoft.WindowsMaps", #Mapping and navigation app. 432 | "Microsoft.Advertising.Xaml", #Advertising SDK for apps. 433 | "Microsoft.MixedReality.Portal", #Mixed Reality portal app for immersive experiences. 434 | "Microsoft.BingNews", #News aggregation app. 435 | "Microsoft.GetHelp", #Support and troubleshooting app. 436 | "Microsoft.Getstarted", #Introduction and tips app for Windows features. 437 | "Microsoft.MicrosoftOfficeHub", #Central hub for Office apps and services. 438 | "Microsoft.OneConnect", #Connectivity and cloud services app. 439 | "Microsoft.People", #Contact management and social integration app. 440 | "Microsoft.Xbox.TCUI", #Xbox text, chat, and user interface services. 441 | "Microsoft.XboxApp", #Main app for Xbox social and gaming features. 442 | "Microsoft.XboxGameOverlay", #In-game overlay for Xbox features and social interactions. 443 | "Microsoft.XboxIdentityProvider", #Service for Xbox account authentication. 444 | "Microsoft.XboxSpeechToTextOverlay" #Speech-to-text services for Xbox gaming. 445 | 446 | $installedApps = Get-AppxPackage -AllUsers 447 | 448 | Silent #silently 449 | 450 | foreach ($package in $UninstallAppxPackages) { 451 | $app = $installedApps | Where-Object { $_.Name -like $package } 452 | if ($null -ne $app) { 453 | try { 454 | $app | Remove-AppxPackage -ErrorAction Stop 455 | } 456 | catch { 457 | Write-Host "[WARNING] $($_.Exception.Message)" -ForegroundColor Red -BackgroundColor Black 458 | } 459 | } 460 | } 461 | 462 | # Uninstall Microsoft Teams Outlook Add-in 463 | $TeamsAddinGUID = '{A7AB73A3-CB10-4AA5-9D38-6AEFFBDE4C91}' 464 | $registryPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TeamsAddinGUID" 465 | if (Test-Path $registryPath) { 466 | try { 467 | Start-Process msiexec.exe -ArgumentList "/x $TeamsAddinGUID /qn /norestart" -NoNewWindow -Wait 468 | } 469 | catch { 470 | Write-Host "[WARNING] $($_.Exception.Message)" -ForegroundColor Red -BackgroundColor Black 471 | } 472 | } 473 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 474 | } 475 | 476 | UninstallThirdPartyBloat 477 | 478 | # Uninstall Windows Media Player 479 | Function UninstallMediaPlayer { 480 | Write-Host `n"Uninstalling Windows Media Player..." -NoNewline 481 | try { 482 | Silent #silently 483 | Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "WindowsMediaPlayer" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null 484 | Get-WindowsCapability -Online | Where-Object { $_.Name -like "Media.WindowsMediaPlayer*" } | Remove-WindowsCapability -Online | Out-Null 485 | } 486 | catch { 487 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 488 | } 489 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 490 | } 491 | 492 | UninstallMediaPlayer 493 | 494 | # Uninstall Work Folders Client - Not applicable to Server 495 | Function UninstallWorkFolders { 496 | Write-Host "Uninstalling Work Folders Client..." -NoNewline 497 | try { 498 | Silent #silently 499 | Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "WorkFolders-Client" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null 500 | } 501 | catch { 502 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 503 | } 504 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 505 | } 506 | 507 | UninstallWorkFolders 508 | 509 | # Uninstall Microsoft XPS Document Writer 510 | Function UninstallXPSPrinter { 511 | Write-Host "Uninstalling Microsoft XPS Document Writer..." -NoNewline 512 | try { 513 | Remove-Printer -Name "Microsoft XPS Document Writer" -ErrorAction SilentlyContinue 514 | } 515 | catch { 516 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 517 | } 518 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 519 | } 520 | 521 | UninstallXPSPrinter 522 | 523 | # Remove Default Fax Printer 524 | Function RemoveFaxPrinter { 525 | Write-Host "Removing Default Fax Printer..." -NoNewline 526 | try { 527 | Remove-Printer -Name "Fax" -ErrorAction SilentlyContinue 528 | } 529 | catch { 530 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 531 | } 532 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 533 | } 534 | 535 | RemoveFaxPrinter 536 | 537 | # Uninstall Windows Fax and Scan Services - Not applicable to Server 538 | Function UninstallFaxAndScan { 539 | Write-Host "Uninstalling Windows Fax and Scan Services..." -NoNewline 540 | try { 541 | Silent #silently 542 | Get-WindowsOptionalFeature -Online | Where-Object { $_.FeatureName -eq "FaxServicesClientPackage" } | Disable-WindowsOptionalFeature -Online -NoRestart -WarningAction SilentlyContinue | Out-Null 543 | Get-WindowsCapability -Online | Where-Object { $_.Name -like "Print.Fax.Scan*" } | Remove-WindowsCapability -Online | Out-Null 544 | } 545 | catch { 546 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 547 | } 548 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 549 | } 550 | 551 | UninstallFaxAndScan 552 | 553 | # Delete some folders from This PC 554 | Function UnpinExplorer { 555 | Write-Host "Deleting 3D Folders, Pictures, Videos, Music from This PC..." -NoNewline 556 | $basePath = "HKLM:\SOFTWARE" 557 | $wow6432Node = "Wow6432Node\" 558 | $explorerPath = "Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\" 559 | $quickAccessPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HomeFolderMSGraph\NameSpace\DelegateFolders\{3936E9E4-D92C-4EEE-A85A-BC16D5EA0819}" 560 | $homePath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace_36354489\{f874310e-b6b7-47dc-bc84-b9e6b38f5903}" 561 | $namespaces = @{ 562 | "3DFolders" = "{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" 563 | "Videos" = "{A0953C92-50DC-43bf-BE83-3742FED03C9C}", "{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" 564 | "Pictures" = "{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}", "{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" 565 | } 566 | 567 | foreach ($category in $namespaces.Keys) { 568 | foreach ($id in $namespaces[$category]) { 569 | $paths = @( 570 | "$basePath\$explorerPath$id", 571 | "$basePath\$wow6432Node$explorerPath$id" 572 | ) 573 | 574 | foreach ($path in $paths) { 575 | try { 576 | Remove-Item -Path $path -Recurse -ErrorAction SilentlyContinue 577 | } 578 | catch { 579 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 580 | } 581 | } 582 | } 583 | } 584 | 585 | # Additional paths 586 | try { 587 | Remove-Item -Path $quickAccessPath -Recurse -ErrorAction SilentlyContinue 588 | Remove-Item -Path $homePath -Recurse -ErrorAction SilentlyContinue 589 | } 590 | catch { 591 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 592 | } 593 | 594 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 595 | } 596 | 597 | UnpinExplorer 598 | 599 | # Block Microsoft Edge telemetry 600 | Function EdgePrivacySettings { 601 | Write-Host "Adjusting Microsoft Edge privacy settings..." -NoNewline 602 | 603 | $EdgePrivacyCUPath = "HKCU:\Software\Policies\Microsoft\Edge" 604 | $EdgePrivacyAUPath = "HKLM:\SOFTWARE\Policies\Microsoft\Edge" 605 | 606 | $EdgePrivacyKeys = @( 607 | "PaymentMethodQueryEnabled", 608 | "PersonalizationReportingEnabled", 609 | "AddressBarMicrosoftSearchInBingProviderEnabled", 610 | "UserFeedbackAllowed", 611 | "AutofillCreditCardEnabled", 612 | "AutofillAddressEnabled", 613 | "LocalProvidersEnabled", 614 | "SearchSuggestEnabled", 615 | "EdgeShoppingAssistantEnabled", 616 | "WebWidgetAllowed", 617 | "HubsSidebarEnabled" 618 | ) 619 | 620 | $EdgePrivacyKeys | ForEach-Object { 621 | if (-not (Test-Path $EdgePrivacyCUPath)) { 622 | New-Item -Path $EdgePrivacyCUPath -Force *>$null 623 | } 624 | try { 625 | Set-ItemProperty -Path $EdgePrivacyCUPath -Name $_ -Value 0 626 | Set-ItemProperty -Path $EdgePrivacyCUPath -Name "ConfigureDoNotTrack" -Value 1 627 | } 628 | catch { 629 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 630 | } 631 | } 632 | 633 | $EdgePrivacyAUKeys = @( 634 | "DoNotTrack", 635 | "QuicAllowed", 636 | "SearchSuggestEnabled", 637 | "AllowSearchAssistant", 638 | "FormFillEnabled", 639 | "PaymentMethodQueryEnabled", 640 | "PersonalizationReportingEnabled", 641 | "AddressBarMicrosoftSearchInBingProviderEnabled", 642 | "UserFeedbackAllowed", 643 | "AutofillCreditCardEnabled", 644 | "AutofillAddressEnabled", 645 | "LocalProvidersEnabled", 646 | "SearchSuggestEnabled", 647 | "EdgeShoppingAssistantEnabled", 648 | "WebWidgetAllowed", 649 | "HubsSidebarEnabled" 650 | ) 651 | 652 | $EdgePrivacyAUKeys | ForEach-Object { 653 | if (-not (Test-Path $EdgePrivacyAUPath)) { 654 | New-Item -Path $EdgePrivacyAUPath -Force *>$null 655 | } 656 | try { 657 | Set-ItemProperty -Path $EdgePrivacyAUPath -Name $_ -Value 0 658 | Set-ItemProperty -Path $EdgePrivacyAUPath -Name "ConfigureDoNotTrack" -Value 1 659 | } 660 | catch { 661 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 662 | } 663 | } 664 | 665 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 666 | } 667 | 668 | EdgePrivacySettings 669 | 670 | Function OfficePrivacySettings { 671 | Write-Host "Adjusting Microsoft Office privacy settings..." -NoNewline 672 | $OfficePrivacyRegistryKeys = @{ 673 | "HKCU:\Software\Microsoft\Office\Common\ClientTelemetry" = @{ 674 | "DisableTelemetry" = 1 675 | } 676 | "HKCU:\Software\Policies\Microsoft\Office\Common\ClientTelemetry" = @{ 677 | "SendTelemetry" = 3 678 | } 679 | "HKCU:\Software\Policies\Microsoft\Office\16.0\Common" = @{ 680 | "QMEnable" = 0; 681 | "LinkedIn" = 0 682 | } 683 | "HKCU:\Software\Microsoft\Office\16.0\Common\MailSettings" = @{ 684 | "InlineTextPrediction" = 0 685 | } 686 | "HKCU:\Software\Policies\Microsoft\Office\16.0\osm" = @{ 687 | "Enablelogging" = 0; 688 | "EnableUpload" = 0; 689 | "EnableFileObfuscation" = 1 690 | } 691 | "HKCU:\Software\Policies\Microsoft\Office\16.0\Common\Feedback" = @{ 692 | "SurveyEnabled" = 0; 693 | "Enabled" = 0; 694 | "IncludeEmail" = 0 695 | } 696 | } 697 | 698 | foreach ($key in $OfficePrivacyRegistryKeys.GetEnumerator()) { 699 | $registryPath = $key.Key 700 | $registryValues = $key.Value 701 | 702 | if (-not (Test-Path $registryPath)) { 703 | New-Item -Path $registryPath -Force *>$null 704 | } 705 | 706 | foreach ($valueName in $registryValues.GetEnumerator()) { 707 | $value = $valueName.Key 708 | $data = $valueName.Value 709 | 710 | try { 711 | Set-ItemProperty -Path $registryPath -Name $value -Value $data 712 | } 713 | catch { 714 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 715 | } 716 | } 717 | } 718 | 719 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 720 | } 721 | 722 | OfficePrivacySettings 723 | 724 | Function DisableWindowsSync { 725 | Write-Host "Disabling Windows Sync..." -NoNewline 726 | $WindowsSyncRegistryKeys = @{ 727 | "HKCU:\Software\Microsoft\Windows\CurrentVersion\SettingSync" = @{ 728 | "SyncPolicy" = 5 729 | } 730 | "HKCU:\Software\Microsoft\Windows\CurrentVersion\SettingSync\Groups\Personalization" = @{ 731 | "Enabled" = 0 732 | } 733 | "HKCU:\Software\Microsoft\Windows\CurrentVersion\SettingSync\Groups\BrowserSettings" = @{ 734 | "Enabled" = 0 735 | } 736 | "HKCU:\Software\Microsoft\Windows\CurrentVersion\SettingSync\Groups\Credentials" = @{ 737 | "Enabled" = 0 738 | } 739 | "HKCU:\Software\Microsoft\Windows\CurrentVersion\SettingSync\Groups\Language" = @{ 740 | "Enabled" = 0 741 | } 742 | "HKCU:\Software\Microsoft\Windows\CurrentVersion\SettingSync\Groups\Accessibility" = @{ 743 | "Enabled" = 0 744 | } 745 | "HKCU:\Software\Microsoft\Windows\CurrentVersion\SettingSync\Groups\Windows" = @{ 746 | "Enabled" = 0 747 | } 748 | } 749 | 750 | foreach ($key in $WindowsSyncRegistryKeys.GetEnumerator()) { 751 | $registryPath = $key.Key 752 | $registryValues = $key.Value 753 | 754 | if (-not (Test-Path $registryPath)) { 755 | New-Item -Path $registryPath -Force *>$null 756 | } 757 | 758 | foreach ($valueName in $registryValues.GetEnumerator()) { 759 | $value = $valueName.Key 760 | $data = $valueName.Value 761 | 762 | try { 763 | Set-ItemProperty -Path $registryPath -Name $value -Value $data 764 | } 765 | catch { 766 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 767 | } 768 | } 769 | } 770 | 771 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 772 | } 773 | 774 | DisableWindowsSync 775 | 776 | # The function is here because programs add themselves to the right click menu after loading 777 | Function RightClickMenu { 778 | try { 779 | Write-Host "Editing the right click menu..." -NoNewline 780 | # New PS Drives 781 | New-PSDrive -Name "HKCR" -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" | Out-Null 782 | 783 | # Old right click menu 784 | $regPath = "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" 785 | reg.exe add $regPath /f /ve *>$null 786 | 787 | $contextMenuPaths = @( 788 | "HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\SendTo", #remove send to 789 | "HKEY_CLASSES_ROOT\UserLibraryFolder\shellex\ContextMenuHandlers\SendTo", #remove send to 790 | "HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\ModernSharing", #remove share 791 | "HKEY_CLASSES_ROOT\*\shell\pintohomefile", #remove favorites 792 | #remove give access 793 | "HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Sharing", 794 | "HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\Sharing", 795 | "HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\Sharing", 796 | "HKEY_CLASSES_ROOT\Drive\shellex\ContextMenuHandlers\Sharing", 797 | "HKEY_CLASSES_ROOT\LibraryFolder\background\shellex\ContextMenuHandlers\Sharing", 798 | "HKEY_CLASSES_ROOT\UserLibraryFolder\shellex\ContextMenuHandlers\Sharing", 799 | #remove previous 800 | "HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}", 801 | "HKEY_CLASSES_ROOT\CLSID\{450D8FBA-AD25-11D0-98A8-0800361B1103}\shellex\ContextMenuHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}", 802 | "HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}", 803 | "HKEY_CLASSES_ROOT\Drive\shellex\ContextMenuHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}", 804 | #remove "Include in library" 805 | "HKEY_CLASSES_ROOT\Folder\ShellEx\ContextMenuHandlers\Library Location", 806 | "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\ShellEx\ContextMenuHandlers\Library Location" 807 | #remove "copy as path" 808 | "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AllFilesystemObjects\shellex\ContextMenuHandlers\CopyAsPathMenu" 809 | #remove git 810 | "HKEY_CLASSES_ROOT\Directory\Background\shell\git_gui", 811 | "HKEY_CLASSES_ROOT\Directory\Background\shell\git_shell", 812 | #remove treesize 813 | "HKEY_CLASSES_ROOT\Directory\Background\shell\TreeSize Free", 814 | "HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode" 815 | #remove mpc player 816 | "HKEY_CLASSES_ROOT\Directory\shell\mplayerc64.enqueue" 817 | #remove sharex 818 | "HKEY_CLASSES_ROOT\Directory\shell\ShareX" 819 | #remove vlc 820 | "HKEY_CLASSES_ROOT\Directory\shell\AddToPlaylistVLC" 821 | #remove google drive 822 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gcsedoc" 823 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gcsesheet" 824 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gcseslides" 825 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gdoc" 826 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gdraw" 827 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gdrive" 828 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gform" 829 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gjam" 830 | "HKEY_CLASSES_ROOT\GoogleDriveFS.glink" 831 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gmaillayout" 832 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gmap" 833 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gnote" 834 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gscript" 835 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gsheet" 836 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gsite" 837 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gslides" 838 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gtable" 839 | "HKEY_CLASSES_ROOT\GoogleDriveFS.gvid" 840 | ) 841 | 842 | foreach ($path in $contextMenuPaths) { 843 | $regPath = $path -replace 'HKCR:\\', 'HKEY_CLASSES_ROOT\' 844 | $cmd = "reg delete `"$regPath`" /f" 845 | Invoke-Expression $cmd *>$null 846 | } 847 | 848 | # New hash menu for right click 849 | $regpath = "HKEY_CLASSES_ROOT\*\shell\hash" 850 | $sha256menu = "HKEY_CLASSES_ROOT\*\shell\hash\shell\02menu" 851 | $md5menu = "HKEY_CLASSES_ROOT\*\shell\hash\shell\03menu" 852 | 853 | reg add $regpath /f *>$null 854 | reg add $regpath /v "MUIVerb" /t REG_SZ /d HASH /f *>$null 855 | reg add $regpath /v "SubCommands" /t REG_SZ /d """" /f *>$null 856 | reg add "$regpath\shell" /f *>$null 857 | 858 | reg add "$sha256menu" /f *>$null 859 | reg add "$sha256menu\command" /f *>$null 860 | reg add "$sha256menu" /v "MUIVerb" /t REG_SZ /d SHA256 /f *>$null 861 | 862 | $tempOut = [System.IO.Path]::GetTempFileName() 863 | $tempErr = [System.IO.Path]::GetTempFileName() 864 | Start-Process cmd.exe -ArgumentList '/c', 'reg add "HKEY_CLASSES_ROOT\*\shell\hash\shell\02menu\command" /ve /d "powershell -noexit get-filehash -literalpath \"%1\" -algorithm SHA256 | format-list" /f' -NoNewWindow -RedirectStandardOutput $tempOut -RedirectStandardError $tempErr 865 | Remove-Item $tempOut -ErrorAction Ignore 866 | Remove-Item $tempErr -ErrorAction Ignore 867 | 868 | reg add "$md5menu" /f *>$null 869 | reg add "$md5menu\command" /f *>$null 870 | reg add "$md5menu" /v "MUIVerb" /t REG_SZ /d MD5 /f *>$null 871 | 872 | $tempOut = [System.IO.Path]::GetTempFileName() 873 | $tempErr = [System.IO.Path]::GetTempFileName() 874 | Start-Process cmd.exe -ArgumentList '/c', 'reg add "HKEY_CLASSES_ROOT\*\shell\hash\shell\03menu\command" /ve /d "powershell -noexit get-filehash -literalpath \"%1\" -algorithm MD5 | format-list" /f' -NoNewWindow -RedirectStandardOutput $tempOut -RedirectStandardError $tempErr 875 | Remove-Item $tempOut -ErrorAction Ignore 876 | Remove-Item $tempErr -ErrorAction Ignore 877 | 878 | # Add Turn Off Display Menu 879 | curl -o "$env:USERPROFILE\Desktop\turn_off_button.reg" https://raw.githubusercontent.com/caglaryalcin/old-right-click/refs/heads/main/turn_off_button.reg 880 | reg import "$env:USERPROFILE\Desktop\turn_off_button.reg" 881 | Remove-Item "$env:USERPROFILE\Desktop\turn_off_button.reg" -Recurse -ErrorAction Stop 882 | 883 | # Add "Find Empty Folders" 884 | $paths = @( 885 | "Registry::HKEY_CLASSES_ROOT\Directory\shell\FindEmptyFolders", 886 | "Registry::HKEY_CLASSES_ROOT\Directory\shell\FindEmptyFolders\command", 887 | "Registry::HKEY_CLASSES_ROOT\Directory\Background\shell\FindEmptyFolders", 888 | "Registry::HKEY_CLASSES_ROOT\Directory\Background\shell\FindEmptyFolders\command", 889 | "Registry::HKEY_CLASSES_ROOT\Drive\shell\FindEmptyFolders", 890 | "Registry::HKEY_CLASSES_ROOT\Drive\shell\FindEmptyFolders\command" 891 | ) 892 | 893 | $icon = "imageres.dll,-1025" 894 | $defaultValue = "Find Empty Folders" 895 | $command = 'powershell.exe -NoExit -Command "Get-ChildItem -Path ''%V'' -Directory -Recurse | Where-Object { $_.GetFileSystemInfos().Count -eq 0 } | ForEach-Object { $_.FullName }"' 896 | 897 | $paths | ForEach-Object { 898 | if (-not (Test-Path $_)) { 899 | New-Item -Path $_ -Force | Out-Null 900 | } 901 | 902 | if ($_ -like '*command') { 903 | Set-ItemProperty -Path $_ -Name "(Default)" -Value $command 904 | } 905 | else { 906 | Set-ItemProperty -Path $_ -Name "(Default)" -Value $defaultValue 907 | Set-ItemProperty -Path $_ -Name "Icon" -Value $icon 908 | } 909 | } 910 | 911 | # Add blocked keys 912 | $blockedkeyPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" 913 | if (-not (Test-Path -Path $blockedkeyPath)) { 914 | New-Item -Path $blockedkeyPath -Force | Out-Null 915 | } 916 | else { 917 | ## 918 | } 919 | 920 | # Add to "Boot to UEFI Firmware Settings" 921 | New-Item -Path "HKCR:\DesktopBackground\Shell\Firmware" -Force | Out-Null 922 | Set-ItemProperty -Path "HKCR:\DesktopBackground\Shell\Firmware" -Name "Icon" -Value "bootux.dll,-1016" 923 | Set-ItemProperty -Path "HKCR:\DesktopBackground\Shell\Firmware" -Name "MUIVerb" -Value "Boot to UEFI Firmware Settings" 924 | Set-ItemProperty -Path "HKCR:\DesktopBackground\Shell\Firmware" -Name "Position" -Value "Top" 925 | 926 | New-Item -Path "HKCR:\DesktopBackground\Shell\Firmware\command" -Force | Out-Null 927 | Set-ItemProperty -Path "HKCR:\DesktopBackground\Shell\Firmware\command" -Name "(default)" -Value 'powershell.exe -WindowStyle Hidden -Command "Start-Process cmd -ArgumentList ''/s,/c,shutdown /r /fw'' -Verb RunAs"' 928 | 929 | # Remove "Edit in Notepad" 930 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{CA6CC9F1-867A-481E-951E-A28C5E4F01EA}" -Value "Edit in Notepad" 931 | 932 | # Remove "Cast to Device" 933 | Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked" -Name "{7AD84985-87B4-4a16-BE58-8B72A5B390F7}" -Value "Play to Menu" 934 | 935 | # Restart Windows Explorer 936 | taskkill /f /im explorer.exe *>$null 937 | Start-Sleep 1 938 | Start-Process "explorer.exe" -ErrorAction Stop 939 | 940 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 941 | } 942 | 943 | catch { 944 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 945 | } 946 | } 947 | 948 | RightClickMenu 949 | 950 | Function DisableWidgets { 951 | Write-Host "Disabling Windows Widgets..." -NoNewline 952 | try { 953 | Get-AppxPackage -AllUsers -Name *WebExperience* | Remove-AppxPackage -AllUsers *>$null 954 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 955 | } 956 | catch { 957 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 958 | } 959 | 960 | } 961 | 962 | DisableWidgets 963 | 964 | # Remove Tasks in Task Scheduler 965 | Function RemoveTasks { 966 | $description = @" 967 | +---------------------------------------------+ 968 | | If you apply it, | 969 | | it turns off windows automatic updates, | 970 | | you can only update manually. | 971 | +---------------------------------------------+ 972 | "@ 973 | Write-Host `n$description -ForegroundColor Yellow 974 | 975 | Write-Host `n"Do you want " -NoNewline 976 | Write-Host "apps and Windows update tasks to be deleted?" -ForegroundColor Yellow -NoNewline 977 | Write-Host "(y/n): " -ForegroundColor Green -NoNewline 978 | 979 | $response = Read-Host 980 | 981 | if ($response -eq 'y' -or $response -eq 'Y') { 982 | Write-Host "Removing Unnecessary Tasks..." -NoNewline 983 | $taskPatterns = @("OneDrive*", "MicrosoftEdge*", "Google*", "Brave*", "Intel*", "klcp*", "MSI*", 984 | "*Adobe*", "CCleaner*", "G2M*", "Opera*", "Overwolf*", "User*", "CreateExplorer*", "{*", "*Samsung*", "*npcap*", 985 | "*Consolidator*", "*Dropbox*", "*Heimdal*", "*klcp*", "*UsbCeip*", "*DmClient*", "*Office Auto*", "*Office Feature*", 986 | "*OfficeTelemetry*", "*GPU*", "Xbl*", "Firefox Back*") 987 | 988 | $windowsUpdateTasks = @( 989 | "\Microsoft\Windows\WindowsUpdate\Scheduled Start", 990 | "\Microsoft\Windows\UpdateOrchestrator\Schedule Scan", 991 | "\Microsoft\Windows\UpdateOrchestrator\Schedule Scan Static Task", 992 | "\Microsoft\Windows\UpdateOrchestrator\Schedule Work", 993 | "\Microsoft\Windows\UpdateOrchestrator\Report policies", 994 | "\Microsoft\Windows\UpdateOrchestrator\UpdateModelTask", 995 | "\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker", 996 | "\Microsoft\Windows\WaaSMedic\PerformRemediation" 997 | ) 998 | 999 | $allTasks = Get-ScheduledTask 1000 | 1001 | foreach ($task in $allTasks) { 1002 | $taskName = $task.TaskName 1003 | $remove = $false 1004 | 1005 | foreach ($pattern in $taskPatterns) { 1006 | if ($taskName -like $pattern) { 1007 | $remove = $true 1008 | break 1009 | } 1010 | } 1011 | 1012 | if ($windowsUpdateTasks -contains $task.TaskPath + $taskName) { 1013 | $remove = $true 1014 | } 1015 | 1016 | if ($remove) { 1017 | try { 1018 | Unregister-ScheduledTask -TaskName $taskName -Confirm:$false -ErrorAction Stop 1019 | } 1020 | catch { 1021 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 1022 | } 1023 | } 1024 | } 1025 | 1026 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 1027 | 1028 | } 1029 | elseif ($response -eq 'n' -or $response -eq 'N') { 1030 | Write-Host "[Unused tasks will not be deleted.]" -ForegroundColor Red -BackgroundColor Black 1031 | } 1032 | else { 1033 | Write-Host "Invalid input. Please enter 'y' for yes or 'n' for no." 1034 | RemoveTasks 1035 | } 1036 | } 1037 | 1038 | RemoveTasks 1039 | 1040 | # Disable Copilot 1041 | Function DisableCopilot { 1042 | Write-Host `n"Do you want " -NoNewline 1043 | Write-Host "to disable Microsoft Copilot?" -ForegroundColor Yellow -NoNewline 1044 | Write-Host "(y/n): " -ForegroundColor Green -NoNewline 1045 | $response = Read-Host 1046 | 1047 | if ($response -eq 'y' -or $response -eq 'Y') { 1048 | Write-Host "Disabling Microsoft Copilot..." -NoNewline 1049 | 1050 | $registryPath = "HKCU:\Software\Policies\Microsoft\Windows" 1051 | $registryName = "WindowsCopilot" 1052 | $registryProperty = "TurnOffWindowsCopilot" 1053 | $edgeRegistryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Edge" 1054 | $explorerRegistryPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" 1055 | 1056 | if (-not (Test-Path $registryPath)) { 1057 | New-Item -Path $registryPath -Name $registryName -Force *>$null 1058 | } 1059 | 1060 | New-ItemProperty -Path $registryPath\$registryName -Name $registryProperty -Value 1 -PropertyType DWORD -Force *>$null 1061 | 1062 | if (-not (Test-Path $edgeRegistryPath)) { 1063 | New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\" -Name "Edge" -Force *>$null 1064 | } 1065 | 1066 | New-ItemProperty -Path $edgeRegistryPath -Name "HubsSidebarEnabled" -Value 0 -PropertyType DWORD -Force *>$null 1067 | 1068 | # Remove Copilot button from File Explorer 1069 | Set-ItemProperty -Path $explorerRegistryPath -Name "ShowCopilotButton" -Value 0 -Force *>$null 1070 | 1071 | $lmRegistryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows" 1072 | $wowRegistryPath = "HKLM:\SOFTWARE\WOW6432Node\Policies\Microsoft\Windows" 1073 | 1074 | if (-not (Test-Path $lmRegistryPath\$registryName)) { 1075 | New-Item -Path $lmRegistryPath -Name $registryName -Force *>$null 1076 | } 1077 | 1078 | Set-ItemProperty -Path $lmRegistryPath\$registryName -Name $registryProperty -Value 1 -Force *>$null 1079 | 1080 | if (-not (Test-Path $wowRegistryPath\$registryName)) { 1081 | New-Item -Path $wowRegistryPath -Name $registryName -Force *>$null 1082 | } 1083 | 1084 | Set-ItemProperty -Path $wowRegistryPath\$registryName -Name $registryProperty -Value 1 -Force *>$null 1085 | 1086 | $currentSID = [System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value 1087 | New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS | Out-Null 1088 | If (-not (Test-Path "HKU:\$currentSID\Software\Policies\Microsoft\Windows\WindowsCopilot")) { 1089 | New-Item -Path "HKU:\$currentSID\Software\Policies\Microsoft\Windows" -Name "WindowsCopilot" -Force *>$null 1090 | } 1091 | Set-ItemProperty -Path "HKU:\$currentSID\Software\Policies\Microsoft\Windows\WindowsCopilot" -Name "TurnOffWindowsCopilot" -Value 1 1092 | 1093 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 1094 | } 1095 | elseif ($response -eq 'n' -or $response -eq 'N') { 1096 | Write-Host "[Copilot will not be disabled]" -ForegroundColor Red -BackgroundColor Black 1097 | } 1098 | else { 1099 | Write-Host "Invalid input. Please enter 'y' for yes or 'n' for no." 1100 | DisableCopilot 1101 | } 1102 | } 1103 | 1104 | DisableCopilot 1105 | 1106 | # Uninstall OneDrive 1107 | Function UninstallOneDrive { 1108 | Write-Host `n"Do you want " -NoNewline 1109 | Write-Host "uninstall Microsoft OneDrive?" -ForegroundColor Yellow -NoNewline 1110 | Write-Host "(y/n): " -ForegroundColor Green -NoNewline 1111 | $response = Read-Host 1112 | if ($response -eq 'y' -or $response -eq 'Y') { 1113 | Write-Host "Removing Microsoft OneDrive..." -NoNewline 1114 | Silent #silently 1115 | try { 1116 | # Stop OneDrive and Explorer processes 1117 | taskkill /f /im OneDrive.exe *>$null 1118 | 1119 | # Uninstall OneDrive 1120 | $OneDriveSetupPaths = @( 1121 | "$env:systemroot\System32\OneDriveSetup.exe", 1122 | "$env:systemroot\SysWOW64\OneDriveSetup.exe" 1123 | ) 1124 | 1125 | foreach ($Path in $OneDriveSetupPaths) { 1126 | if (Test-Path $Path) { 1127 | & $Path /uninstall 1128 | } 1129 | } 1130 | 1131 | $OneDriveFolders = @( 1132 | "$env:localappdata\Microsoft\OneDrive", 1133 | "$env:programdata\Microsoft OneDrive", 1134 | "$env:systemdrive\OneDriveTemp", 1135 | "$env:userprofile\OneDrive" 1136 | ) 1137 | 1138 | $OneDriveFolders | ForEach-Object { 1139 | Remove-Item -Path $_ -Recurse -Force -ErrorAction SilentlyContinue 1140 | } 1141 | 1142 | New-PSDrive -Name "HKCR" -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" | Out-Null 1143 | $OneDriveClsid = "{018D5C66-4533-4307-9B53-224DE2ED1FE6}" 1144 | $ClsidPaths = @( 1145 | "HKCR:\CLSID\$OneDriveClsid", 1146 | "HKCR:\Wow6432Node\CLSID\$OneDriveClsid" 1147 | ) 1148 | 1149 | foreach ($Path in $ClsidPaths) { 1150 | if (-not (Test-Path $Path)) { 1151 | New-Item -Path $Path -Force | Out-Null 1152 | Set-ItemProperty -Path $Path -Name "System.IsPinnedToNameSpaceTree" -Value 0 1153 | } 1154 | } 1155 | 1156 | If (Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive") { 1157 | New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Recurse -Force -ErrorAction SilentlyContinue 1158 | } 1159 | 1160 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Value 1 -Force -ErrorAction SilentlyContinue 1161 | 1162 | # Remove OneDrive from the registry 1163 | reg load "HKU\Default" "C:\Users\Default\NTUSER.DAT" *>$null 1164 | reg delete "HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f *>$null 1165 | reg unload "HKU\Default" *>$null 1166 | 1167 | Remove-Item -Path "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" -Force -ErrorAction SilentlyContinue 1168 | 1169 | Start-Sleep 3 1170 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 1171 | 1172 | } 1173 | catch { 1174 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 1175 | } 1176 | 1177 | } 1178 | elseif ($response -eq 'n' -or $response -eq 'N') { 1179 | Write-Host "[Windows OneDrive will not be deleted]" -ForegroundColor Red -BackgroundColor Black 1180 | } 1181 | else { 1182 | Write-Host "Invalid input. Please enter 'y' for yes or 'n' for no." 1183 | UninstallOneDrive 1184 | } 1185 | } 1186 | 1187 | UninstallOneDrive 1188 | 1189 | # Disable Edge desktop shortcut creation after certain Windows updates are applied 1190 | Function UninstallEdge { 1191 | Write-Host `n"Do you want " -NoNewline 1192 | Write-Host "uninstall Microsoft Edge?" -ForegroundColor Yellow -NoNewline 1193 | Write-Host "(y/n): " -ForegroundColor Green -NoNewline 1194 | $response = Read-Host 1195 | if ($response -eq 'y' -or $response -eq 'Y') { 1196 | Write-Host "Removing Microsoft Edge..." -NoNewline 1197 | 1198 | try { 1199 | taskkill /f /im msedge.exe *>$null 2>&1 1200 | taskkill /f /im explorer.exe *>$null 2>&1 1201 | 1202 | # Remove Edge Services 1203 | $edgeservices = "edgeupdate", "edgeupdatem" 1204 | foreach ($service in $edgeservices) { 1205 | Stop-Service -Name $service -Force -ErrorAction SilentlyContinue 1206 | Set-Service -Name $service -Status stopped -StartupType disabled -ErrorAction SilentlyContinue 1207 | sc.exe delete $service *>$null 2>&1 1208 | } 1209 | 1210 | # Uninstall - Edge 1211 | $regView = [Microsoft.Win32.RegistryView]::Registry32 1212 | $microsoft = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, $regView).OpenSubKey('SOFTWARE\Microsoft', $true) 1213 | $edgeClient = $microsoft.OpenSubKey('EdgeUpdate\ClientState\{56EB18F8-B008-4CBD-B6D2-8C97FE7E9062}', $true) 1214 | if ($null -ne $edgeClient.GetValue('experiment_control_labels')) { 1215 | $edgeClient.DeleteValue('experiment_control_labels') 1216 | } 1217 | 1218 | $microsoft.CreateSubKey('EdgeUpdateDev').SetValue('AllowUninstall', '') 1219 | 1220 | $uninstallRegKey = $microsoft.OpenSubKey('Windows\CurrentVersion\Uninstall\Microsoft Edge') 1221 | $uninstallString = $uninstallRegKey.GetValue('UninstallString') + ' --force-uninstall' 1222 | Silent #silently 1223 | Start-Process cmd.exe "/c $uninstallString" -WindowStyle Hidden 1224 | 1225 | $appxStore = '\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore' 1226 | $pattern = "HKLM:$appxStore\InboxApplications\Microsoft.MicrosoftEdge_*_neutral__8wekyb3d8bbwe" 1227 | $key = (Get-Item -Path $pattern).PSChildName 1228 | reg delete "HKLM$appxStore\InboxApplications\$key" /f *>$null 1229 | 1230 | #if error use this > $SID = [System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value 1231 | $user = "$env:USERDOMAIN\$env:USERNAME" 1232 | (New-Object System.Security.Principal.NTAccount($user)).Translate([System.Security.Principal.SecurityIdentifier]).Value *>$null 1233 | New-Item -Path "HKLM:$appxStore\EndOfLife\$SID\Microsoft.MicrosoftEdge_8wekyb3d8bbwe" -Force *>$null 1234 | Get-AppxPackage -Name Microsoft.MicrosoftEdge | Remove-AppxPackage -ErrorAction SilentlyContinue 1235 | Remove-Item -Path "HKLM:$appxStore\EndOfLife\$SID\Microsoft.MicrosoftEdge_8wekyb3d8bbwe" -ErrorAction SilentlyContinue 1236 | 1237 | # Delete additional files 1238 | $additionalFilesPath = "C:\Windows\System32\MicrosoftEdgeCP.exe" 1239 | if (Test-Path -Path $additionalFilesPath) { 1240 | $additionalFiles = Get-ChildItem -Path "C:\Windows\System32\MicrosoftEdge*" -File 1241 | foreach ($file in $additionalFiles) { 1242 | $takeownArgs = "/f $($file.FullName)" 1243 | Start-Process -FilePath "takeown.exe" -ArgumentList $takeownArgs -Wait | Out-Null 1244 | $icaclsArgs = "`"$($file.FullName)`" /inheritance:e /grant `"$($env:UserName)`":(OI)(CI)F /T /C" 1245 | Start-Process -FilePath "icacls.exe" -ArgumentList $icaclsArgs -Wait | Out-Null 1246 | Remove-Item -Path $file.FullName -Force -ErrorAction SilentlyContinue 1247 | } 1248 | } 1249 | 1250 | $keyPath = "HKLM:\SOFTWARE\Microsoft\EdgeUpdate" 1251 | $propertyName = "DoNotUpdateToEdgeWithChromium" 1252 | if (-not (Test-Path $keyPath)) { 1253 | New-Item -Path $keyPath -Force | Out-Null 1254 | } 1255 | Set-ItemProperty -Path $keyPath -Name $propertyName -Value 1 -Type DWord -Force -ErrorAction SilentlyContinue 1256 | 1257 | taskkill /f /im "MicrosoftEdgeUpdate.exe" *>$null 1258 | 1259 | $edgeDirectories = Get-ChildItem -Path "C:\Program Files (x86)\Microsoft" -Filter "Edge*" -Directory -ErrorAction SilentlyContinue 1260 | if ($edgeDirectories) { 1261 | $edgeDirectories | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue 1262 | } 1263 | 1264 | $progressPreference = 'SilentlyContinue' 1265 | Get-AppxPackage -AllUsers Microsoft.Edge | Remove-AppxPackage -ErrorAction SilentlyContinue | Out-Null 1266 | 1267 | $paths = @( 1268 | "C:\Program Files (x86)\Microsoft\*edge*", 1269 | "C:\Program Files (x86)\Microsoft\Edge", 1270 | "C:\Program Files (x86)\Microsoft\Temp", 1271 | "C:\Program Files (x86)\Microsoft\*" 1272 | ) 1273 | 1274 | foreach ($path in $paths) { 1275 | $items = Get-ChildItem -Path $path -Recurse -ErrorAction SilentlyContinue 1276 | if ($items) { 1277 | Remove-Item -Path $path -Force -Recurse -ErrorAction SilentlyContinue *>$null 1278 | } 1279 | } 1280 | 1281 | # Final check if Edge is still installed 1282 | if (!(Get-Process "msedge" -ErrorAction SilentlyContinue)) { 1283 | Start-Process explorer.exe -NoNewWindow 1284 | Start-Sleep 4 1285 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 1286 | } 1287 | else { 1288 | throw "Microsoft Edge process is still running." 1289 | } 1290 | 1291 | # Delete the lnk files in the taskbar 1292 | $edgedesktop = "$env:USERPROFILE\Desktop\" 1293 | $taskBarPath = "$env:USERPROFILE\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" 1294 | $taskBarPath1 = "$env:USERPROFILE\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\" 1295 | $taskBarPath2 = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs" 1296 | $shortcuts = "Microsoft Edge.lnk", "Microsoft Teams classic.lnk" 1297 | 1298 | $shortcuts | ForEach-Object { 1299 | $fullPath1 = Join-Path $taskBarPath $_ 1300 | $fullPath2 = Join-Path $taskBarPath1 $_ 1301 | $fullPath3 = Join-Path $taskBarPath2 $_ 1302 | $desktoppath = Join-Path $edgedesktop $_ 1303 | 1304 | if (Test-Path $fullPath1) { 1305 | Remove-Item $fullPath1 -ErrorAction Stop 1306 | } 1307 | 1308 | if (Test-Path $fullPath2) { 1309 | Remove-Item $fullPath2 -ErrorAction Stop 1310 | } 1311 | 1312 | if (Test-Path $fullPath3) { 1313 | Remove-Item $fullPath3 -ErrorAction Stop 1314 | } 1315 | 1316 | if (Test-Path $desktoppath) { 1317 | Remove-Item $desktoppath -ErrorAction Stop 1318 | } 1319 | } 1320 | 1321 | # Remove Edge tasks 1322 | $tasks = Get-ScheduledTask | Where-Object { $_.TaskName -like "*edge*" } 1323 | 1324 | foreach ($task in $tasks) { 1325 | Unregister-ScheduledTask -TaskName $task.TaskName -Confirm:$false 1326 | } 1327 | 1328 | } 1329 | catch { 1330 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 1331 | } 1332 | 1333 | } 1334 | elseif ($response -eq 'n' -or $response -eq 'N') { 1335 | 1336 | # Disable Edge Services 1337 | $edgeservices = "edgeupdate", "edgeupdatem" 1338 | foreach ($service in $edgeservices) { 1339 | Stop-Service -Name $service -Force -ErrorAction SilentlyContinue 1340 | Set-Service -Name $service -Status stopped -StartupType disabled -ErrorAction SilentlyContinue 1341 | } 1342 | Write-Host "[Windows Edge will not be uninstalled]" -ForegroundColor Red -BackgroundColor Black 1343 | 1344 | } 1345 | else { 1346 | Write-Host "Invalid input. Please enter 'y' for yes or 'n' for no." 1347 | UninstallEdge 1348 | } 1349 | } 1350 | 1351 | UninstallEdge 1352 | 1353 | Function RemoveRecall { 1354 | Write-Host "Removing Windows 11 Recall..." -NoNewline 1355 | try { 1356 | Silent 1357 | DISM /Online /Disable-Feature /FeatureName:"Recall"​ *>$null 1358 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 1359 | } 1360 | catch { 1361 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 1362 | } 1363 | } 1364 | 1365 | RemoveRecall 1366 | 1367 | Function Removelnks { 1368 | Write-Host "Removing Desktop shortcuts..." -NoNewline 1369 | try { 1370 | Get-ChildItem C:\users\Public\Desktop\*.lnk | ForEach-Object { Remove-Item $_ -ErrorAction SilentlyContinue } *>$null 1371 | Get-ChildItem $env:USERPROFILE\Desktop\*.lnk | ForEach-Object { Remove-Item $_ -ErrorAction SilentlyContinue } *>$null 1372 | Get-ChildItem -Path "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp" -Force | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue 1373 | Write-Host "[DONE]" -ForegroundColor Green -BackgroundColor Black 1374 | } 1375 | catch { 1376 | Write-Host "[WARNING] $_" -ForegroundColor Red -BackgroundColor Black 1377 | } 1378 | } 1379 | 1380 | Removelnks 1381 | 1382 | } 1383 | elseif ($response -eq 'n' -or $response -eq 'N') { 1384 | Write-Host "[Unnecessary apps will not be uninstalled]" -ForegroundColor Red -BackgroundColor Black 1385 | } 1386 | else { 1387 | Write-Host "Invalid input. Please enter 'y' for yes or 'n' for no." 1388 | UnusedApps 1389 | } 1390 | } 1391 | 1392 | UnusedApps 1393 | 1394 | ########## 1395 | #endregion Remove Unused Apps/Softwares 1396 | ########## 1397 | 1398 | Function Restart { 1399 | Write-Host `n"Do you " -NoNewline 1400 | Write-Host "want restart?" -NoNewline -ForegroundColor Red -BackgroundColor Black 1401 | Write-Host "(y/n): " -NoNewline 1402 | $response = Read-Host 1403 | 1404 | if ($response -eq 'y' -or $response -eq 'Y') { 1405 | cmd.exe /c "shutdown /r /t 0" 1406 | } 1407 | elseif ($response -eq 'n' -or $response -eq 'N') { 1408 | Write-Host("[Restart process cancelled]") -ForegroundColor Red -BackgroundColor Black 1409 | } 1410 | else { 1411 | Write-Host "Invalid input. Please enter 'y' for yes or 'n' for no." 1412 | } 1413 | 1414 | } 1415 | 1416 | Restart --------------------------------------------------------------------------------