├── .gitattributes ├── .github ├── AFTER.PNG ├── BEFORE.PNG └── FUNDING.yml ├── LICENSE ├── README.md ├── gitattributes └── wor.ps1 /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto -------------------------------------------------------------------------------- /.github/AFTER.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gordonbay/Windows-On-Reins/ef35caeae8392b0f8e3300c80be671e577df348a/.github/AFTER.PNG -------------------------------------------------------------------------------- /.github/BEFORE.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gordonbay/Windows-On-Reins/ef35caeae8392b0f8e3300c80be671e577df348a/.github/BEFORE.PNG -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | patreon: WindowsOnReins 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) 2017 {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Windows Essentials Copyright (C) 2017 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Windows On Reins - Windows 10 Ameliorated, Bloatware removal, privacy fix and performance optimization 2 | [![made-with-powershell](https://img.shields.io/badge/PowerShell-1f425f?logo=Powershell)](https://microsoft.com/PowerShell) 3 | [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/SGHFtvx4bN) 4 | 5 | ## Warning 6 | I do not take responsibility for what may happen to your system. This is at your own risk. 7 | 8 | ## Before running WOR (stand by) 9 | ![](https://raw.githubusercontent.com/gordonbay/Windows-On-Reins/master/.github/BEFORE.PNG) 10 | 11 | ## After (stand by) 12 | ![](https://raw.githubusercontent.com/gordonbay/Windows-On-Reins/master/.github/AFTER.PNG) 13 | * The Wifi was turned on a few moments before taking the screenshot in both cases. 14 | 15 | ## What it does - Security 16 | 17 | - Harden the system to prevent Mimikatz credential scraping attack 18 | - Harden the system to prevent Airstrike domain account hash capture attack 19 | - Disable NetBIOS and Link-Local Multicast Name Resolution (LLMNR) protocol. Both imposes security risk for layer-4 name resolution spoofing attacks, ARP poisoning, KARMA attack and cache poisoning 20 | - Disable SMB Server, it's known for opening doors for mass ransomware attacks - WannaCry and NotPetya 21 | - Disable Anonymous enumeration of shares. Allowing anonymous logon users to list all account names and enumerate all shared resources can provide a map of potential points to attack the system (Stigviewer V-220930) 22 | - Disable Wi-Fi Sense, it connects you to open hotspots that are "greenlighted" through crowdsourcing. Openning doors to Lure10 MITM attack and phishing (Stigviewer V-220808) 23 | - Disable Remote Assistance (RA). RA may allow unauthorized parties access to the resources on the computer. (Stigviewer V-220823) 24 | - Disable Autoplay, "allowing autoplay to execute may introduce malicious code to a system" (Stigviewer V-63673) 25 | - Disable WPAD (Web Proxy Auto-Discovery Protocol), it exposes the system to MITM attack 26 | - Apply Google's DNS to all connections to prevent some types of MITM attacks and DNS spoofing 27 | 28 | ## What it does - Performance 29 | 30 | - Disable the Diagnostic Policy Service. To avoid some I/O operations to the file system and reduce system load 31 | - Disable Windows Malicious Software Removal Tool due to high disk usage 32 | - Disable NTFS encryption and compression due to processing overhead on filesystem operations 33 | - Disable of scheduled defragmentation due to lack of parameters and waste of disk cycles 34 | - Disable Windows Superfetch, due to high RAM usage and is known for causing slow boot times 35 | - Disable Windows Hibernation, there are some evidence that if you use HDD and not a SSD disabling it may lead to lower boot times 36 | - Disable Winmgmt service, Windows Management Instrumentation. This service transfer unusual amount of data, keeps windows updates silent running even if user had it opt-out 37 | - Allow user to disable Cortana 38 | - Disable SmartScreen Filter, due to huge performance impact, it checks online data about running programs 39 | - Disable BITS - Background Intelligent Transfer Service, UsoSvc - Update Orchestrator Service, DusmSvc - Data Usage, the all showed the same behavior, its aggressive bandwidth eating will interfere with you online gameplay, work and navigation. Its aggressive disk usable will reduce your HDD or SSD lifespan 40 | - Disable DoSvc (Delivery Optimization), it overrides the windows updates opt-out user option, turn your pc into a p2p peer for Windows updates, mining your network performance and compromises your online gameplay, work and navigation 41 | - Disable wlidsvc service, due to conflicts with some games 42 | - Disable Fax service 43 | - Disable Xbox Dvr, its may cause fps problems on some games 44 | - Disable Windows SgrmBroker - System Guard Runtime Monitor Broker, big name and big memory usage on some systems 45 | - Disable Windows SystemRestore, due to performance draw and never works when you need it 46 | - Disable Windows ShadowCopy, due to performance draw 47 | - Disable Windows Fast Boot, due conflicts with Steam and several other programs 48 | - Disable Adobe updates 49 | - Disable Nvidia NGX updates, due to high network usage and lack of settings 50 | - Apply Google's DNS to all connections to improve name resolution timing 51 | 52 | ## What it does - Quality of Life 53 | 54 | - Disable "Get tips and suggestion when i use Windows"; 55 | - Disable "Offer suggestions on hou i can set up my device"; 56 | - Disable Windows Ads within file explorer; 57 | - Allow users to definitively disable windows updates; 58 | - Allow users to definitively disable windows defender; 59 | - Installation of VC++ resources; 60 | - Allow users to clear all the bloatware that cames with Windows installation; 61 | - Disable Windows sound effects, and W11 startup sound; 62 | - Disable error reporting; 63 | - Enable dark mode; 64 | - Install Nvidia control panel, if you own a Nvidia card; 65 | - Dracula's dark mode for Notepad++; 66 | - Disable error reporting; 67 | - Disable Action Center ; 68 | - Disable People's Bar; 69 | - Show Computer shortcut on desktop; 70 | - Remove all pinned bloatware from your start menu; 71 | - Disable sticky keys prompt; 72 | - Disable Windows from asking your feedback; 73 | - Disable SecurityHealthService, due to anoying and non configurable popups; 74 | - Disable WpnService, push notification service; 75 | - Disable Razer Chroma SDK Server. Its night and you have that game with Razer SDK enabled running and messing up your keys; 76 | - Disable Windows Licence check; 77 | - Put "This PC" shortcut on desktop; 78 | - Disable XPS printing; 79 | - Disable Game Bar tips; 80 | - Disable Vmware Host Server, service uses port 80; 81 | - Firefox: disable recomendations and offers; 82 | - Firefox: enable autoplay audio and video; 83 | - Firefox: disable sponsor shortcut (Amazon, Trivago); 84 | 85 | ## Fingerprinting Prevention and privacy 86 | 87 | - Disable Diagtrack, Windows Diagnostics Tracking, design by Microsoft to spy on users and to intefere with your programs 88 | - Disable autoplay and autorun 89 | - Disable Windows Location Tracking and Wifi Sensor 90 | - Disable Windows lfsvc service, Geofence service, a cute name for a location tracking service 91 | - Disable NvTelemetryContainer, Nvidia telemetry agent 92 | - Disable Windows Media Player Network Sharing Service 93 | - Disable files last modification date, in most cases; 94 | - Disable Windows unique advertise ID; 95 | - Disable and clear ETL and perfomance logs; 96 | - Clears file thumbnails and allows user to complete disable it; 97 | - Clears minimized windows thumbnails and allows user to complete disable it; 98 | - Disable recent opened files history; 99 | - Disable Cortana web search; 100 | - Disable location tracking; 101 | - Disable recycle bin; 102 | - Enable DNS-over-HTTPS (DoH), both on Windows and Firefox, it encrypts the communication between the client and the resolver to prevent the inspection of domain names by network eavesdroppers; 103 | - Firefox: Enable Encrypted Client Hello (ECH), to prevent TLS from leaking any data by encrypting all messages; 104 | - Firefox: Disable telemetry, data collection and studies; 105 | - Firefox: Disable project fission and shield (both are some kind of data collector); 106 | 107 | ## Gaming 108 | 109 | - Disable Windows mouse acceleration (ideal for FPS games); 110 | - Disable VBS (Virtualization-based security), may have a significant performance boost, specially in games; 111 | - Ensure that Hardware Accelerated Scheduling is ON, in very rare cases it may reduce latency; 112 | - Disable Xbox related features, they are known for causing fps issues; 113 | 114 | 115 | Usage 116 | ============ 117 | 118 | 1) Run Power Shell as admin; 119 | 2) Type the following to enable PowerShell script execution: 120 | Set-ExecutionPolicy Unrestricted -Force 121 | 122 | 3) Confirm the question; 123 | 124 | 4) Run the script: 125 | %path-to-file%/wor.ps1 126 | 127 | or just right click the file wor.ps1 and select "Execute with powershell" 128 | 129 | Notes 130 | ============ 131 | 132 | - To prevent Windows to install bloatware, this script must be run before connecting to the internet for the first time; 133 | - Disabling Windows defender is unreversible and needs the system to be in safe mode; 134 | - Some NICs may show the preferred DNS encryption as "Unencrypted Only" after running the the fingerprinting prevention. Thats not true, the DNS is being handled over HTTPS (DoH) and there will be no traffic on port 53. Test using:: 135 | 136 | pktmon filter remove 137 | 138 | pktmon filter add -p 53 139 | 140 | start --etw -m real-time 141 | 142 | Recommended Filterlists 143 | ============ 144 | 145 | - https://raw.githubusercontent.com/DandelionSprout/adfilt/master/TwitchEvenMorePureViewingExperience.txt 146 | - https://raw.githubusercontent.com/DandelionSprout/adfilt/master/RedditTrashRemovalService.txt 147 | - https://raw.githubusercontent.com/taylr/linkedinsanity/master/linkedinsanity.txt 148 | 149 | 150 | Recommended Hosts filters 151 | ============ 152 | 153 | - https://github.com/MrRawes/firefox-hosts -------------------------------------------------------------------------------- /gitattributes: -------------------------------------------------------------------------------- 1 | * encoding=UTF-8 -------------------------------------------------------------------------------- /wor.ps1: -------------------------------------------------------------------------------- 1 | # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2 | # !! !! 3 | # !! SAFE TO EDIT VALUES !! 4 | # !! CONFIGURATION START !! 5 | # !! !! 6 | # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 7 | 8 | # Edit values (Option) to your Choice 9 | 10 | # Function = Option 11 | # List of Options 12 | 13 | $troubleshootInstalls = 0 14 | # 0 = Do nothing. *Recomended. 15 | # 1 = Enable essential stuff needed for some installations. 16 | # Note: Set to 1 if you are having trouble installing something on you pc. 17 | # Note: Known to fix these installations: windows language pack, Autodesk AutoCad and Appxs. 18 | # Note: Top priority configuration, overrides other settings. 19 | 20 | $beWifiSafe = 0 21 | # 0 = May disable services required to use Wifi. *Recomended. 22 | # 1 = Keep Wifi working 23 | # Note: Top priority configuration, overrides other settings. 24 | 25 | $beMicrophoneSafe = 0 26 | # 0 = Disable services required to use the microphone. *Recomended. 27 | # 1 = Keep microphone working 28 | # Note: Top priority configuration, overrides other settings. 29 | 30 | $beAppxSafe = 0 31 | # 0 = Disable resources needed for Appx programs, Windows Store and online MS Office features. *Recomended. 32 | # 1 = Will keep programs like Store and Microsoft Store working. Will Keep office online features working, like corporate login, power query, power bi workspace, "Open in app" option on sharepoint... 33 | # Note: Top priority configuration, overrides other settings. 34 | # Note: Will keep Windows updates active 35 | 36 | $beXboxSafe = 0 37 | # 0 = Disable Xbox and Windows Live Games related stuff like Game Bar. *Recomended. 38 | # 1 = Enable it. 39 | # Note: Top priority configuration, overrides other settings. 40 | 41 | $beBiometricSafe = 0 42 | # 0 = Disable biometric related stuff. *Recomended. 43 | # 1 = Enable it. 44 | # Note: Refers to lockscreen, fingerprint reader, illuminated IR sensor or other biometric sensors. 45 | # Note: Top priority configuration, overrides other settings. 46 | 47 | $beNetworkPrinterSafe = 0 48 | # 0 = Disable network printer. *Recomended. 49 | # 1 = Enable it. 50 | # Note: Top priority configuration, overrides other settings. 51 | 52 | $bePrinterSafe = 0 53 | # 0 = Disable local printer. *Recomended. 54 | # 1 = Enable it. 55 | # Note: Top priority configuration, overrides other settings. 56 | 57 | $beNetworkFolderSafe = 0 58 | # 0 = Disable network folders. *Recomended. 59 | # 1 = Enable it. 60 | # Note: Top priority configuration, overrides other settings. 61 | 62 | $beAeroPeekSafe = 0 63 | # 0 = Disable Windows Aero Peek. *Recomended. 64 | # 1 = Enable it to Windows defaults. 65 | # Note: Top priority configuration, overrides other settings. 66 | 67 | $beThumbnailSafe = 0 68 | # 0 = Disable Windows Thumbnails. *Recomended. 69 | # 1 = Enable it to Windows defaults. 70 | # Note: Refers to the use of thumbnails instead of icon to some files. 71 | # Note: Top priority configuration, overrides other settings. 72 | 73 | $beCastSafe = 0 74 | # 0 = Disable Casting. *Recomended. 75 | # 1 = Enable it. 76 | # Note: Refers to the Windows ability to Cast screen to another device and or monitor, PIP (Picture-in-picture), projecting to another device. 77 | # Note: Top priority configuration, overrides other settings. 78 | 79 | $beVpnPppoeSafe = 0 80 | # 0 = Will make the system safer against DNS cache poisoning but VPN or PPPOE conns may stop working. *Recomended. 81 | # 1 = This script will not mess with stuff required for VPN or PPPOE to work. 82 | # Note: Set it to 1 if you pretend to use VPN, PPP conns, if the system is inside a VM or having trouble with internet. 83 | 84 | $disableCortana = 1 85 | # 0 = Enable Cortana 86 | # 1 = Disable Cortana *Recomended 87 | 88 | $legacyRightClicksMenu = 1 89 | # 0 = Use Windows 11 right click menu 90 | # 1 = Use legacy right click menu *Recomended 91 | 92 | $disableStartupSound = 1 93 | # 0 = Keep Windows 11 startup sound 94 | # 1 = Disable Windows 11 startup sound *Recomended 95 | 96 | $useGoogleDNS = 1 97 | # 0 = Nothing 98 | # 1 = Apply Google DNS to connections *Recomended. 99 | 100 | $installNvidiaControlPanel = 1 101 | # 0 = Remove Nvidia Appx. 102 | # 1 = Install Nvidia control panel. *Recomended. 103 | # Note: The script will check if your GPU vendor is Nvidia 104 | # Note: Refers to the new Nvidia Appx. Nvidia driver install dont cames with control panel anymore. 105 | 106 | $darkTheme = 1 107 | # 0 = Use Windows and apps default light theme. 108 | # 1 = Enable dark theme. *Recomended. 109 | 110 | $disableWindowsFirewall = 1 111 | # 0 = Enable. 112 | # 1 = Disable. *Recomended. 113 | 114 | $disableWindowsUpdates = 1 115 | # 0 = Enable Windows Updates. 116 | # 1 = Disable Windows Updates. *Recomended. 117 | 118 | $disableTelemetry = 1 119 | # 0 = Enable Telemetry. 120 | # 1 = Disable Telemetry. *Recomended. 121 | # Note: Microsoft uses telemetry to periodically collect information about Windows systems. It is possible to acquire information as the computer hardware serial number, the connection records for external storage devices, and traces of executed processes. 122 | # Note: This tweak may cause Enterprise edition to stop receiving Windows updates. 123 | 124 | $disableSMBServer = 0 125 | # 0 = Enable SMB Server. 126 | # 1 = Disable it. *Recomended. 127 | # Note: SMB Server is used for file and printer sharing. 128 | 129 | $disablelastaccess = 0 130 | # 0 = Enable it. 131 | # 1 = Disable last file access date. *Recomended. 132 | 133 | $doQualityOfLifeStuff = 1 134 | # 0 = Reverse system settings to default. 135 | # 1 = Perform routines to increase quality of life. *Recomended. 136 | 137 | $doPerformanceStuff = 1 138 | # 0 = Reverse system settings to default. 139 | # 1 = Perform routines to increase system performance. *Recomended. 140 | 141 | $doPrivacyStuff = 1 142 | # 0 = Reverse system settings to default. 143 | # 1 = Perform routines to increase system privacy. *Recomended. 144 | 145 | $doSecurityStuff = 1 146 | # 0 = Reverse system settings to default. 147 | # 1 = Perform routines to increase system security. *Recomended. 148 | 149 | $doFingerprintPrevention = 1 150 | # 0 = Reverse system settings to default. 151 | # 1 = Perform routines to prevent fingerprints. *Recomended. 152 | 153 | $disableSystemRestore = 1 154 | # 0 = Enable system restore 155 | # 1 = Disable system restore. *Recomended. 156 | 157 | $disableNtfsEncryption = 1 158 | # 0 = Enable NTFS file encryption 159 | # 1 = Disable NTFS file encryption. *Recomended. 160 | # NTFS file encryption is the built-in encryption tool in Windows used to encrypt files and folders on NTFS drives to protect them from unwanted access 161 | # Disabling it can reduce the processing overhead of filesystem operations 162 | 163 | $disableNtfsCompression = 1 164 | # 0 = Enable NTFS file compression 165 | # 1 = Disable NTFS file compression. *Recomended. 166 | # Disabling it can increase performance 167 | 168 | $disableVBS = 1 169 | # 0 = Enable VBS 170 | # 1 = Disable VBS. *Recomended. 171 | # VBS (Virtualization-based security) prevent unsigned or questionable drivers and software from getting into memory 172 | # Disabling it may have a significant performance boost, specially in games 173 | 174 | #$powerPlan = '8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c' # (High performance) 175 | #$powerPlan = '381b4222-f694-41f0-9685-ff5bb260df2e' # (Balanced) 176 | #$powerPlan = 'a1841308-3541-4fab-bc81-f71556f20b4a' # (Power saver) 177 | $powerPlan = '8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c' # (High performance) 178 | 179 | $diskAcTimeout = 0 180 | $diskDcTimeout = 0 181 | $monitorAcTimeout = 10 182 | $monitorDcTimeout = 5 183 | $standbyAcTimeout = 0 184 | $standbyDcTimeout = 25 185 | $hybernateAcTimeout = 0 186 | $hybernateDcTimeout = 0 187 | 188 | $firefoxSettings = 1 189 | # 0 = Keep Firefox settings unchanged. 190 | # 1 = Apply pro Firefox settings. Disable update, cross-domain cookies... *Recomended. 191 | 192 | $firefoxCachePath = ""; 193 | # Leave it EMPTY or... 194 | # Define a custom folder for Firefox cache files. 195 | # Example: "E:\\FIREFOX_CACHE"; 196 | 197 | $remove3dObjFolder = 1 198 | # 0 = Keep 3d object folder. 199 | # 1 = Remove 3d object folder. *Recomended. 200 | 201 | $disableWindowsSounds = 1 202 | # 0 = Do nothing (it won't reenable it); 203 | # 1 = Disable Windows sound effects. *Recomended. 204 | # If you want to re-enable it, will have to do it manually 205 | 206 | $disablePerformanceMonitor = 1 207 | # 0 = Do nothing; 208 | # 1 = Disable Windows Performance Logs Monitor and clear all .etl caches. *Recomended. 209 | 210 | $unpinStartMenu = 1 211 | # 0 = Do nothing; 212 | # 1 = Unpin all apps from start menu. 213 | 214 | $unnistallWindowsDefender = 1 215 | # 0 = Do nothing (won't re-install it); 216 | # 1 = Unnistall Windows Defender, irreversible. Safe mode is required. 217 | 218 | $unnistallOneDrive = 1 219 | # 0 = Do nothing (won't re-install it); 220 | # 1 = Unnistall. 221 | 222 | $disableBloatware = 1 223 | # 0 = Install Windows Bloatware that are not commented in bloatwareList array. 224 | # 1 = Remove non commented bloatware in bloatwareList array. *Recomended. 225 | # Note: On bloatwareList comment the lines on Appxs that you want to keep/install. 226 | 227 | $bloatwareList = @( 228 | # Non commented lines will be uninstalled 229 | 230 | # Maybe userful AppX 231 | #"*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*" 232 | #"*Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe*" 233 | #"*Microsoft.MSPaint*" 234 | #"*Microsoft.MicrosoftStickyNotes*" 235 | #"*Microsoft.Windows.Photos*" 236 | #"*Microsoft.WindowsCalculator*" 237 | #"*Microsoft.WindowsStore*" 238 | #"*Microsoft.WindowsCamera*" 239 | "*Microsoft.BingWeather*" 240 | "MicrosoftTeams*" 241 | 242 | # Unnecessary AppX Apps 243 | "*Microsoft.DrawboardPDF*" 244 | "*E2A4F912-2574-4A75-9BB0-0D023378592B*" 245 | "*Microsoft.Appconnector*" 246 | "Microsoft.3dbuilder" 247 | "Microsoft.3dbuilder" 248 | "Microsoft.BingNews" 249 | "Microsoft.GetHelp" 250 | "Microsoft.Getstarted" 251 | "Microsoft.Messaging" 252 | "*Microsoft3DViewer*" 253 | "Microsoft.MicrosoftOfficeHub" 254 | "Microsoft.MicrosoftSolitaireCollection" 255 | "Microsoft.NetworkSpeedTest" 256 | "Microsoft.News" 257 | "Microsoft.Office.Lens" 258 | "Microsoft.Office.OneNote" 259 | "Microsoft.Office.Sway" 260 | "Microsoft.OneConnect" 261 | "Microsoft.People" 262 | "Microsoft.Print3D" 263 | "Microsoft.RemoteDesktop" 264 | "Microsoft.SkypeApp" 265 | "Microsoft.StorePurchaseApp" 266 | "Microsoft.Office.Todo.List" 267 | "Microsoft.Whiteboard" 268 | "Microsoft.WindowsAlarms" 269 | "microsoft.windowscommunicationsapps" 270 | "*Microsoft.WindowsFeedbackHub*" 271 | "Microsoft.WindowsMaps" 272 | "Microsoft.WindowsSoundRecorder" 273 | "Microsoft.ZuneMusic" 274 | "Microsoft.ZuneVideo" 275 | 276 | # Sponsored AppX 277 | "*DolbyLaboratories.DolbyAccess*" 278 | "*Microsoft.Asphalt8Airborne*" 279 | "*46928bounde.EclipseManager*" 280 | "*ActiproSoftwareLLC*" 281 | "*AdobeSystemsIncorporated.AdobePhotoshopExpress*" 282 | "*Duolingo-LearnLanguagesforFree*" 283 | "*PandoraMediaInc*" 284 | "*CandyCrush*" 285 | "*BubbleWitch3Saga*" 286 | "*Wunderlist*" 287 | "*Flipboard.Flipboard*" 288 | "*Twitter*" 289 | "*Facebook*" 290 | "*Spotify*" 291 | "*Minecraft*" 292 | "*Royal Revolt*" 293 | "*Sway*" 294 | "*Speed Test*" 295 | "*FarmHeroesSaga*" 296 | "Prime*" 297 | "*Clipchamp*" 298 | "*Disney*" 299 | "*Netflix*" 300 | "*Keeper*" 301 | "*Instagram*" 302 | "*Amazon*" 303 | "*Roblox*" 304 | "*AdobePhotoshop*" 305 | 306 | 307 | # Special Cases 308 | # Dont Touch 309 | if ($beXboxSafe -eq 0) { 310 | "Microsoft.XboxGamingOverlay" 311 | "Microsoft.Xbox.TCUI" 312 | "Microsoft.XboxApp" 313 | "Microsoft.XboxGameOverlay" 314 | "Microsoft.XboxIdentityProvider" 315 | "Microsoft.XboxSpeechToTextOverlay" 316 | 317 | } 318 | 319 | if ($beBiometricSafe -eq 0) { 320 | "*Microsoft.BioEnrollment*" 321 | "*Microsoft.CredDialogHost*" 322 | "*Microsoft.ECApp*" 323 | "*Microsoft.LockApp*" 324 | } 325 | 326 | if ($installNvidiaControlPanel -eq 0) { 327 | "*NVIDIACorp.NVIDIAControlPanel*" 328 | } 329 | 330 | if ($beCastSafe -eq 0) { 331 | "*Microsoft.PPIP*" 332 | } 333 | ) 334 | 335 | 336 | ########## 337 | # Configuration - End 338 | ########## 339 | #-------------------------------------------------------------------------- 340 | 341 | ########## 342 | # Global Functions - Start 343 | ########## 344 | 345 | $env:POWERSHELL_TELEMETRY_OPTOUT = 'yes'; 346 | $ErrorActionPreference = "SilentlyContinue" 347 | Set-ExecutionPolicy unrestricted 348 | New-PSDrive HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null 349 | Set-MpPreference -EnableControlledFolderAccess Enabled -ErrorAction SilentlyContinue | Out-Null 350 | 351 | Function hardenPath($path, $desc) { 352 | Write-Output ($desc) 353 | $object = "System" 354 | $permission = "Modify, ChangePermissions" 355 | 356 | $FileSystemRights = [System.Security.AccessControl.FileSystemRights]$permission 357 | $InheritanceFlag = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit" 358 | $PropagationFlag = [System.Security.AccessControl.PropagationFlags]"None" 359 | $AccessControlType =[System.Security.AccessControl.AccessControlType]::Allow 360 | $Account = New-Object System.Security.Principal.NTAccount($object) 361 | $FileSystemAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($Account, $FileSystemRights, $InheritanceFlag, $PropagationFlag, $AccessControlType) 362 | $DirectorySecurity = Get-ACL $path 363 | $DirectorySecurity.RemoveAccessRuleAll($FileSystemAccessRule) 364 | Set-ACL $path -AclObject $DirectorySecurity 365 | 366 | $Acl = Get-ACL $path 367 | $AccessRule= New-Object System.Security.AccessControl.FileSystemAccessRule("System","FullControl","ContainerInherit,Objectinherit","none","Deny") 368 | $Acl.AddAccessRule($AccessRule) 369 | Set-Acl $path $Acl 370 | } 371 | 372 | function takeownRegistry($key) { 373 | # TODO does not work for all root keys yet 374 | switch ($key.split('\')[0]) { 375 | "HKEY_CLASSES_ROOT" { 376 | $reg = [Microsoft.Win32.Registry]::ClassesRoot 377 | $key = $key.substring(18) 378 | } 379 | "HKEY_CURRENT_USER" { 380 | $reg = [Microsoft.Win32.Registry]::CurrentUser 381 | $key = $key.substring(18) 382 | } 383 | "HKEY_LOCAL_MACHINE" { 384 | $reg = [Microsoft.Win32.Registry]::LocalMachine 385 | $key = $key.substring(19) 386 | } 387 | } 388 | 389 | # get administraor group 390 | $admins = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544") 391 | $admins = $admins.Translate([System.Security.Principal.NTAccount]) 392 | 393 | # set owner 394 | $key = $reg.OpenSubKey($key, "ReadWriteSubTree", "TakeOwnership") 395 | $acl = $key.GetAccessControl() 396 | $acl.SetOwner($admins) 397 | $key.SetAccessControl($acl) 398 | 399 | # set FullControl 400 | $acl = $key.GetAccessControl() 401 | $rule = New-Object System.Security.AccessControl.RegistryAccessRule($admins, "FullControl", "Allow") 402 | $acl.SetAccessRule($rule) 403 | $key.SetAccessControl($acl) 404 | } 405 | 406 | Function regDelete($path, $desc) { 407 | Write-Output ($desc) 408 | 409 | If (Test-Path ("HKLM:\" + $path)) { 410 | Remove-ItemProperty -Path ("HKLM:\" + $path) -Recurse -Force 411 | } 412 | If (Test-Path ("HKCU:\" + $path)) { 413 | Remove-ItemProperty -Path ("HKCU:\" + $path) -Recurse -Force 414 | } 415 | } 416 | 417 | Function regDeleteKey($path, $key, $desc) { 418 | Write-Output ($desc) 419 | 420 | If (Test-Path ("HKLM:\" + $path)) { 421 | Remove-ItemProperty -Path ("HKLM:\" + $path) -Name $key 422 | } 423 | If (Test-Path ("HKCU:\" + $path)) { 424 | Remove-ItemProperty -Path ("HKCU:\" + $path) -Name $key 425 | } 426 | } 427 | 428 | Function deleteFile($path, $desc) { 429 | Write-Output ($desc) 430 | 431 | if (!($path | Test-Path)) { 432 | write-Host -ForegroundColor Green ($path + " dont exists.") 433 | return 434 | } 435 | 436 | takeown /F $path | out-null 437 | 438 | $Acl = Get-ACL $path 439 | $AccessRule= New-Object System.Security.AccessControl.FileSystemAccessRule("everyone","FullControl","ContainerInherit,Objectinherit","none","Allow") 440 | $Acl.AddAccessRule($AccessRule) 441 | Set-Acl $path $Acl 442 | 443 | $Acl = Get-ACL $path 444 | $username = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name 445 | $AccessRule= New-Object System.Security.AccessControl.FileSystemAccessRule($username,"FullControl","ContainerInherit,Objectinherit","none","Allow") 446 | $Acl.AddAccessRule($AccessRule) 447 | Set-Acl $path $Acl 448 | 449 | Set-ItemProperty $path -name IsReadOnly -value $false 450 | try { 451 | Remove-Item -Path $path -Recurse -Force -ErrorAction Stop; 452 | write-Host -ForegroundColor Green ($path + " deleted.") 453 | } 454 | catch { 455 | write-Host -ForegroundColor red ($path + " NOT deleted.") 456 | } 457 | } 458 | 459 | Function deletePath($path, $desc) { 460 | Write-Output ($desc) 461 | 462 | if (!($path | Test-Path)) { 463 | write-Host -ForegroundColor Green ($path + " dont exists.") 464 | return 465 | } 466 | 467 | takeown /F $path | out-null 468 | 469 | $Acl = Get-ACL $path 470 | $AccessRule= New-Object System.Security.AccessControl.FileSystemAccessRule("everyone","FullControl","ContainerInherit,Objectinherit","none","Allow") 471 | $Acl.AddAccessRule($AccessRule) 472 | Set-Acl $path $Acl 473 | 474 | $Acl = Get-ACL $path 475 | $username = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name 476 | $AccessRule= New-Object System.Security.AccessControl.FileSystemAccessRule($username,"FullControl","ContainerInherit,Objectinherit","none","Allow") 477 | $Acl.AddAccessRule($AccessRule) 478 | Set-Acl $path $Acl 479 | 480 | $files = Get-ChildItem $path 481 | foreach ($file in $files) { 482 | $Item = $path + "\" + $file.name 483 | 484 | takeown /F $Item | out-null 485 | 486 | $Acl = Get-ACL $Item 487 | $AccessRule= New-Object System.Security.AccessControl.FileSystemAccessRule("everyone","FullControl","Allow") 488 | $Acl.AddAccessRule($AccessRule) 489 | Set-Acl $Item $Acl 490 | 491 | $Acl = Get-ACL $Item 492 | $username = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name 493 | $AccessRule= New-Object System.Security.AccessControl.FileSystemAccessRule($username,"FullControl","Allow") 494 | $Acl.AddAccessRule($AccessRule) 495 | Set-Acl $Item $Acl 496 | 497 | $whatIs = (Get-Item $Item) -is [System.IO.DirectoryInfo] 498 | 499 | if ($whatIs -eq $False){ 500 | Set-ItemProperty $Item -name IsReadOnly -value $false 501 | try { 502 | Remove-Item -Path $Item -Recurse -Force -ErrorAction Stop; 503 | write-Host -ForegroundColor Green ($file.name + " deleted.") 504 | } 505 | catch { 506 | write-Host -ForegroundColor red ($file.name + " NOT deleted.") 507 | } 508 | } 509 | } 510 | } 511 | 512 | Function clearCaches { 513 | regDelete "SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\*" "Clearing network profiles..." 514 | regDelete "SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\Managed\*" "Clearing managed network profiles..." 515 | regDelete "SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\Unmanaged\*" "Clearing managed network profiles..." 516 | regDelete "SYSTEM\CurrentControlSet\Enum\USBSTOR\*" "Clearing USB history..." 517 | regDelete "SYSTEM\CurrentControlSet\Control\usbflags\*" "Clearing USB history..." 518 | regDelete "SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Nla\Cache\Intranet\*" "Clearing intranet history..." 519 | regDelete "Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU\*" "Clearing commands history..." 520 | regDelete "Software\Microsoft\Windows\CurrentVersion\Explorer\TypedPaths\*" "Clearing typed paths cache..." 521 | regDelete "Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\*" "Clearing recent docs cache..." 522 | regDelete "SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatCache\*" "Clearing compat cache..." 523 | regDelete "Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\*" "Clearing mapped drives cache..." 524 | 525 | Stop-Process -ProcessName explorer -Force 526 | Remove-Item $env:TEMP\*.* -confirm:$false -Recurse -Force 527 | Get-ChildItem $env:TEMP\*.* | Remove-Item -confirm:$false -Recurse -Force 528 | Remove-Item $env:WINDIR\Prefetch\*.* -confirm:$false -Recurse -Force 529 | Get-ChildItem $env:WINDIR\Prefetch\*.* | Remove-Item -confirm:$false -Recurse -Force 530 | Remove-Item $env:WINDIR\*.dmp -confirm:$false -Recurse -Force 531 | 532 | taskkill /F /IM explorer.exe 533 | Start-Sleep -Seconds 3 534 | 535 | deletePath "$env:LocalAppData\Microsoft\Windows\Explorer" "Clearing thumbs files cache..." 536 | deletePath "$env:LocalAppData\Microsoft\Windows\Recent" "Clearing recent folder cache..." 537 | deletePath "$env:LocalAppData\Microsoft\Windows\Recent\AutomaticDestinations" "Clearing automatic destinations folder cache..." 538 | deletePath "$env:LocalAppData\Microsoft\Windows\Recent\CustomDestinations" "Clearing custom destinations folder cache..." 539 | 540 | start explorer.exe 541 | } 542 | 543 | Function RegChange($path, $thing, $value, $desc, $type) { 544 | Write-Output ($desc) 545 | 546 | # String: Specifies a null-terminated string. Equivalent to REG_SZ. 547 | # ExpandString: Specifies a null-terminated string that contains unexpanded references to environment variables that are expanded when the value is retrieved. Equivalent to REG_EXPAND_SZ. 548 | # Binary: Specifies binary data in any form. Equivalent to REG_BINARY. 549 | # DWord: Specifies a 32-bit binary number. Equivalent to REG_DWORD. 550 | # MultiString: Specifies an array of null-terminated strings terminated by two null characters. Equivalent to REG_MULTI_SZ. 551 | # Qword: Specifies a 64-bit binary number. Equivalent to REG_QWORD. 552 | # Unknown: Indicates an unsupported registry data type, such as REG_RESOURCE_LIST. 553 | 554 | $type2 = "String" 555 | if (-not ([string]::IsNullOrEmpty($type))) 556 | { 557 | $type2 = $type 558 | } 559 | 560 | If (!(Test-Path ("HKLM:\" + $path))) { 561 | New-Item -Path ("HKLM:\" + $path) -Force | out-null 562 | } 563 | If (!(Test-Path ("HKCU:\" + $path))) { 564 | New-Item -Path ("HKCU:\" + $path) -Force | out-null 565 | } 566 | 567 | If (Test-Path ("HKLM:\" + $path)) { 568 | Set-ItemProperty ("HKLM:\" + $path) $thing -Value $value -Type $type2 -PassThru:$false | out-null 569 | } 570 | If (Test-Path ("HKCU:\" + $path)) { 571 | Set-ItemProperty ("HKCU:\" + $path) $thing -Value $value -Type $type2 -PassThru:$false | out-null 572 | } 573 | 574 | } 575 | 576 | #This will self elevate the script so with a UAC prompt since this script needs to be run as an Administrator in order to function properly. 577 | If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]'Administrator')) { 578 | Write-Host "You didn't run this script as an Administrator. This script will self elevate to run as an Administrator and continue." 579 | Start-Sleep 1 580 | Write-Host " 3" 581 | Start-Sleep 1 582 | Write-Host " 2" 583 | Start-Sleep 1 584 | Write-Host " 1" 585 | Start-Sleep 1 586 | Start-Process powershell.exe -ArgumentList ("-NoProfile -ExecutionPolicy Bypass -File `"{0}`"" -f $PSCommandPath) -Verb RunAs 587 | Exit 588 | } 589 | 590 | function serviceStatus{ 591 | param($ServiceName) 592 | Write-Output $("Checking service " + $ServiceName + " status...") 593 | $arrService = Get-Service -Name $ServiceName 594 | if ($arrService.Status -eq "Stopped"){ 595 | Write-Output $("Service " + $ServiceName + " is stopped.") 596 | return "stopped" 597 | } 598 | } 599 | #serviceStatus("Schedule"); 600 | 601 | function killProcess{ 602 | param($processName) 603 | Write-Output $("Trying to close " + $processName + " ...") 604 | 605 | for ($i=1; $i -le 10; $i++){ 606 | $firefox = Get-Process $processName -ErrorAction SilentlyContinue 607 | if ($firefox) { 608 | $firefox | Stop-Process -Force 609 | Sleep 1 610 | } 611 | } 612 | return 613 | } 614 | 615 | Function EnablePeek { 616 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "DisablePreviewWindow" "0" "Enabling Windows Peek Thumbnail" "DWord" 617 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "DisablePreviewDesktop" "0" "Enabling Windows Peek Desktop Preview" "DWord" 618 | RegChange "SOFTWARE\Microsoft\Windows\DWM" "EnableAeroPeek" "1" "Enabling Windows Peek" "DWord" 619 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ExtendedUIHoverTime" "0" "Enabling Windows Peek Taskbar Thumbnail" "DWord" 620 | RegChange "SOFTWARE\Microsoft\Windows\DWM" "AlwaysHibernateThumbnails" "1" "Enabling Windows Peek Taskbar Thumbnail Cache" "DWord" 621 | } 622 | 623 | Function DisablePeek { 624 | if ($beAeroPeekSafe -eq 1) { 625 | Write-Host "Aero Peek NOT disabled because of the beAeroPeekSafe configuration" -ForegroundColor Yellow -BackgroundColor DarkGreen 626 | return 627 | } 628 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "DisablePreviewWindow" "1" "Disabling Windows Peek Thumbnail" "DWord" 629 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "DisablePreviewDesktop" "1" "Disabling Windows Peek Desktop Preview" "DWord" 630 | RegChange "SOFTWARE\Microsoft\Windows\DWM" "EnableAeroPeek" "0" "Disabling Windows Peek" "DWord" 631 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ExtendedUIHoverTime" "30000" "Disabling Windows Peek Taskbar Thumbnail" "DWord" 632 | RegChange "SOFTWARE\Microsoft\Windows\DWM" "AlwaysHibernateThumbnails" "0" "Disabling Windows Peek Taskbar Thumbnail Cache" "DWord" 633 | } 634 | 635 | Function EnableThumbnail { 636 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "IconsOnly" "0" "Enabling Windows Thumbnail" "DWord" 637 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "DisableThumbnailCache" "0" "Enabling Windows Thumbnail" "DWord" 638 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "DisableThumbsDBOnNetworkFolders" "0" "Enabling Windows Thumbnail" "DWord" 639 | } 640 | 641 | Function DisableThumbnail { 642 | if ($beThumbnailSafe -eq 1) { 643 | Write-Host "Windows Thumbnails NOT disabled because of the beThumbnailSafe configuration" -ForegroundColor Yellow -BackgroundColor DarkGreen 644 | return 645 | } 646 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "IconsOnly" "1" "Disabling Windows Thumbnail" "DWord" 647 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "DisableThumbnailCache" "1" "Disabling Windows Thumbnail" "DWord" 648 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "DisableThumbsDBOnNetworkFolders" "1" "Disabling Windows Thumbnail" "DWord" 649 | } 650 | 651 | # Prefetch-files contain metadata information about the last run of the program, how many times it was run, which logical drive a program was run and dlls used. 652 | Function EnablePrefetcher { 653 | RegChange "SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" "EnablePrefetcher" "3" "Enabling Prefetcher" "DWord" 654 | } 655 | Function DisablePrefetcher { 656 | RegChange "SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" "EnablePrefetcher" "0" "Disabling Prefetcher" "DWord" 657 | } 658 | 659 | Function EnableMemoryDump { 660 | RegChange "SYSTEM\CurrentControlSet\Control\CrashControl" "CrashDumpEnabled" "1" "Enabling Memory Dump" "DWord" 661 | } 662 | 663 | Function DisableMemoryDump { 664 | RegChange "SYSTEM\CurrentControlSet\Control\CrashControl" "CrashDumpEnabled" "0" "Disabling Memory Dump" "DWord" 665 | } 666 | 667 | Function GPUVendor { 668 | Write-Output "Checking your GPU vendor..." 669 | $myGPU = Get-WmiObject win32_VideoController 670 | if ($myGPU.name -like '*nvidia*') { 671 | write-host 'GPU vendor is Nvidia' 672 | return "nvidia" 673 | } 674 | } 675 | 676 | Function installDraculaNotepad { 677 | Write-Output "Checking internet connection..." 678 | 679 | $HTTP_Request = [System.Net.WebRequest]::Create('http://google.com') 680 | $HTTP_Response = $HTTP_Request.GetResponse() 681 | $HTTP_Status = [int]$HTTP_Response.StatusCode 682 | 683 | If ($HTTP_Status -eq 200) { 684 | Write-Output "Conected to the internet." 685 | } 686 | Else { 687 | Write-Output "NOT conected to the internet." 688 | return 689 | } 690 | 691 | If ($HTTP_Response -eq $null) { } 692 | Else { $HTTP_Response.Close() } 693 | 694 | 695 | Write-Output "Checking if Notepad++ is running..." 696 | if((get-process "Notepad++" -ea SilentlyContinue) -eq $Null){ 697 | Write-Output "Notepad++ not running." 698 | } else { 699 | $restartNeeded = 1 700 | Write-Host "Notepad++ is running and will be killed. Press any key to continue..." -ForegroundColor Yellow -BackgroundColor DarkGreen 701 | $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown'); 702 | killProcess("notepad++"); 703 | } 704 | 705 | Write-Output "Downloading Dracula Theme for Notepad++..." 706 | $url = "https://raw.githubusercontent.com/dracula/notepad-plus-plus/master/Dracula.xml" 707 | $output = "$Env:USERPROFILE\AppData\Roaming\Notepad++\themes\Dracula.xml" 708 | $start_time = Get-Date 709 | 710 | $wc = New-Object System.Net.WebClient 711 | $wc.DownloadFile($url, $output) 712 | 713 | Write-Output "Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)" 714 | 715 | $file = "$Env:USERPROFILE\AppData\Roaming\Notepad++\config.xml" 716 | $OpenTag = 'name="stylerTheme" path="' 717 | $CloseTag = '" />' 718 | $NewText = $OpenTag + "$Env:USERPROFILE\AppData\Roaming\Notepad++\themes\Dracula.xml" + $CloseTag 719 | (Get-Content $file) | Foreach-Object {$_ -replace "$OpenTag.*$CloseTag", $NewText} | Set-Content $file 720 | 721 | if ($restartNeeded -eq 1) { 722 | Write-Output "Starting Notepad++" 723 | Start notepad++ 724 | } 725 | } 726 | 727 | Function uninstallDraculaNotepad { 728 | Write-Output "Checking if Notepad++ is running..." 729 | if((get-process "Notepad++" -ea SilentlyContinue) -eq $Null){ 730 | Write-Output "Notepad++ not running." 731 | } else { 732 | $restartNeeded = 1 733 | Write-Host "Notepad++ is running and will be killed. Press any key to continue..." -ForegroundColor Yellow -BackgroundColor DarkGreen 734 | $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown'); 735 | killProcess("notepad++"); 736 | } 737 | 738 | $file = "$Env:USERPROFILE\AppData\Roaming\Notepad++\config.xml" 739 | $OpenTag = 'name="stylerTheme" path="' 740 | $CloseTag = '" />' 741 | $NewText = $OpenTag + "$Env:USERPROFILE\AppData\Roaming\Notepad++\stylers.xml" + $CloseTag 742 | (Get-Content $file) | Foreach-Object {$_ -replace "$OpenTag.*$CloseTag", $NewText} | Set-Content $file 743 | 744 | if ($restartNeeded -eq 1) { 745 | Write-Output "Starting Notepad++" 746 | Start notepad++ 747 | } 748 | } 749 | 750 | # Link-Local Multicast Name Resolution (LLMNR) protocol, a protocol that allow name resolution without the requirement of a DNS server. LLMNR is a secondary name resolution protocol. 751 | # With LLMNR, queries are sent using multicast over a local network link on a single subnet from a client computer to another client computer on the same subnet that also has LLMNR enabled. 752 | # Imposes security risk for layer-4 name resolution spoofing attacks, ARP poisoning, KARMA attack and cache poisoning. 753 | Function DisableLLMNR { 754 | RegChange "SOFTWARE\Policies\Microsoft\Windows NT\DNSClient" "EnableMulticast" "0" "Disabling Link-Local Multicast Name Resolution (LLMNR) protocol" "DWord" 755 | } 756 | 757 | Function EnableLLMNR { 758 | RegChange "SOFTWARE\Policies\Microsoft\Windows NT\DNSClient" "EnableMulticast" "1" "Enabling Link-Local Multicast Name Resolution (LLMNR) protocol" "DWord" 759 | } 760 | 761 | ########## 762 | # Global Functions - End 763 | ########## 764 | #-------------------------------------------------------------------------- 765 | 766 | ########## 767 | # Program - Start 768 | ########## 769 | 770 | if ($beNetworkPrinterSafe -eq 1) { 771 | $bePrinterSafe = 1 772 | } 773 | 774 | if ($troubleshootInstalls -eq 1) { 775 | RegChange "SYSTEM\CurrentControlSet\Control\Terminal Server" "fDenyTSConnections" "0" "Enabling Remote Desktop" "DWord" 776 | RegChange "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" "UserAuthentication" "0" "Enabling Remote Desktop" "DWord" 777 | RegChange "SYSTEM\CurrentControlSet001\Control\Terminal Server" "fDenyTSConnections" "0" "Enabling Remote Desktop" 778 | 779 | RegChange "SYSTEM\CurrentControlSet\Services\diagnosticshub.standardcollector.service" "Start" "2" "Disabling diagnosticshub.standardcollector.service service" "DWord" 780 | Get-Service diagnosticshub.standardcollector.service | Set-Service -StartupType automatic 781 | 782 | # BITS (Background Intelligent Transfer Service), its aggressive bandwidth eating will interfere with you online gameplay, work and navigation. Its aggressive disk usable will reduce your HDD or SSD lifespan 783 | write-Host "Troubleshoot Install: Enabling BITS (Background Intelligent Transfer Service)" -ForegroundColor Green -BackgroundColor Black 784 | Get-Service BITS | Set-Service -StartupType automatic 785 | 786 | write-Host "DoSvc (Delivery Optimization) it overrides the windows updates opt-out user option, turn your pc into a p2p peer for Windows updates, mining your network performance and compromises your online gameplay, work and navigation." -ForegroundColor Green -BackgroundColor Black 787 | Write-Host "Troubleshoot Install: Enabling DoSvc (Delivery Optimization)..." 788 | Get-Service DoSvc | Set-Service -StartupType automatic 789 | 790 | Write-Output "Troubleshoot Install: Windows firewall service enabled by registry." 791 | New-ItemProperty -Path HKLM:SYSTEM\CurrentControlSet\Services\MpsSvc -Name Start -PropertyType DWord -Value 2 -Force -EA SilentlyContinue | Out-Null 792 | 793 | Write-Output "Troubleshoot Install: Windows Firewall enabled by registry." 794 | RegChange "Software\Policies\Microsoft\Windows Defender" "DisableAntiSpyware" "0" "Enabling Windows Anti Spyware - DisableAntiSpyware - Windows Firewall" 795 | 796 | Write-Output "Troubleshoot Install: Windows Firewall enabled by Get-Service." 797 | Get-Service MpsSvc | Set-Service -StartupType automatic 798 | 799 | Write-Output "Troubleshoot Install: Windows Firewall enabled by Get-NetFirewallProfile." 800 | Get-NetFirewallProfile | Set-NetFirewallProfile -Enabled True 801 | 802 | RegChange "SYSTEM\CurrentControlSet\Services\MpsSvc" "Start" "2" "Enabling Windows Firewall service..." "DWord" 803 | 804 | Write-Output "Troubleshoot Install: Enabling connection related dependency services." 805 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\EventLog-Application" "Start" "1" "Enabling AutoLogger\EventLog-Application..." "DWord" 806 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\EventLog-Security" "Start" "1" "Enabling AutoLogger\EventLog-Security..." "DWord" 807 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\EventLog-System" "Start" "1" "Enabling AutoLogger\EventLog-System..." "DWord" 808 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\EventLog-Application" "Start" "1" "Enabling AutoLogger\EventLog-Application..." "DWord" 809 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\EventLog-Security" "Start" "1" "Enabling AutoLogger\EventLog-Security..." "DWord" 810 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\EventLog-System" "Start" "1" "Enabling AutoLogger\EventLog-System..." "DWord" 811 | pause 812 | } 813 | 814 | if ($legacyRightClicksMenu -eq 0) { 815 | regDelete "Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}" "Disabling legacy right click menu..." 816 | } 817 | 818 | if ($legacyRightClicksMenu -eq 1) { 819 | RegChange "Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" "(Default)" "" "Enabling legacy right click menu..." "String" 820 | } 821 | 822 | if ($disableStartupSound -eq 0) { 823 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BootAnimation" "DisableStartupSound" "0" "Enabling Windows startup sound..." "DWord" 824 | } 825 | 826 | if ($disableStartupSound -eq 1) { 827 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BootAnimation" "DisableStartupSound" "1" "Disabling Windows startup sound..." "DWord" 828 | } 829 | 830 | if ($disableCortana -eq 0) { 831 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Windows Search" "ConnectedSearchPrivacy" "1" "Setting ConnectedSearchPrivacy to 3..." "DWord" 832 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Windows Search" "ConnectedSearchUseWeb" "1" "Setting ConnectedSearchUseWeb to 0..." "DWord" 833 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Windows Search" "ConnectedSearchUseWebOverMeteredConnections" "1" "Setting ConnectedSearchUseWebOverMeteredConnections to 0..." "DWord" 834 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Windows Search" "DisableWebSearch" "1" "Disabling Cortana web search..." "DWord" 835 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "CortanaEnabled" "1" "Disabling Cortana..." "DWord" 836 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "BingSearchEnabled" "1" "Disabling BingSearch..." "DWord" 837 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "CanCortanaBeEnabled" "1" "Setting CanCortanaBeEnabled to 0..." "DWord" 838 | RegChange "SOFTWARE\Microsoft\Personalization\Settings" "AcceptedPrivacyPolicy" "1" "Setting AcceptedPrivacyPolicy to 0..." "DWord" 839 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "DeviceHistoryEnabled" "1" "Setting DeviceHistoryEnabled to 0..." "DWord" 840 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "HistoryViewEnabled" "1" "Setting HistoryViewEnabled to 0..." "DWord" 841 | } 842 | 843 | if ($disableCortana -eq 1) { 844 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Windows Search" "ConnectedSearchPrivacy" "0" "Setting ConnectedSearchPrivacy to 3..." "DWord" 845 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Windows Search" "ConnectedSearchUseWeb" "0" "Setting ConnectedSearchUseWeb to 0..." "DWord" 846 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Windows Search" "ConnectedSearchUseWebOverMeteredConnections" "0" "Setting ConnectedSearchUseWebOverMeteredConnections to 0..." "DWord" 847 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Windows Search" "DisableWebSearch" "1" "Disabling Cortana web search..." "DWord" 848 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "CortanaEnabled" "0" "Disabling Cortana..." "DWord" 849 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "BingSearchEnabled" "0" "Disabling BingSearch..." "DWord" 850 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "CanCortanaBeEnabled" "0" "Setting CanCortanaBeEnabled to 0..." "DWord" 851 | RegChange "SOFTWARE\Microsoft\Personalization\Settings" "AcceptedPrivacyPolicy" "0" "Setting AcceptedPrivacyPolicy to 0..." "DWord" 852 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "DeviceHistoryEnabled" "0" "Setting DeviceHistoryEnabled to 0..." "DWord" 853 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Search" "HistoryViewEnabled" "0" "Setting HistoryViewEnabled to 0..." "DWord" 854 | } 855 | 856 | if ($disableVBS -eq 1) { 857 | RegChange "SYSTEM\CurrentControlSet\Control\DeviceGuard" "EnableVirtualizationBasedSecurity" "0" "Disabling Virtualization-based security..." "DWord" 858 | } 859 | 860 | if ($disableNtfsEncryption -eq 0) { 861 | RegChange "SYSTEM\CurrentControlSet\Policies" "NtfsDisableEncryption" "0" "Enabling NTFS file encryption..." "DWord" 862 | } 863 | 864 | if ($disableNtfsCompression -eq 1) { 865 | RegChange "SYSTEM\CurrentControlSet\Policies" "NtfsDisableCompression" "1" "Disabling NTFS file compression..." "DWord" 866 | } 867 | 868 | if ($beXboxSafe -eq 0) { 869 | Write-Output "Disabling Xbox features..." 870 | Get-AppxPackage "Microsoft.XboxApp" | Remove-AppxPackage 871 | Get-AppxPackage "Microsoft.XboxIdentityProvider" | Remove-AppxPackage -ErrorAction SilentlyContinue 872 | Get-AppxPackage "Microsoft.XboxSpeechToTextOverlay" | Remove-AppxPackage 873 | Get-AppxPackage "Microsoft.XboxGameOverlay" | Remove-AppxPackage 874 | Get-AppxPackage "Microsoft.XboxGamingOverlay" | Remove-AppxPackage 875 | Get-AppxPackage "Microsoft.Xbox.TCUI" | Remove-AppxPackage 876 | 877 | if ($(serviceStatus("Schedule")) -eq "running") { 878 | Write-Output "Disabling Xbox scheduled tasks..." 879 | Get-ScheduledTask XblGameSaveTaskLogon | Disable-ScheduledTask 880 | Get-ScheduledTask XblGameSaveTask | Disable-ScheduledTask 881 | } 882 | 883 | RegChange "Software\Microsoft\GameBar" "AutoGameModeEnabled" "0" "Disabling GameBar" "DWord" 884 | RegChange "Software\Microsoft\GameBar" "ShowStartupPanel" "0" "Disabling Game Bar Tips" "DWord" 885 | RegChange "System\GameConfigStore" "GameDVR_Enabled" "0" "Changing Registry key to disable Game DVR - GameDVR_Enabled" "DWord" 886 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" "AppCaptureEnabled" "0" "Changing Registry key to disable gamebarpresencewriter" 887 | 888 | # xbox dvr causing fps issues 889 | RegChange "SOFTWARE\Policies\Microsoft\Windows\GameDVR" "GameDVR" "0" "Disabling Xbox GameDVR..." "DWord" 890 | } 891 | 892 | if ($beWifiSafe -eq 1) { 893 | RegChange "SYSTEM\CurrentControlSet\Services\RmSvc" "Start" "2" "Enabling RmSvc (Radio Management Service) service" "DWord" 894 | Get-Service RmSvc | Set-Service -StartupType automatic 895 | 896 | RegChange "SYSTEM\CurrentControlSet\Services\WlanSvc" "Start" "2" "Enabling WlanSvc (WLAN Autoconfig) service" "DWord" 897 | Get-Service WlanSvc | Set-Service -StartupType automatic 898 | } 899 | 900 | if ($beAppxSafe -eq 0) { 901 | RegChange "SYSTEM\CurrentControlSet\Services\InstallService" "Start" "4" "Disabling InstallService MS Store service" "DWord" 902 | Get-Service InstallService | Set-Service -StartupType disabled 903 | Stop-Service InstallService -Force -NoWait 904 | 905 | RegChange "SYSTEM\ControlSet001\Services\PcaSvc" "Start" "4" "Disabling PcaSvc (Program Compatibility Assistant) service" "DWord" 906 | Get-Service PcaSvc | Set-Service -StartupType disabled 907 | Stop-Service PcaSvc -Force -NoWait 908 | RegChange "SYSTEM\ControlSet001\Services\wlidsvc" "Start" "4" "Disabling wlidsvc (Microsoft Windows Live ID Service) service" "DWord" 909 | Get-Service wlidsvc | Set-Service -StartupType disabled 910 | Stop-Service wlidsvc -Force -NoWait 911 | 912 | #TokenBroker required for night light windows feature 913 | #RegChange "SYSTEM\CurrentControlSet\Services\TokenBroker" "Start" "4" "Disabling TokenBroker (Windows Store permission manager) service" "DWord" 914 | #Get-Service TokenBroker | Set-Service -StartupType disabled 915 | #Stop-Service TokenBroker -Force -NoWait 916 | } 917 | 918 | if ($beAppxSafe -eq 1) { 919 | RegChange "SYSTEM\CurrentControlSet\Services\InstallService" "Start" "2" "Enabling InstallService MS Store service" "DWord" 920 | Get-Service InstallService | Set-Service -StartupType automatic 921 | Start-Service InstallService -Force -NoWait 922 | 923 | RegChange "SYSTEM\CurrentControlSet\Services\TokenBroker" "Start" "2" "Enabling TokenBroker (Windows Store permission manager) service" "DWord" 924 | Get-Service TokenBroker | Set-Service -StartupType automatic 925 | Start-Service TokenBroker -Force -NoWait 926 | 927 | RegChange "SYSTEM\ControlSet001\Services\wlidsvc" "Start" "2" "Enabling wlidsvc (Microsoft Windows Live ID Service) service" "DWord" 928 | Get-Service wlidsvc | Set-Service -StartupType automatic 929 | Start-Service wlidsvc -Force -NoWait 930 | 931 | RegChange "SYSTEM\ControlSet001\Services\PcaSvc" "Start" "2" "Enabling PcaSvc (Program Compatibility Assistant) service" "DWord" 932 | Get-Service PcaSvc | Set-Service -StartupType automatic 933 | Start-Service PcaSvc -Force -NoWait 934 | } 935 | 936 | 937 | if ($beXboxSafe -eq 1) { 938 | $safeXboxBloatware = @( 939 | "Microsoft.XboxGamingOverlay" 940 | "Microsoft.Xbox.TCUI" 941 | "Microsoft.XboxApp" 942 | "Microsoft.XboxGameOverlay" 943 | "Microsoft.XboxIdentityProvider" 944 | "Microsoft.XboxSpeechToTextOverlay" 945 | ) 946 | foreach ($safeXboxBloatware1 in $safeXboxBloatware) { 947 | Write-Output "Trying to install $safeXboxBloatware1." 948 | Get-AppxPackage -Name $safeXboxBloatware1| Add-AppxPackage 949 | Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $safeXboxBloatware1 | Add-AppxProvisionedPackage -Online 950 | } 951 | 952 | RegChange "System\GameConfigStore" "GameDVR_Enabled" "1" "Changing Registry key to ENABLE Game DVR - GameDVR_Enabled" "DWord" 953 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" "AppCaptureEnabled" "1" "Changing Registry key to ENABLE gamebarpresencewriter" 954 | 955 | # The Game bar is a Xbox app Game DVR feature that makes it simple to take control of your gaming activities—such as broadcasting, capturing clips, and sharing captures 956 | # (delete) = Enable 957 | # 0 = Disable 958 | Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -Name "AllowGameDVR" -ErrorAction SilentlyContinue 959 | Remove-ItemProperty -Path "HKCU:\Software\Microsoft\GameBar" -Name "AutoGameModeEnabled" -ErrorAction SilentlyContinue 960 | 961 | if ($(serviceStatus("Schedule")) -eq "running") { 962 | Write-Output "Enabling Xbox scheduled tasks..." 963 | Get-ScheduledTask XblGameSaveTaskLogon | Enable-ScheduledTask 964 | Get-ScheduledTask XblGameSaveTask | Enable-ScheduledTask 965 | } 966 | RegChange "Software\Microsoft\GameBar" "ShowStartupPanel" "1" "Enabling Game Bar Tips" "DWord" 967 | } 968 | 969 | if ($beBiometricSafe -eq 1) { 970 | $safebeBiometricSafe = @( 971 | "*Microsoft.BioEnrollment*" 972 | "*Microsoft.CredDialogHost*" 973 | "*Microsoft.ECApp*" 974 | "*Microsoft.LockApp*" 975 | ) 976 | foreach ($safebeBiometricSafe1 in $safebeBiometricSafe) { 977 | Get-AppxPackage -Name $safebeBiometricSafe1| Add-AppxPackage 978 | Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $safebeBiometricSafe1 | Add-AppxProvisionedPackage -Online 979 | Write-Output "Trying to install $safebeBiometricSafe1." 980 | } 981 | } 982 | 983 | if ($beCastSafe -eq 1) { 984 | Write-Output "Trying to install Microsoft.PPIP." 985 | Get-AppxPackage -Name "*Microsoft.PPIP*" | Add-AppxPackage 986 | Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like "*Microsoft.PPIP*" | Add-AppxProvisionedPackage -Online 987 | } 988 | 989 | if ($beVpnPppoeSafe -eq 1) { 990 | RegChange "SYSTEM\CurrentControlSet\services\Dnscache" "Start" "2" "Enabling DNS Cache Service" "DWord" 991 | } 992 | 993 | if (GPUVendor -eq "nvidia" -and installNvidiaControlPanel -eq 1) { 994 | Get-AppxPackage -Name "*NVIDIACorp.NVIDIAControlPanel*" | Add-AppxPackage 995 | Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like "*NVIDIACorp.NVIDIAControlPanel*" | Add-AppxProvisionedPackage -Online 996 | Write-Output "Trying to install Nvidia control panel." 997 | } 998 | 999 | # SMB Server is known for opening doors for mass ransomware attacks - WannaCry and NotPetya 1000 | if ($disableSMBServer -eq 0) { 1001 | Write-Output "Enabling SMB Server..." 1002 | Set-SmbServerConfiguration -EnableSMB2Protocol $true -Force 1003 | Enable-NetAdapterBinding -Name "*" -ComponentID "ms_server" 1004 | } 1005 | 1006 | if ($disableSMBServer -eq 1) { 1007 | Write-Output "Disabling SMB Server..." 1008 | Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force 1009 | Set-SmbServerConfiguration -EnableSMB2Protocol $false -Force 1010 | Disable-NetAdapterBinding -Name "*" -ComponentID "ms_server" 1011 | } 1012 | 1013 | if ($disableSystemRestore -eq 0) { 1014 | Write-Output "Enabling system restore..." 1015 | if ($(serviceStatus("Schedule")) -eq "running") { 1016 | Write-Output "Enabling system restore scheduled task..." 1017 | Enable-ScheduledTask -TaskName "Microsoft\Windows\SystemRestore\SR" -EA SilentlyContinue | Out-Null 1018 | } 1019 | 1020 | Get-Service swprv | Set-Service -StartupType automatic 1021 | Get-Service VSS | Set-Service -StartupType automatic 1022 | } 1023 | 1024 | if ($disableSystemRestore -eq 1) { 1025 | Write-Output "Disabling system restore..." 1026 | if ($(serviceStatus("Schedule")) -eq "running") { 1027 | Write-Output "Disabling system restore scheduled task..." 1028 | Disable-ScheduledTask -TaskName "Microsoft\Windows\SystemRestore\SR" -EA SilentlyContinue | Out-Null 1029 | } 1030 | 1031 | Get-Service swprv | Stop-Service -PassThru | Set-Service -StartupType disabled 1032 | Get-Service VSS | Stop-Service -PassThru | Set-Service -StartupType disabled 1033 | } 1034 | 1035 | if ($disableTelemetry -eq 0) { 1036 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" "AllowTelemetry" "1" "Disabling data collection through telemetry" 1037 | RegChange "SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" "1" "Disabling data collection through telemetry" 1038 | RegChange "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" "AllowTelemetry" "1" "Disabling data collection through telemetry" 1039 | if ($(serviceStatus("Schedule")) -eq "running") { 1040 | Write-Output "Enabling telemetry scheduled tasks..." 1041 | Enable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" | Out-Null 1042 | Enable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\ProgramDataUpdater" | Out-Null 1043 | Enable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null 1044 | Enable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null 1045 | Enable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null 1046 | Enable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null 1047 | } 1048 | } 1049 | 1050 | if ($disableTelemetry -eq 1) { 1051 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" "AllowTelemetry" "0" "Disabling data collection through telemetry" 1052 | RegChange "SOFTWARE\Policies\Microsoft\Windows\DataCollection" "AllowTelemetry" "0" "Disabling data collection through telemetry" 1053 | RegChange "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" "AllowTelemetry" "0" "Disabling data collection through telemetry" 1054 | if ($(serviceStatus("Schedule")) -eq "running") { 1055 | Write-Output "Disabling telemetry scheduled tasks..." 1056 | Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" | Out-Null 1057 | Disable-ScheduledTask -TaskName "Microsoft\Windows\Application Experience\ProgramDataUpdater" | Out-Null 1058 | Disable-ScheduledTask -TaskName "Microsoft\Windows\Autochk\Proxy" | Out-Null 1059 | Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" | Out-Null 1060 | Disable-ScheduledTask -TaskName "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" | Out-Null 1061 | Disable-ScheduledTask -TaskName "Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" | Out-Null 1062 | } 1063 | } 1064 | 1065 | if ($disableBloatware -eq 0) { 1066 | foreach ($Bloat in $bloatwareList) { 1067 | Write-Output "Trying to INSTALL $Bloat." 1068 | Get-AppxPackage -Name $Bloat| Add-AppxPackage 1069 | Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Bloat | Add-AppxProvisionedPackage -Online 1070 | } 1071 | 1072 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "FeatureManagementEnabled" "1" "Enabling Windows bloatware" "Dword" 1073 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "ContentDeliveryAllowed" "1" "Enabling Windows bloatware" "Dword" 1074 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "OemPreInstalledAppsEnabled" "1" "Enabling Windows bloatware" "DWord" 1075 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "PreInstalledAppsEnabled" "1" "Enabling Windows bloatware" "DWord" 1076 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "PreInstalledAppsEverEnabled" "1" "Enabling Windows bloatware" "DWord" 1077 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SilentInstalledAppsEnabled" "1" "Enabling Windows bloatware" "DWord" 1078 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SystemPaneSuggestionsEnabled" "1" "Enabling Windows bloatware" "DWord" 1079 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContentEnabled" "1" "Enabling Windows bloatware" "DWord" 1080 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-353696Enabled" "1" "Enabling Windows bloatware" "DWord" 1081 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-353694Enabled" "1" "Enabling Windows bloatware" "DWord" 1082 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-338393Enabled" "1" "Enabling Windows bloatware" "DWord" 1083 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-338389Enabled" "1" "Enabling Windows bloatware" "DWord" 1084 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-338388Enabled" "1" "Enabling Windows bloatware" "DWord" 1085 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-310093Enabled" "1" "Enabling Windows bloatware" "DWord" 1086 | } 1087 | 1088 | if ($disableBloatware -eq 1) { 1089 | foreach ($Bloat in $bloatwareList) { 1090 | Write-Output "Trying to remove $Bloat" 1091 | Get-AppxPackage -Name $Bloat| Remove-AppxPackage 1092 | } 1093 | 1094 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "FeatureManagementEnabled" "0" "Adding Registry key to PREVENT bloatware apps from returning" "Dword" 1095 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "ContentDeliveryAllowed" "0" "Adding Registry key to PREVENT bloatware apps from returning" "Dword" 1096 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "OemPreInstalledAppsEnabled" "0" "Adding Registry key to PREVENT bloatware apps from returning" "DWord" 1097 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "PreInstalledAppsEnabled" "0" "Adding Registry key to PREVENT bloatware apps from returning" "DWord" 1098 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "PreInstalledAppsEverEnabled" "0" "Adding Registry key to PREVENT bloatware apps from returning" "DWord" 1099 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SilentInstalledAppsEnabled" "0" "Adding Registry key to PREVENT bloatware apps from returning" "DWord" 1100 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SystemPaneSuggestionsEnabled" "0" "Adding Registry key to PREVENT bloatware apps from returning" "DWord" 1101 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContentEnabled" "0" "Adding Registry key to PREVENT bloatware apps from returning" "DWord" 1102 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-353696Enabled" "0" "Adding Registry key to PREVENT bloatware apps from returning" "DWord" 1103 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-353694Enabled" "0" "Adding Registry key to PREVENT bloatware apps from returning" "DWord" 1104 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-338393Enabled" "0" "Adding Registry key to PREVENT bloatware apps from returning" "DWord" 1105 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-338389Enabled" "0" "Adding Registry key to PREVENT bloatware apps from returning" "DWord" 1106 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-338388Enabled" "0" "Adding Registry key to PREVENT bloatware apps from returning" "DWord" 1107 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SubscribedContent-310093Enabled" "0" "Adding Registry key to PREVENT bloatware apps from returning" "DWord" 1108 | 1109 | regDelete "Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\Subscriptions" "Clearing bloatware registry keys" 1110 | regDelete "Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\SuggestedApps" "Clearing bloatware registry keys" 1111 | } 1112 | 1113 | if ($unpinStartMenu -eq 1) { 1114 | Write-Host "Unpinning all tiles from the start menu" 1115 | regDelete "Software\Microsoft\Windows\CurrentVersion\CloudStore\*" "Clearing all start menu items..." 1116 | 1117 | (New-Object -Com Shell.Application). 1118 | NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}'). 1119 | Items() | 1120 | % { $_.Verbs() } | 1121 | ? {$_.Name -match 'Un.*pin from Start'} | 1122 | % {$_.DoIt()} 1123 | } 1124 | 1125 | if ($disablelastaccess -eq 0) { 1126 | Write-Output "Disabling last file access." 1127 | fsutil behavior set disablelastaccess 3 1128 | } 1129 | 1130 | if ($disablelastaccess -eq 1) { 1131 | Write-Output "Enabling last file access." 1132 | fsutil behavior set disablelastaccess 2 1133 | } 1134 | 1135 | if ($doPerformanceStuff -eq 0) { 1136 | # Parental Controls 1137 | Write-Output "Enabling Windows Parental Controls..." 1138 | Get-Service WpcMonSvc | Stop-Service -PassThru | Set-Service -StartupType automatic 1139 | 1140 | # Diagnostic Execution Service 1141 | Write-Output "Disabling Windows Diagnostic Execution Service..." 1142 | Get-Service diagsvc | Stop-Service -PassThru | Set-Service -StartupType automatic 1143 | 1144 | # USELESS FAX 1145 | Get-Service Fax | Stop-Service -PassThru | Set-Service -StartupType automatic 1146 | if($?){ write-Host -ForegroundColor Green "Windows Fax service enabled" }else{ write-Host -ForegroundColor red "Windows Fax service not enabled" } 1147 | 1148 | # USELESS GEO 1149 | Get-Service lfsvc | Stop-Service -PassThru | Set-Service -StartupType automatic 1150 | if($?){ write-Host -ForegroundColor Green "Geo service enabled" }else{ write-Host -ForegroundColor red "Geo service not enabled" } 1151 | 1152 | # USELESS DusmSvc 1153 | Get-Service DusmSvc | Stop-Service -PassThru | Set-Service -StartupType automatic 1154 | if($?){ write-Host -ForegroundColor Green "DusmSvc service enabled" }else{ write-Host -ForegroundColor red "DusmSvc service not enabled" } 1155 | 1156 | # Winmgmt is required by VMware autorization service 1157 | Write-Output "Troubleshoot Install: Enabling Windows Management Instrumentation service enabled." 1158 | Get-Service Winmgmt | Start-Service -PassThru | Set-Service -StartupType automatic 1159 | New-ItemProperty -Path 'HKLM:SYSTEM\CurrentControlSet\Services\Winmgmt' -name Start -PropertyType DWord -Value 2 -Force 1160 | 1161 | RegChange "SYSTEM\CurrentControlSet\Services\StorSvc" "Start" "2" "Enabling StorSvc (Storage Service) service" "DWord" 1162 | Get-Service StorSvc | Set-Service -StartupType automatic 1163 | 1164 | RegChange "SYSTEM\CurrentControlSet\Services\MSDTC" "Start" "2" "Enabling MSDTC (Distributed Transaction Coordinator) service" "DWord" 1165 | Get-Service MSDTC | Set-Service -StartupType automatic 1166 | 1167 | RegChange "SYSTEM\CurrentControlSet\Services\Ndu" "Start" "2" "Enabling Ndu (Network Data Usage Monitor) service" "DWord" 1168 | Get-Service Ndu | Set-Service -StartupType automatic 1169 | 1170 | RegChange "SYSTEM\CurrentControlSet\Services\AppMgmt" "Start" "2" "Enabling AppMgmt (Application Management) service" "DWord" 1171 | Get-Service AppMgmt | Set-Service -StartupType automatic 1172 | 1173 | RegChange "SYSTEM\CurrentControlSet\Services\Spooler" "Start" "2" "Enabling print spooler service" "DWord" 1174 | Get-Service Spooler | Set-Service -StartupType automatic 1175 | 1176 | Remove-Printer -Name "Microsoft XPS Document Writer" 1177 | 1178 | RegChange "SYSTEM\CurrentControlSet\Services\StiSvc" "Start" "2" "Enabling StiSvc Windows Image Acquisition (WIA) service" "DWord" 1179 | Get-Service StiSvc | Set-Service -StartupType automatic 1180 | 1181 | RegChange "SYSTEM\CurrentControlSet\Services\TrkWks" "Start" "2" "Enabling TrkWks (Distributed Link Tracking Client) service" "DWord" 1182 | Get-Service TrkWks | Set-Service -StartupType automatic 1183 | 1184 | # Required by bluetooth 1185 | RegChange "SYSTEM\CurrentControlSet\Services\BthAvctpSvc" "Start" "2" "Enabling AVCTP (Audio Video Control Transport Protocol) service" "DWord" 1186 | Get-Service BthAvctpSvc | Set-Service -StartupType automatic 1187 | 1188 | RegChange "SYSTEM\CurrentControlSet\Services\DispBrokerDesktopSvc" "Start" "2" "Enabling DispBrokerDesktopSvc (Display Policy Service) service" "DWord" 1189 | Get-Service DispBrokerDesktopSvc | Set-Service -StartupType automatic 1190 | 1191 | # DoSvc (Delivery Optimization) it overrides the windows updates opt-out user option, turn your pc into a p2p peer for Windows updates, mining your network performance and compromises your online gameplay, work and navigation 1192 | RegChange "SYSTEM\CurrentControlSet\Services\DoSvc" "Start" "2" "Enabling DoSvc (Delivery Optimization) service" "DWord" 1193 | Get-Service DoSvc | Set-Service -StartupType automatic 1194 | 1195 | RegChange "SYSTEM\CurrentControlSet\Services\OneSyncSvc" "Start" "2" "Enabling OneSyncSvc service" "DWord" 1196 | Get-Service OneSyncSvc | Set-Service -StartupType automatic 1197 | 1198 | RegChange "SYSTEM\CurrentControlSet\Services\WalletService" "Start" "2" "Enabling WalletService service" "DWord" 1199 | Get-Service WalletService | Set-Service -StartupType automatic 1200 | 1201 | RegChange "SYSTEM\CurrentControlSet\Services\diagnosticshub.standardcollector.service" "Start" "2" "Enabling diagnosticshub.standardcollector.service service" "DWord" 1202 | Get-Service diagnosticshub.standardcollector.service | Set-Service -StartupType automatic 1203 | 1204 | # In very rare cases, Hardware Accelerated GPU Scheduling set to ON (2) may improve latency 1205 | RegChange "SYSTEM\CurrentControlSet\Control\GraphicsDrivers" "HwSchMode" "1" "Disabling Hardware Accelerated GPU Scheduling" "DWord" 1206 | 1207 | RegChange "Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" "EnableTransparency" "1" "Enabling Windows transparency effect" "DWord" 1208 | RegChange "SYSTEM\CurrentControlSet\services\WdiServiceHost" "Start" "2" "Enabling Diagnostic Service Host" "DWord" 1209 | RegChange "SYSTEM\CurrentControlSet\services\WdiSystemHost" "Start" "2" "Enabling Diagnostic System Host Service" "DWord" 1210 | RegChange "SYSTEM\CurrentControlSet\services\DPS" "Start" "2" "Enabling Diagnostic Policy Service" "DWord" 1211 | 1212 | Write-Output "Enabling EpsonCustomerResearchParticipation..." 1213 | Get-Service EpsonCustomerResearchParticipation | Set-Service -StartupType automatic 1214 | Write-Output "Enabling LGHUBUpdaterService..." 1215 | Get-Service LGHUBUpdaterService | Set-Service -StartupType automatic 1216 | 1217 | RegChange "System\CurrentControlSet\Control\Session Manager\Power" "HibernateEnabled" "1" "Enabling hibernation..." "DWord" 1218 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" "ShowHibernateOption" "1" "Making visible hibernation..." "DWord" 1219 | 1220 | if ($(serviceStatus("Schedule")) -eq "running") { 1221 | write-Host -ForegroundColor Green -BackgroundColor Black "Defragmentation cause unnecessary wear on SSDs" 1222 | Write-Host "Enabling scheduled defragmentation..." 1223 | Enable-ScheduledTask -TaskName "Microsoft\Windows\Defrag\ScheduledDefrag" | Out-Null 1224 | } 1225 | 1226 | write-Host "Superfetch is known to cause all kinds of problems: slow boot times, disk wear, bottleneck, RAM consumption" -ForegroundColor Green -BackgroundColor Black 1227 | Write-Host "Enabling Superfetch service..." 1228 | Get-Service SysMain | Stop-Service -PassThru | Set-Service -StartupType automatic 1229 | 1230 | Write-Host "Enabling SSDPSRV service..." 1231 | Get-Service SSDPSRV | Stop-Service -PassThru | Set-Service -StartupType automatic 1232 | 1233 | Write-Host "Enabling AxInstSV service..." 1234 | Get-Service AxInstSV | Stop-Service -PassThru | Set-Service -StartupType automatic 1235 | 1236 | Write-Host "Enabling MapsBroker (Downloaded Maps Manager) service..." 1237 | Get-Service MapsBroker | Set-Service -StartupType automatic 1238 | 1239 | # BITS (Background Intelligent Transfer Service), its aggressive bandwidth eating will interfere with you online gameplay, work and navigation. Its aggressive disk usable will reduce your HDD or SSD lifespan 1240 | write-Host "Enabling BITS (Background Intelligent Transfer Service)" -ForegroundColor Green -BackgroundColor Black 1241 | Get-Service BITS | Set-Service -StartupType automatic 1242 | 1243 | Write-Host "Disabling netsvcs. Its known for huge bandwidth usage..." 1244 | Get-Service netsvcs | Stop-Service -PassThru | Set-Service -StartupType disabled 1245 | 1246 | #RegChange "SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" "DODownloadMode" "3" "Enabling DeliveryOptimization download mode HTTP blended with Internet Peering..." "DWord" 1247 | #RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" "DODownloadMode" "3" "Enabling DeliveryOptimization download mode HTTP blended with Internet Peering..." "DWord" 1248 | #RegChange "System\CurrentControlSet\Services\edgeupdate*" "Start" "2" "Enabling Edge updates..." "DWord" 1249 | 1250 | Write-Host "Enabling LanmanWorkstation Service..." 1251 | Get-Service Workstation | Set-Service -StartupType automatic 1252 | 1253 | Write-Host "Enabling LanmanServer Service..." 1254 | Get-Service Server | Set-Service -StartupType automatic 1255 | 1256 | RegChange "SYSTEM\CurrentControlSet\Services\camsvc" "Start" "2" "Enabling camsvc service" "DWord" 1257 | Get-Service camsvc | Set-Service -StartupType automatic 1258 | } 1259 | 1260 | if ($doPerformanceStuff -eq 1) { 1261 | # Why not? 1262 | killProcess("ai"); 1263 | deleteFile "$env:Programfiles\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\Office16\ai.exe" "Deleting office ai.exe..." 1264 | killProcess("DIM"); 1265 | deleteFile "$env:Programfiles\Corel\CUH\v2\DIM.EXE" "Deleting Corel Updater..." 1266 | 1267 | # Parental Controls 1268 | Write-Output "Disabling Windows Parental Controls..." 1269 | Get-Service WpcMonSvc | Stop-Service -PassThru | Set-Service -StartupType disabled 1270 | 1271 | # Diagnostic Execution Service 1272 | Write-Output "Disabling Windows Diagnostic Execution Service..." 1273 | Get-Service diagsvc | Stop-Service -PassThru | Set-Service -StartupType disabled 1274 | 1275 | # USELESS FAX 1276 | Get-Service Fax | Stop-Service -PassThru | Set-Service -StartupType disabled 1277 | if($?){ write-Host -ForegroundColor Green "Windows Fax service disabled" }else{ write-Host -ForegroundColor red "Windows Fax service not disabled" } 1278 | 1279 | # USELESS GEO 1280 | Get-Service lfsvc | Stop-Service -PassThru | Set-Service -StartupType disabled 1281 | if($?){ write-Host -ForegroundColor Green "Geo service disabled" }else{ write-Host -ForegroundColor red "Geo service not disabled" } 1282 | 1283 | # USELESS DusmSvc 1284 | Get-Service DusmSvc | Stop-Service -PassThru | Set-Service -StartupType disabled 1285 | if($?){ write-Host -ForegroundColor Green "DusmSvc service disabled" }else{ write-Host -ForegroundColor red "DusmSvc service not disabled" } 1286 | 1287 | # Winmgmt is required by VMware autorization service 1288 | # Write-Output "Troubleshoot Install: Enabling Windows Management Instrumentation service enabled." 1289 | # Get-Service Winmgmt | Start-Service -PassThru | Set-Service -StartupType disabled 1290 | # New-ItemProperty -Path 'HKLM:SYSTEM\CurrentControlSet\Services\Winmgmt' -name Start -PropertyType DWord -Value 4 -Force 1291 | 1292 | if ($beWSL2Safe -eq 0) { 1293 | RegChange "SYSTEM\CurrentControlSet\Services\StorSvc" "Start" "4" "Disabling StorSvc (Storage Service) service" "DWord" 1294 | Get-Service StorSvc | Set-Service -StartupType disabled 1295 | } 1296 | 1297 | RegChange "SYSTEM\CurrentControlSet\Services\MSDTC" "Start" "4" "Disabling MSDTC (Distributed Transaction Coordinator) service" "DWord" 1298 | Get-Service MSDTC | Set-Service -StartupType disabled 1299 | 1300 | RegChange "SYSTEM\CurrentControlSet\Services\Ndu" "Start" "4" "Disabling Ndu (Network Data Usage Monitor) service" "DWord" 1301 | Get-Service Ndu | Set-Service -StartupType disabled 1302 | 1303 | RegChange "SYSTEM\CurrentControlSet\Services\AppMgmt" "Start" "4" "Disabling AppMgmt (Application Management) service" "DWord" 1304 | Get-Service AppMgmt | Set-Service -StartupType disabled 1305 | 1306 | Remove-Printer -Name "Microsoft XPS Document Writer" 1307 | 1308 | RegChange "SYSTEM\CurrentControlSet\Services\Spooler" "Start" "4" "Disabling print spooler service" "DWord" 1309 | Get-Service Spooler | Set-Service -StartupType disabled 1310 | 1311 | RegChange "SYSTEM\CurrentControlSet\Services\StiSvc" "Start" "4" "Disabling StiSvc Windows Image Acquisition (WIA) service" "DWord" 1312 | Get-Service StiSvc | Set-Service -StartupType disabled 1313 | 1314 | RegChange "SYSTEM\CurrentControlSet\Services\TrkWks" "Start" "4" "Disabling TrkWks (Distributed Link Tracking Client) service" "DWord" 1315 | Get-Service TrkWks | Set-Service -StartupType disabled 1316 | 1317 | # Required by bluetooth 1318 | # RegChange "SYSTEM\CurrentControlSet\Services\BthAvctpSvc" "Start" "4" "Disabling AVCTP (Audio Video Control Transport Protocol) service" "DWord" 1319 | # Get-Service BthAvctpSvc | Set-Service -StartupType disabled 1320 | 1321 | RegChange "SYSTEM\CurrentControlSet\Services\DispBrokerDesktopSvc" "Start" "4" "Disabling DispBrokerDesktopSvc (Display Policy Service) service" "DWord" 1322 | Get-Service DispBrokerDesktopSvc | Set-Service -StartupType disabled 1323 | 1324 | if ($beAppxSafe -eq 1) { 1325 | # DoSvc (Delivery Optimization) it overrides the windows updates opt-out user option, turn your pc into a p2p peer for Windows updates, mining your network performance and compromises your online gameplay, work and navigation 1326 | RegChange "SYSTEM\CurrentControlSet\Services\DoSvc" "Start" "2" "Enabling DoSvc (Delivery Optimization) service" "DWord" 1327 | Get-Service DoSvc | Set-Service -StartupType automatic 1328 | } else { 1329 | # DoSvc (Delivery Optimization) it overrides the windows updates opt-out user option, turn your pc into a p2p peer for Windows updates, mining your network performance and compromises your online gameplay, work and navigation 1330 | RegChange "SYSTEM\CurrentControlSet\Services\DoSvc" "Start" "4" "Disabling DoSvc (Delivery Optimization) service" "DWord" 1331 | Get-Service DoSvc | Set-Service -StartupType disabled 1332 | } 1333 | 1334 | RegChange "SYSTEM\CurrentControlSet\Services\OneSyncSvc" "Start" "4" "Disabling OneSyncSvc service" "DWord" 1335 | Get-Service OneSyncSvc | Set-Service -StartupType disabled 1336 | 1337 | RegChange "SYSTEM\CurrentControlSet\Services\WalletService" "Start" "4" "Disabling WalletService service" "DWord" 1338 | Get-Service WalletService | Set-Service -StartupType disabled 1339 | 1340 | RegChange "SYSTEM\CurrentControlSet\Services\diagnosticshub.standardcollector.service" "Start" "4" "Disabling diagnosticshub.standardcollector.service service" "DWord" 1341 | Get-Service diagnosticshub.standardcollector.service | Set-Service -StartupType disabled 1342 | 1343 | #In very rare cases, Hardware Accelerated GPU Scheduling set to ON (2) may improve latency 1344 | RegChange "SYSTEM\CurrentControlSet\Control\GraphicsDrivers" "HwSchMode" "2" "Disabling Hardware Accelerated GPU Scheduling" "DWord" 1345 | 1346 | RegChange "Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" "EnableTransparency" "0" "Disabling Windows transparency effect" "DWord" 1347 | RegChange "SYSTEM\CurrentControlSet\services\WdiServiceHost" "Start" "4" "Disabling Diagnostic Service Host" "DWord" 1348 | RegChange "SYSTEM\CurrentControlSet\services\WdiSystemHost" "Start" "4" "Disabling Diagnostic System Host Service" "DWord" 1349 | RegChange "SYSTEM\CurrentControlSet\services\DPS" "Start" "4" "Disabling Diagnostic Policy Service" "DWord" 1350 | 1351 | killProcess("nvngx_update"); 1352 | deleteFile "$env:WINDIR\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_577df0ba9db954d8\nvngx_update.exe" "Deleting Nvidia nvngx_update (bandwidth usage, lack of parameters for users to choose when its suppose to update)..." 1353 | RegChange "System\CurrentControlSet\Control\Session Manager\Power" "HibernateEnabled" "0" "Disabling hibernation..." "DWord" 1354 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FlyoutMenuSettings" "ShowHibernateOption" "0" "Hiding hibernation..." "DWord" 1355 | 1356 | Write-Output "Disabling EpsonCustomerResearchParticipation..." 1357 | Get-Service EpsonCustomerResearchParticipation | Stop-Service -PassThru | Set-Service -StartupType disabled 1358 | 1359 | Write-Output "Disabling LGHUBUpdaterService (bandwidth usage, lack of parameters for users to choose when its suppose to update)..." 1360 | Get-Service LGHUBUpdaterService | Stop-Service -PassThru | Set-Service -StartupType disabled 1361 | 1362 | Write-Host "Disabling netsvcs. Its known for huge bandwidth usage..." 1363 | Get-Service netsvcs | Stop-Service -PassThru | Set-Service -StartupType disabled 1364 | 1365 | if ($(serviceStatus("Schedule")) -eq "running") { 1366 | write-Host -ForegroundColor Green -BackgroundColor Black "Defragmentation cause unnecessary wear on SSDs" 1367 | Write-Host "Disabling scheduled defragmentation..." 1368 | Disable-ScheduledTask -TaskName "Microsoft\Windows\Defrag\ScheduledDefrag" | Out-Null 1369 | } 1370 | 1371 | write-Host "Superfetch is known to cause all kinds of problems: slow boot times, disk wear, bottleneck, RAM consumption" -ForegroundColor Green -BackgroundColor Black 1372 | Write-Host "Stopping and disabling Superfetch service..." 1373 | Get-Service SysMain | Stop-Service -PassThru | Set-Service -StartupType disabled 1374 | 1375 | Write-Host "Stopping and disabling SSDPSRV service..." 1376 | Get-Service SSDPSRV | Stop-Service -PassThru | Set-Service -StartupType disabled 1377 | 1378 | Write-Host "Stopping and disabling AxInstSV service..." 1379 | Get-Service AxInstSV | Stop-Service -PassThru | Set-Service -StartupType disabled 1380 | 1381 | Write-Host "Stopping and disabling MapsBroker (Downloaded Maps Manager) service..." 1382 | Get-Service MapsBroker | Stop-Service -PassThru | Set-Service -StartupType disabled 1383 | 1384 | RegChange "SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" "DODownloadMode" "100" "Disabling DeliveryOptimization Peering and HTTP download mode (bypass mode)..." "DWord" 1385 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" "DODownloadMode" "100" "Disabling DeliveryOptimization Peering and HTTP download mode (bypass mode)..." "DWord" 1386 | RegChange "System\CurrentControlSet\Services\edgeupdate*" "Start" "4" "Disabling Edge updates..." "DWord" 1387 | 1388 | regDelete "Software\Microsoft\Windows\CurrentVersion\Run\com.squirrel.Teams.Teams" "Disabling MS Teams updater" 1389 | 1390 | if ($beNetworkPrinterSafe -eq 0) { 1391 | Write-Host "Disabling LanmanWorkstation Service..." 1392 | Get-Service Workstation | Stop-Service -PassThru | Set-Service -StartupType disabled 1393 | 1394 | Write-Host "Disabling LanmanServer Service..." 1395 | Get-Service Server | Stop-Service -PassThru | Set-Service -StartupType disabled 1396 | } 1397 | 1398 | if ($beWifiSafe -eq 0) { 1399 | RegChange "SYSTEM\CurrentControlSet\Services\RmSvc" "Start" "4" "Disabling RmSvc (Radio Management Service) service" "DWord" 1400 | Get-Service RmSvc | Set-Service -StartupType disabled 1401 | 1402 | RegChange "SYSTEM\CurrentControlSet\Services\WlanSvc" "Start" "4" "Disabling WlanSvc (WLAN Autoconfig) service" "DWord" 1403 | Get-Service WlanSvc | Set-Service -StartupType disabled 1404 | } 1405 | 1406 | if ($beWifiSafe -eq 1) { 1407 | Write-Host "RmSvc (Radio Management Service) service NOT disabled because of the beWifiSafe configuration" -ForegroundColor Yellow -BackgroundColor DarkGreen 1408 | } 1409 | 1410 | 1411 | if ($beMicrophoneSafe -eq 0) { 1412 | RegChange "SYSTEM\CurrentControlSet\Services\camsvc" "Start" "4" "Disabling camsvc service" "DWord" 1413 | Get-Service camsvc | Set-Service -StartupType disabled 1414 | } 1415 | 1416 | if ($beMicrophoneSafe -eq 1) { 1417 | Write-Host "camsvc service was NOT disabled because of the beMicrophoneSafe configuration" -ForegroundColor Yellow -BackgroundColor DarkGreen 1418 | RegChange "SYSTEM\CurrentControlSet\Services\camsvc" "Start" "2" "Enabling camsvc service" "DWord" 1419 | Get-Service camsvc | Set-Service -StartupType automatic 1420 | } 1421 | } 1422 | 1423 | if ($doQualityOfLifeStuff -eq 0) { 1424 | RegChange "Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" "SaveZoneInformation" "1" "Enabling Attachment being locked when saved..." "DWord" 1425 | 1426 | Get-Service VMwareHostd | Set-Service -StartupType automatic 1427 | RegChange "SYSTEM\CurrentControlSet\services\VMwareHostd" "Start" "2" "Enabling VMware host..." "DWord" 1428 | 1429 | # Look for an app in the Microsoft Store 1430 | RegChange "Software\Policies\Microsoft\Windows\Explorer" "NoUseStoreOpenWith" "0" "Enabling Look for an app in the Microsoft Store" "DWord" 1431 | 1432 | RegChange "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "TaskbarDa" "1" "Adding widgets button to taskbar" "DWord" 1433 | RegChange "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "TaskbarMn" "1" "Adding chat button to taskbar" "DWord" 1434 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SoftLandingEnabled" "1" "Enabling Get tips and suggestion when i use Windows" "DWord" 1435 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" "DisableAutomaticRestartSignOn" "0" "Enabling Windows Winlogon Automatic Restart Sign-On..." "DWord" 1436 | RegChange "Software\Microsoft\Windows\CurrentVersion\Notifications\Settings" "NOC_GLOBAL_SETTING_TOASTS_ENABLED" "1" "Enabling Action Center toasts..." "DWord" 1437 | 1438 | # Required for notification center bar 1439 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Explorer" "DisableNotificationCenter" "0" "Enabling Action Center notification center..." "DWord" 1440 | 1441 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications" "ToastEnabled" "1" "Enabling Action Center toast push notifications..." "DWord" 1442 | RegChange "Control Panel\Accessibility" "DynamicScrollbars" "1" "Enabling dynamic scrollbars..." "DWord" 1443 | RegChange "SOFTWARE\Policies\Microsoft\MRT" "DontOfferThroughWUAU " "0" "Enabling Malicious Software Removal Tool offering" "DWord" 1444 | 1445 | write-Host "Fast Boot is known to cause problems with steam" -ForegroundColor Green -BackgroundColor Black 1446 | RegChange "SYSTEM\CurrentControlSet\Control\Session Manager\Power" "HiberbootEnabled" "1" "Enabling Fast boot..." "DWord" 1447 | powercfg /hibernate ON 1448 | 1449 | write-Host "RAZER services that allows third party software to ness with your keyboard backlight" -ForegroundColor Green -BackgroundColor Black 1450 | Write-Output "Enabling Razer Chroma SDK Server..." 1451 | Get-Service "Razer Chroma SDK Server" | Stop-Service -PassThru | Set-Service -StartupType automatic 1452 | Write-Output "Enabling Razer Chroma SDK Service..." 1453 | Get-Service "Razer Chroma SDK Service" | Stop-Service -PassThru | Set-Service -StartupType automatic 1454 | 1455 | Write-Output "Enabling WpnService, push notification anoyance service..." 1456 | Get-Service WpnService | Stop-Service -PassThru | Set-Service -StartupType automatic 1457 | 1458 | RegChange "System\CurrentControlSet\Services\WpnUserService*" "Start" "2" "Enabling WpnUserService, push notification anoyance service..." "DWord" 1459 | RegChange "Software\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" "NoGenTicket" "1" "Enabling Licence Checking..." "DWord" 1460 | 1461 | RegChange "SOFTWARE\Microsoft\Windows\Windows Error Reporting" "Disabled" "0" "Enabling Error reporting..." "DWord" 1462 | if ($(serviceStatus("Schedule")) -eq "running") { 1463 | Write-Host "Enabling Error reporting task..." 1464 | Get-ScheduledTask *QueueReporting* | Enable-ScheduledTask 1465 | } 1466 | 1467 | RegChange "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" "1" "Hiding This PC shortcut on desktop..." "DWord" 1468 | RegChange "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" "1" "Hiding This PC shortcut on desktop..." "DWord" 1469 | RegChange "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ShowSyncProviderNotifications" "1" "Enabling Windows Ads within file explorer..." "DWord" 1470 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableThirdPartySuggestions" "0" "Disabling Windows suggestions of apps and content from third-party software publishers..." "DWord" 1471 | RegChange "Control Panel\Mouse" "MouseSpeed" "1" "Disabling Windows enhanced pointer precision..." "DWord" 1472 | RegChange "Control Panel\Mouse" "MouseThreshold1" "6" "Enabling Windows enhanced pointer acceleration..." "DWord" 1473 | RegChange "Control Panel\Mouse" "MouseThreshold2" "10" "Enabling Windows enhanced pointer acceleration..." "DWord" 1474 | 1475 | # k-lite codec pack updater 1476 | deleteFile "$env:WINDIR\K-Lite Codec Pack\Tools\CodecTweakTool.exe" "Deleting SecurityHealthService.exe..." 1477 | } 1478 | 1479 | if ($doQualityOfLifeStuff -eq 1) { 1480 | RegChange "Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" "SaveZoneInformation" "2" "Disabling Attachment being locked when saved..." "DWord" 1481 | RegChange "Software\Microsoft\Windows\CurrentVersion\Policies\Associations" "DefaultFileTypeRisk" "6152" "Lowering attachments risk level to prevent user prompts..." "DWord" 1482 | RegChange "Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" "HideZoneInfoOnProperties" "0" "Enabling Unblock on the files Properties..." "DWord" 1483 | 1484 | Get-Service VMwareHostd | Stop-Service -PassThru | Set-Service -StartupType disabled 1485 | RegChange "SYSTEM\CurrentControlSet\services\VMwareHostd" "Start" "4" "Disabling VMware host..." "DWord" 1486 | 1487 | # Look for an app in the Microsoft Store 1488 | RegChange "Software\Policies\Microsoft\Windows\Explorer" "NoUseStoreOpenWith" "1" "Disabling Look for an app in the Microsoft Store" "DWord" 1489 | 1490 | RegChange "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "TaskbarDa" "0" "Removing widgets button from taskbar" "DWord" 1491 | RegChange "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "TaskbarMn" "0" "Removing chat button from taskbar" "DWord" 1492 | 1493 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" "SoftLandingEnabled" "0" "Disabling Get tips and suggestion when i use Windows" "DWord" 1494 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" "DisableAutomaticRestartSignOn" "1" "Disabling Windows Winlogon Automatic Restart Sign-On..." "DWord" 1495 | 1496 | RegChange "Software\Microsoft\Windows\CurrentVersion\Notifications\Settings" "NOC_GLOBAL_SETTING_TOASTS_ENABLED" "0" "Disabling Action Center global toasts..." "DWord" 1497 | 1498 | # Required for notification center bar 1499 | #RegChange "SOFTWARE\Policies\Microsoft\Windows\Explorer" "DisableNotificationCenter" "1" "Disabling Action Center notification center..." "DWord" 1500 | 1501 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications" "ToastEnabled" "0" "Disabling Action Center toast push notifications..." "DWord" 1502 | 1503 | RegChange "Control Panel\Accessibility" "DynamicScrollbars " "0" "Disabling dynamic scrollbars..." "DWord" 1504 | RegChange "SOFTWARE\Policies\Microsoft\MRT" "DontOfferThroughWUAU " "1" "Disabling Malicious Software Removal Tool offering" "DWord" 1505 | 1506 | write-Host "Fast Boot is known to cause problems with steam" -ForegroundColor Green -BackgroundColor Black 1507 | RegChange "SYSTEM\CurrentControlSet\Control\Session Manager\Power" "HiberbootEnabled" "0" "Disabling Fast boot..." "DWord" 1508 | powercfg /hibernate OFF 1509 | 1510 | Write-Host "RAZER services that allows third party software to mess with your keyboard backlight" -ForegroundColor Green -BackgroundColor Black 1511 | Write-Output "Disabling Razer Chroma SDK Server..." 1512 | Get-Service "Razer Chroma SDK Server" | Stop-Service -PassThru | Set-Service -StartupType disabled 1513 | Write-Output "Disabling Razer Chroma SDK Service..." 1514 | Get-Service "Razer Chroma SDK Service" | Stop-Service -PassThru | Set-Service -StartupType disabled 1515 | 1516 | Write-Output "Disabling WpnService, push notification anoyance service..." 1517 | Get-Service WpnService | Stop-Service -PassThru | Set-Service -StartupType disabled 1518 | 1519 | # WpnUserService is required by the taskbar to work properly 1520 | # RegChange "System\CurrentControlSet\Services\WpnUserService*" "Start" "4" "Disabling WpnUserService, push notification anoyance service..." "DWord" 1521 | 1522 | RegChange "Software\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" "NoGenTicket" "0" "Disabling Licence Checking..." "DWord" 1523 | RegChange "SOFTWARE\Microsoft\Windows\Windows Error Reporting" "Disabled" "1" "Disabling Error reporting..." "DWord" 1524 | if ($(serviceStatus("Schedule")) -eq "running") { 1525 | Write-Host "Disabling Error reporting task..." 1526 | Get-ScheduledTask *QueueReporting* | Disable-ScheduledTask 1527 | } 1528 | 1529 | RegChange "Control Panel\Accessibility\StickyKeys" "Flags" "506" "Disabling Sticky keys prompt..." "DWord" 1530 | RegChange "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" "0" "Show This PC shortcut on desktop..." "DWord" 1531 | RegChange "Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" "0" "Show This PC shortcut on desktop..." "DWord" 1532 | RegChange "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "ShowSyncProviderNotifications" "0" "Disabling Windows Ads within file explorer..." "DWord" 1533 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableThirdPartySuggestions" "1" "Disabling Windows suggestions of apps and content from third-party software publishers..." "DWord" 1534 | RegChange "Control Panel\Mouse" "MouseSpeed" "0" "Disabling Windows enhanced pointer precision..." "DWord" 1535 | RegChange "Control Panel\Mouse" "MouseThreshold1" "0" "Disabling Windows enhanced pointer acceleration..." "DWord" 1536 | RegChange "Control Panel\Mouse" "MouseThreshold2" "0" "Disabling Windows enhanced pointer acceleration..." "DWord" 1537 | } 1538 | 1539 | if ($doPrivacyStuff -eq 0) { 1540 | Write-Output "Reverse privacy stuff..." 1541 | 1542 | regDelete "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Option\CompatTelRunner.exe" "Enabling CompatTelRunner" 1543 | 1544 | EnableThumbnail 1545 | EnablePeek 1546 | EnablePrefetcher 1547 | EnableMemoryDump 1548 | 1549 | # Copilot 1550 | RegChange "Software\Policies\Microsoft\Windows\WindowsCopilot" "TurnOffWindowsCopilot" "0" "Enabling CoPilot..." "DWord" 1551 | RegChange "SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot" "TurnOffWindowsCopilot" "0" "Enabling CoPilot..." "DWord" 1552 | RegChange "SOFTWARE\Policies\Microsoft\Edge" "HubsSidebarEnabled" "1" "Enabling CoPilot..." "DWord" 1553 | RegChange "Software\Policies\Microsoft\Windows\Explorer" "DisableSearchBoxSuggestions" "0" "Enabling CoPilot..." "DWord" 1554 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Explorer" "DisableSearchBoxSuggestions" "0" "Enabling CoPilot..." "DWord" 1555 | 1556 | RegChange "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" "SensorPermissionState" "1" "Enabling Windows location tracking" "DWord" 1557 | RegChange "System\CurrentControlSet\Services\lfsvc\Service\Configuration" "Status" "1" "Enabling Windows location tracking" "DWord" 1558 | RegChange "Software\Microsoft\InputPersonalization" "RestrictImplicitInkCollection" "0" "Enabling Windows implicit ink collection" "DWord" 1559 | RegChange "Software\Microsoft\InputPersonalization" "RestrictImplicitTextCollection" "0" "Enabling Windows implicit text collection" "DWord" 1560 | RegChange "Software\Microsoft\InputPersonalization\TrainedDataStore" "HarvestContacts" "1" "Enabling Windows contact harvesting" "DWord" 1561 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" "Enabled" "1" "Enabling Windows Feedback Experience program / Advertising ID" "DWord" 1562 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Windows Search" "AllowCortana" "1" "Enabling Cortana from being used as part of your Windows Search Function" 1563 | RegChange "Software\Microsoft\Siuf\Rules" "NumberOfSIUFInPeriod" "1" "Enabling Windows Feedback Experience from sending anonymous data" "DWord" 1564 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableWindowsConsumerFeatures" "0" "Adding Registry key to allow bloatware apps from returning" "DWord" 1565 | RegChange "Software\Microsoft\Windows\CurrentVersion\Holographic" "FirstRunSucceeded" "1" "Enabling Reality Portal" "DWord" 1566 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" "NoTileApplicationNotification" "0" "Enabling live tiles" "DWord" 1567 | RegChange "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" "SensorPermissionState" "1" "Enabling Location Tracking" "DWord" 1568 | RegChange "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" "Status" "1" "Enabling Location Tracking" "DWord" 1569 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" "PeopleBand" "1" "Enabling People icon on Taskbar" "DWord" 1570 | RegChange "Software\Policies\Microsoft\Windows\Explorer" "HidePeopleBar" "0" "Enabling People Bar" "DWord" 1571 | RegChange "SOFTWARE\Policies\Microsoft\Windows\System" "EnableActivityFeed" "1" "Enabling Activity History Feed" "DWord" 1572 | RegChange "SOFTWARE\Policies\Microsoft\Windows\System" "PublishUserActivities" "1" "Enabling Activity History Feed" "DWord" 1573 | RegChange "SOFTWARE\Policies\Microsoft\Windows\System" "UploadUserActivities" "1" "Enabling Activity History Feed" "DWord" 1574 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableTailoredExperiencesWithDiagnosticData" "0" "Enabling Tailored Experiences" "DWord" 1575 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private" "AutoSetup" "1" "Enabling automatic installation of network devices" "DWord" 1576 | RegChange "SYSTEM\CurrentControlSet\Control\Terminal Server" "fDenyTSConnections" "0" "Enabling Remote Desktop" "DWord" 1577 | RegChange "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" "UserAuthentication" "0" "Enabling Remote Desktop" "DWord" 1578 | RegChange "SYSTEM\CurrentControlSet001\Control\Terminal Server" "fDenyTSConnections" "0" "Enabling Remote Desktop" 1579 | RegChange "SOFTWARE\Policies\Microsoft\Windows\TabletPC" "PreventHandwritingDataSharing" "0" "Enabling handwriting personalization data sharing..." "DWord" 1580 | RegChange "SOFTWARE\Policies\Microsoft\SQMClient\Windows" "CEIPEnable" "1" "Enabling Windows Customer Experience Improvement Program..." "DWord" 1581 | RegChange "SOFTWARE\Policies\Microsoft\AppV\CEIP" "CEIPEnable" "1" "Enabling Windows Customer Experience Improvement Program..." "DWord" 1582 | RegChange "SOFTWARE\Microsoft\SQMClient\IE" "CEIPEnable" "1" "Enabling Windows Customer Experience Improvement Program..." "DWord" 1583 | RegChange "SOFTWARE\Microsoft\SQMClient\IE" "SqmLoggerRunning" "1" "Enabling Windows Customer Experience Improvement Program..." "DWord" 1584 | RegChange "SOFTWARE\Microsoft\SQMClient\Windows" "CEIPEnable" "1" "Enabling Windows Customer Experience Improvement Program..." "DWord" 1585 | RegChange "SOFTWARE\Microsoft\SQMClient\Windows" "SqmLoggerRunning" "1" "Enabling Windows Customer Experience Improvement Program..." "DWord" 1586 | RegChange "SOFTWARE\Microsoft\SQMClient\Windows" "DisableOptinExperience" "0" "Enabling Windows Customer Experience Improvement Program..." "DWord" 1587 | RegChange "SOFTWARE\Microsoft\SQMClient\Reliability" "CEIPEnable" "1" "Enabling Windows Customer Experience Improvement Program..." "DWord" 1588 | RegChange "SOFTWARE\Microsoft\SQMClient\Reliability" "SqmLoggerRunning" "1" "Enabling Windows Customer Experience Improvement Program..." "DWord" 1589 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\AppModel" "Start" "1" "Enabling AutoLogger\AppModel..." "DWord" 1590 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\AutoLogger-Diagtrack-Listener" "Start" "1" "Enabling AutoLogger\AutoLogger-Diagtrack-Listener..." "DWord" 1591 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\Circular Kernel Context Logger" "Start" "1" "Enabling AutoLogger\Circular Kernel Context Logger..." "DWord" 1592 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\DataMarket" "Start" "1" "Enabling AutoLogger\DataMarket..." "DWord" 1593 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\DefenderApiLogger" "Start" "1" "Enabling AutoLogger\DefenderApiLogger..." "DWord" 1594 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\DefenderAuditLogger" "Start" "1" "Enabling AutoLogger\DefenderAuditLogger..." "DWord" 1595 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\DiagLog" "Start" "1" "Enabling AutoLogger\DiagLog..." "DWord" 1596 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\LwtNetLog" "Start" "1" "Enabling AutoLogger\LwtNetLog..." "DWord" 1597 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\Mellanox-Kernel" "Start" "1" "Enabling AutoLogger\Mellanox-Kernel..." "DWord" 1598 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\Microsoft-Windows-AssignedAccess-Trace" "Start" "1" "Enabling AutoLogger\Microsoft-Windows-AssignedAccess-Trace..." "DWord" 1599 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\Microsoft-Windows-Setup" "Start" "1" "Enabling AutoLogger\Microsoft-Windows-Setup..." "DWord" 1600 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\NBSMBLOGGER" "Start" "1" "Enabling AutoLogger\NBSMBLOGGER..." "DWord" 1601 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\NtfsLog" "Start" "1" "Enabling AutoLogger\NtfsLog..." "DWord" 1602 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\PEAuthLog" "Start" "1" "Enabling AutoLogger\PEAuthLog..." "DWord" 1603 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\RdrLog" "Start" "1" "Enabling AutoLogger\RdrLog..." "DWord" 1604 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\ReadyBoot" "Start" "1" "Enabling AutoLogger\ReadyBoot..." "DWord" 1605 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\SetupPlatform" "Start" "1" "Enabling AutoLogger\SetupPlatform..." "DWord" 1606 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\SetupPlatformTel" "Start" "1" "Enabling AutoLogger\SetupPlatformTel..." "DWord" 1607 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\SpoolerLogger" "Start" "1" "Enabling AutoLogger\SpoolerLogger..." "DWord" 1608 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\SQMLogger" "Start" "1" "Enabling AutoLogger\SQMLogger..." "DWord" 1609 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\TCPIPLOGGER" "Start" "1" "Enabling AutoLogger\TCPIPLOGGER..." "DWord" 1610 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\TileStore" "Start" "1" "Enabling AutoLogger\TileStore..." "DWord" 1611 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\UBPM" "Start" "1" "Enabling AutoLogger\UBPM..." "DWord" 1612 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\WdiContextLog" "Start" "1" "Enabling AutoLogger\WdiContextLog..." "DWord" 1613 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\WFP-IPsec Trace" "Start" "1" "Enabling AutoLogger\WFP-IPsec Trace..." "DWord" 1614 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\WiFiDriverIHVSessionRepro" "Start" "1" "Enabling AutoLogger\WiFiDriverIHVSessionRepro..." "DWord" 1615 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\WiFiSession" "Start" "1" "Enabling AutoLogger\WiFiSession..." "DWord" 1616 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\AppModel" "Start" "1" "Enabling AutoLogger\AppModel..." "DWord" 1617 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\AutoLogger-Diagtrack-Listener" "Start" "1" "Enabling AutoLogger\AutoLogger-Diagtrack-Listener..." "DWord" 1618 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\Circular Kernel Context Logger" "Start" "1" "Enabling AutoLogger\Circular Kernel Context Logger..." "DWord" 1619 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\DataMarket" "Start" "1" "Enabling AutoLogger\DataMarket..." "DWord" 1620 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\DefenderApiLogger" "Start" "1" "Enabling AutoLogger\DefenderApiLogger..." "DWord" 1621 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\DefenderAuditLogger" "Start" "1" "Enabling AutoLogger\DefenderAuditLogger..." "DWord" 1622 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\DiagLog" "Start" "1" "Enabling AutoLogger\DiagLog..." "DWord" 1623 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\LwtNetLog" "Start" "1" "Enabling AutoLogger\LwtNetLog..." "DWord" 1624 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\Mellanox-Kernel" "Start" "1" "Enabling AutoLogger\Mellanox-Kernel..." "DWord" 1625 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\Microsoft-Windows-AssignedAccess-Trace" "Start" "1" "Enabling AutoLogger\Microsoft-Windows-AssignedAccess-Trace..." "DWord" 1626 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\Microsoft-Windows-Setup" "Start" "1" "Enabling AutoLogger\Microsoft-Windows-Setup..." "DWord" 1627 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\NBSMBLOGGER" "Start" "1" "Enabling AutoLogger\NBSMBLOGGER..." "DWord" 1628 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\NtfsLog" "Start" "1" "Enabling AutoLogger\NtfsLog..." "DWord" 1629 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\PEAuthLog" "Start" "1" "Enabling AutoLogger\PEAuthLog..." "DWord" 1630 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\RdrLog" "Start" "1" "Enabling AutoLogger\RdrLog..." "DWord" 1631 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\ReadyBoot" "Start" "1" "Enabling AutoLogger\ReadyBoot..." "DWord" 1632 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\SetupPlatform" "Start" "1" "Enabling AutoLogger\SetupPlatform..." "DWord" 1633 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\SetupPlatformTel" "Start" "1" "Enabling AutoLogger\SetupPlatformTel..." "DWord" 1634 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\SpoolerLogger" "Start" "1" "Enabling AutoLogger\SpoolerLogger..." "DWord" 1635 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\SQMLogger" "Start" "1" "Enabling AutoLogger\SQMLogger..." "DWord" 1636 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\TCPIPLOGGER" "Start" "1" "Enabling AutoLogger\TCPIPLOGGER..." "DWord" 1637 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\TileStore" "Start" "1" "Enabling AutoLogger\TileStore..." "DWord" 1638 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\UBPM" "Start" "1" "Enabling AutoLogger\UBPM..." "DWord" 1639 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\WdiContextLog" "Start" "1" "Enabling AutoLogger\WdiContextLog..." "DWord" 1640 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\WFP-IPsec Trace" "Start" "1" "Enabling AutoLogger\WFP-IPsec Trace..." "DWord" 1641 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\WiFiDriverIHVSessionRepro" "Start" "1" "Enabling AutoLogger\WiFiDriverIHVSessionRepro..." "DWord" 1642 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\WiFiSession" "Start" "1" "Enabling AutoLogger\WiFiSession..." "DWord" 1643 | RegChange "SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" "AllowBuildPreview" "0" "Enabling Windows Insider Program..." "DWord" 1644 | 1645 | Write-Output "Setting network to private..." 1646 | Set-NetConnectionProfile -NetworkCategory Private 1647 | 1648 | Write-Output "Enabling Background application access..." 1649 | Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Exclude "Microsoft.Windows.Cortana*" | ForEach { 1650 | Set-ItemProperty -Path $_.PsPath -Name "Disabled" -Type DWord -Value 0 1651 | Set-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -Type DWord -Value 0 1652 | } 1653 | 1654 | if ($(serviceStatus("Schedule")) -eq "running") { 1655 | Write-Output "Enabling scheduled tasks, Consolidator, UsbCeip, DmClient..." 1656 | Get-ScheduledTask Consolidator | Enable-ScheduledTask 1657 | Get-ScheduledTask UsbCeip | Enable-ScheduledTask 1658 | Get-ScheduledTask DmClient | Enable-ScheduledTask 1659 | Get-ScheduledTask DmClientOnScenarioDownload | Enable-ScheduledTask 1660 | } 1661 | 1662 | # Diagnostics Tracking Service is a Windows keylogger to collect all the speeches, calendar, contacts, typing, inking informations 1663 | RegChange "SYSTEM\CurrentControlSet\Services\DiagTrack" "Start" "2" "Enabling DiagTrack (Connected User Experiences and Telemetry) service" "DWord" 1664 | Get-Service DiagTrack | Set-Service -StartupType automatic 1665 | 1666 | # dmwappushservice is a Windows keylogger to collect all the speeches, calendar, contacts, typing, inking informations 1667 | Get-Service dmwappushservice | Set-Service -StartupType automatic 1668 | 1669 | write-Host "Windows Insider Service contact web servers by its own" -ForegroundColor Green -BackgroundColor Black 1670 | Write-Host "Enabling wisvc (Windows Insider Service)..." 1671 | Get-Service wisvc | Set-Service -StartupType automatic 1672 | Get-Service CryptSvc | Set-Service -StartupType automatic 1673 | 1674 | Write-Host "Stopping and disabling EventLog (Windows Event Log)..." 1675 | Get-Service EventLog | Set-Service -StartupType automatic 1676 | 1677 | # Disable Ip helper due transfering a lot of strange data 1678 | RegChange "SYSTEM\CurrentControlSet\Services\iphlpsvc" "Start" "2" "Enabling Ip Helper service" "DWord" 1679 | Get-Service iphlpsvc | Set-Service -StartupType automatic 1680 | 1681 | Write-Host "Enabling Nvidia Telemetry service..." 1682 | Get-Service NvTelemetryContainer | Stop-Service -PassThru | Set-Service -StartupType automatic 1683 | } 1684 | 1685 | if ($doPrivacyStuff -eq 1) { 1686 | Write-Output "Doing privacy stuff..." 1687 | 1688 | killProcess("compattelrunner"); 1689 | deleteFile "$env:SystemRoot\System32\compattelrunner.exe" "Deleting office compattelrunner.exe..." 1690 | RegChange "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Option\CompatTelRunner.exe" "Debugger" "%windir%\System32\taskkill.exe" "Disabling CompatTelRunner..." "String" 1691 | 1692 | killProcess("CUH"); 1693 | deleteFile "$env:Programfiles(x86)\Corel\CUH\v2\CUH.exe" "Deleting Corel Updater (CUH.exe)..." 1694 | 1695 | clearCaches 1696 | DisableThumbnail 1697 | DisablePeek 1698 | DisablePrefetcher 1699 | DisableMemoryDump 1700 | 1701 | # Copilot 1702 | RegChange "Software\Policies\Microsoft\Windows\WindowsCopilot" "TurnOffWindowsCopilot" "1" "Disabling CoPilot..." "DWord" 1703 | RegChange "SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot" "TurnOffWindowsCopilot" "1" "Disabling CoPilot..." "DWord" 1704 | RegChange "SOFTWARE\Policies\Microsoft\Edge" "HubsSidebarEnabled" "0" "Disabling CoPilot..." "DWord" 1705 | RegChange "Software\Policies\Microsoft\Windows\Explorer" "DisableSearchBoxSuggestions" "1" "Disabling CoPilot..." "DWord" 1706 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Explorer" "DisableSearchBoxSuggestions" "1" "Disabling CoPilot..." "DWord" 1707 | 1708 | RegChange "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" "SensorPermissionState" "0" "Disabling Windows location tracking" "DWord" 1709 | RegChange "System\CurrentControlSet\Services\lfsvc\Service\Configuration" "Status" "0" "Disabling Windows location tracking" "DWord" 1710 | RegChange "Software\Microsoft\InputPersonalization" "RestrictImplicitInkCollection" "1" "Disabling Windows implicit ink collection" "DWord" 1711 | RegChange "Software\Microsoft\InputPersonalization" "RestrictImplicitTextCollection" "1" "Disabling Windows implicit text collection" "DWord" 1712 | RegChange "Software\Microsoft\InputPersonalization\TrainedDataStore" "HarvestContacts" "0" "Disabling Windows contact harvesting" "DWord" 1713 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" "Enabled" "0" "Disabling Windows Feedback Experience program / Advertising ID" 1714 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Windows Search" "AllowCortana" "0" "Stopping Cortana from being used as part of your Windows Search Function" 1715 | RegChange "Software\Microsoft\Siuf\Rules" "NumberOfSIUFInPeriod" "0" "Disabling Windows Feedback Experience from sending anonymous data" 1716 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableWindowsConsumerFeatures" "1" "Adding Registry key to prevent bloatware apps from returning" 1717 | RegChange "Software\Microsoft\Windows\CurrentVersion\Holographic" "FirstRunSucceeded" "0" "Disabling Reality Portal" 1718 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" "NoTileApplicationNotification" "1" "Disabling live tiles" 1719 | RegChange "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" "SensorPermissionState" "0" "Disabling Location Tracking" 1720 | RegChange "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" "Status" "0" "Disabling Location Tracking" 1721 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" "PeopleBand" "0" "Disabling People icon on Taskbar" 1722 | RegChange "Software\Policies\Microsoft\Windows\Explorer" "HidePeopleBar" "1" "Disabling People Bar" 1723 | RegChange "SOFTWARE\Policies\Microsoft\Windows\System" "EnableActivityFeed" "0" "Disabling Activity History Feed" 1724 | RegChange "SOFTWARE\Policies\Microsoft\Windows\System" "PublishUserActivities" "0" "Disabling Activity History Feed" 1725 | RegChange "SOFTWARE\Policies\Microsoft\Windows\System" "UploadUserActivities" "0" "Disabling Activity History Feed" 1726 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CloudContent" "DisableTailoredExperiencesWithDiagnosticData" "1" "Disabling Tailored Experiences" 1727 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\NcdAutoSetup\Private" "AutoSetup" "0" "Disabling automatic installation of network devices" 1728 | RegChange "SYSTEM\CurrentControlSet\Control\Terminal Server" "fDenyTSConnections" "1" "Disabling Remote Desktop" 1729 | RegChange "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" "UserAuthentication" "1" "Disabling Remote Desktop" 1730 | RegChange "SYSTEM\CurrentControlSet001\Control\Terminal Server" "fDenyTSConnections" "1" "Disabling Remote Desktop" 1731 | RegChange "SYSTEM\CurrentControlSet001\Control\Terminal Server\WinStations\RDP-Tcp" "UserAuthentication" "1" "Disabling Remote Desktop" 1732 | RegChange "SOFTWARE\Policies\Microsoft\Windows\TabletPC" "PreventHandwritingDataSharing" "1" "Disabling handwriting personalization data sharing..." "DWord" 1733 | RegChange "SOFTWARE\Policies\Microsoft\SQMClient\Windows" "CEIPEnable" "0" "Disabling Windows Customer Experience Improvement Program..." "DWord" 1734 | RegChange "SOFTWARE\Policies\Microsoft\AppV\CEIP" "CEIPEnable" "0" "Disabling Windows Customer Experience Improvement Program..." "DWord" 1735 | RegChange "SOFTWARE\Microsoft\SQMClient\IE" "CEIPEnable" "0" "Disabling Windows Customer Experience Improvement Program..." "DWord" 1736 | RegChange "SOFTWARE\Microsoft\SQMClient\IE" "SqmLoggerRunning" "0" "Disabling Windows Customer Experience Improvement Program..." "DWord" 1737 | RegChange "SOFTWARE\Microsoft\SQMClient\Windows" "CEIPEnable" "0" "Disabling Windows Customer Experience Improvement Program..." "DWord" 1738 | RegChange "SOFTWARE\Microsoft\SQMClient\Windows" "SqmLoggerRunning" "0" "Disabling Windows Customer Experience Improvement Program..." "DWord" 1739 | RegChange "SOFTWARE\Microsoft\SQMClient\Windows" "DisableOptinExperience" "1" "Disabling Windows Customer Experience Improvement Program..." "DWord" 1740 | RegChange "SOFTWARE\Microsoft\SQMClient\Reliability" "CEIPEnable" "0" "Disabling Windows Customer Experience Improvement Program..." "DWord" 1741 | RegChange "SOFTWARE\Microsoft\SQMClient\Reliability" "SqmLoggerRunning" "0" "Disabling Windows Customer Experience Improvement Program..." "DWord" 1742 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\AppModel" "Start" "0" "Disabling AutoLogger\AppModel..." "DWord" 1743 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\AutoLogger-Diagtrack-Listener" "Start" "0" "Disabling AutoLogger\AutoLogger-Diagtrack-Listener..." "DWord" 1744 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\Circular Kernel Context Logger" "Start" "0" "Disabling AutoLogger\Circular Kernel Context Logger..." "DWord" 1745 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\DataMarket" "Start" "0" "Disabling AutoLogger\DataMarket..." "DWord" 1746 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\DefenderApiLogger" "Start" "0" "Disabling AutoLogger\DefenderApiLogger..." "DWord" 1747 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\DefenderAuditLogger" "Start" "0" "Disabling AutoLogger\DefenderAuditLogger..." "DWord" 1748 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\DiagLog" "Start" "0" "Disabling AutoLogger\DiagLog..." "DWord" 1749 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\LwtNetLog" "Start" "0" "Disabling AutoLogger\LwtNetLog..." "DWord" 1750 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\Mellanox-Kernel" "Start" "0" "Disabling AutoLogger\Mellanox-Kernel..." "DWord" 1751 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\Microsoft-Windows-AssignedAccess-Trace" "Start" "0" "Disabling AutoLogger\Microsoft-Windows-AssignedAccess-Trace..." "DWord" 1752 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\Microsoft-Windows-Setup" "Start" "0" "Disabling AutoLogger\Microsoft-Windows-Setup..." "DWord" 1753 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\NBSMBLOGGER" "Start" "0" "Disabling AutoLogger\NBSMBLOGGER..." "DWord" 1754 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\NtfsLog" "Start" "0" "Disabling AutoLogger\NtfsLog..." "DWord" 1755 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\PEAuthLog" "Start" "0" "Disabling AutoLogger\PEAuthLog..." "DWord" 1756 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\RdrLog" "Start" "0" "Disabling AutoLogger\RdrLog..." "DWord" 1757 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\ReadyBoot" "Start" "0" "Disabling AutoLogger\ReadyBoot..." "DWord" 1758 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\SetupPlatform" "Start" "0" "Disabling AutoLogger\SetupPlatform..." "DWord" 1759 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\SetupPlatformTel" "Start" "0" "Disabling AutoLogger\SetupPlatformTel..." "DWord" 1760 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\SpoolerLogger" "Start" "0" "Disabling AutoLogger\SpoolerLogger..." "DWord" 1761 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\SQMLogger" "Start" "0" "Disabling AutoLogger\SQMLogger..." "DWord" 1762 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\TCPIPLOGGER" "Start" "0" "Disabling AutoLogger\TCPIPLOGGER..." "DWord" 1763 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\TileStore" "Start" "0" "Disabling AutoLogger\TileStore..." "DWord" 1764 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\UBPM" "Start" "0" "Disabling AutoLogger\UBPM..." "DWord" 1765 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\WdiContextLog" "Start" "0" "Disabling AutoLogger\WdiContextLog..." "DWord" 1766 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\WFP-IPsec Trace" "Start" "0" "Disabling AutoLogger\WFP-IPsec Trace..." "DWord" 1767 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\WiFiDriverIHVSessionRepro" "Start" "0" "Disabling AutoLogger\WiFiDriverIHVSessionRepro..." "DWord" 1768 | RegChange "SYSTEM\ControlSet001\Control\WMI\AutoLogger\WiFiSession" "Start" "0" "Disabling AutoLogger\WiFiSession..." "DWord" 1769 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\AppModel" "Start" "0" "Disabling AutoLogger\AppModel..." "DWord" 1770 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\AutoLogger-Diagtrack-Listener" "Start" "0" "Disabling AutoLogger\AutoLogger-Diagtrack-Listener..." "DWord" 1771 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\Circular Kernel Context Logger" "Start" "0" "Disabling AutoLogger\Circular Kernel Context Logger..." "DWord" 1772 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\DataMarket" "Start" "0" "Disabling AutoLogger\DataMarket..." "DWord" 1773 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\DefenderApiLogger" "Start" "0" "Disabling AutoLogger\DefenderApiLogger..." "DWord" 1774 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\DefenderAuditLogger" "Start" "0" "Disabling AutoLogger\DefenderAuditLogger..." "DWord" 1775 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\DiagLog" "Start" "0" "Disabling AutoLogger\DiagLog..." "DWord" 1776 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\LwtNetLog" "Start" "0" "Disabling AutoLogger\LwtNetLog..." "DWord" 1777 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\Mellanox-Kernel" "Start" "0" "Disabling AutoLogger\Mellanox-Kernel..." "DWord" 1778 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\Microsoft-Windows-AssignedAccess-Trace" "Start" "0" "Disabling AutoLogger\Microsoft-Windows-AssignedAccess-Trace..." "DWord" 1779 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\Microsoft-Windows-Setup" "Start" "0" "Disabling AutoLogger\Microsoft-Windows-Setup..." "DWord" 1780 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\NBSMBLOGGER" "Start" "0" "Disabling AutoLogger\NBSMBLOGGER..." "DWord" 1781 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\NtfsLog" "Start" "0" "Disabling AutoLogger\NtfsLog..." "DWord" 1782 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\PEAuthLog" "Start" "0" "Disabling AutoLogger\PEAuthLog..." "DWord" 1783 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\RdrLog" "Start" "0" "Disabling AutoLogger\RdrLog..." "DWord" 1784 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\ReadyBoot" "Start" "0" "Disabling AutoLogger\ReadyBoot..." "DWord" 1785 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\SetupPlatform" "Start" "0" "Disabling AutoLogger\SetupPlatform..." "DWord" 1786 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\SetupPlatformTel" "Start" "0" "Disabling AutoLogger\SetupPlatformTel..." "DWord" 1787 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\SpoolerLogger" "Start" "0" "Disabling AutoLogger\SpoolerLogger..." "DWord" 1788 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\SQMLogger" "Start" "0" "Disabling AutoLogger\SQMLogger..." "DWord" 1789 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\TCPIPLOGGER" "Start" "0" "Disabling AutoLogger\TCPIPLOGGER..." "DWord" 1790 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\TileStore" "Start" "0" "Disabling AutoLogger\TileStore..." "DWord" 1791 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\UBPM" "Start" "0" "Disabling AutoLogger\UBPM..." "DWord" 1792 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\WdiContextLog" "Start" "0" "Disabling AutoLogger\WdiContextLog..." "DWord" 1793 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\WFP-IPsec Trace" "Start" "0" "Disabling AutoLogger\WFP-IPsec Trace..." "DWord" 1794 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\WiFiDriverIHVSessionRepro" "Start" "0" "Disabling AutoLogger\WiFiDriverIHVSessionRepro..." "DWord" 1795 | RegChange "SYSTEM\ControlSet\Control\WMI\AutoLogger\WiFiSession" "Start" "0" "Disabling AutoLogger\WiFiSession..." "DWord" 1796 | RegChange "SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" "AllowBuildPreview" "0" "Disabling Windows Insider Program..." "DWord" 1797 | 1798 | Set-NetConnectionProfile -NetworkCategory Public 1799 | 1800 | Write-Output "Disabling Background application access..." 1801 | Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\BackgroundAccessApplications" -Exclude "Microsoft.Windows.Cortana*" | ForEach { 1802 | Set-ItemProperty -Path $_.PsPath -Name "Disabled" -Type DWord -Value 1 1803 | Set-ItemProperty -Path $_.PsPath -Name "DisabledByUser" -Type DWord -Value 1 1804 | } 1805 | 1806 | if ($(serviceStatus("Schedule")) -eq "running") { 1807 | Write-Output "Disabling scheduled tasks, Consolidator, UsbCeip, DmClient..." 1808 | Get-ScheduledTask Consolidator | Disable-ScheduledTask 1809 | Get-ScheduledTask UsbCeip | Disable-ScheduledTask 1810 | Get-ScheduledTask DmClient | Disable-ScheduledTask 1811 | Get-ScheduledTask DmClientOnScenarioDownload | Disable-ScheduledTask 1812 | } 1813 | 1814 | # Diagnostics Tracking Service is a Windows keylogger to collect all the speeches, calendar, contacts, typing, inking informations 1815 | RegChange "SYSTEM\CurrentControlSet\Services\DiagTrack" "Start" "4" "Disabling DiagTrack (Connected User Experiences and Telemetry) service" "DWord" 1816 | Get-Service DiagTrack | Set-Service -StartupType disabled 1817 | 1818 | 1819 | 1820 | # dmwappushservice is a Windows keylogger to collect all the speeches, calendar, contacts, typing, inking informations 1821 | Get-Service dmwappushservice | Set-Service -StartupType disabled 1822 | 1823 | $path = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger" 1824 | deletePath $path "Clearing ETL Autologs..." 1825 | hardenPath $path "Hardening ETL Autologs folder..." 1826 | 1827 | write-Host "AppHostRegistrationVerifier tries to connect to 13.107.246.19 port 443 when the pc is idle for no known reason." -ForegroundColor Green -BackgroundColor Black 1828 | deleteFile "$env:WINDIR\system32\AppHostRegistrationVerifier.exe" "Deleting AppHostRegistrationVerifier.exe..." 1829 | deleteFile "$env:WINDIR\system32\wbem\wmiprvse.exe" "Deleting WMI Provider Host..." 1830 | 1831 | write-Host "Windows Insider Service contact web servers by its own" -ForegroundColor Green -BackgroundColor Black 1832 | Write-Host "Stopping and disabling wisvc (Windows Insider Service)..." 1833 | Get-Service wisvc | Stop-Service -PassThru | Set-Service -StartupType disabled 1834 | 1835 | # EventLog disabled causes Windows to crash 1836 | # Write-Host "Stopping and disabling EventLog (Windows Event Log)..." 1837 | # Get-Service EventLog | Stop-Service -PassThru | Set-Service -StartupType disabled 1838 | 1839 | # Disable Ip helper due transfering a lot of strange data 1840 | RegChange "SYSTEM\CurrentControlSet\Services\iphlpsvc" "Start" "4" "Disabling Ip Helper service" "DWord" 1841 | Get-Service iphlpsvc | Set-Service -StartupType disabled 1842 | 1843 | Write-Host "Disabling Nvidia Telemetry service..." 1844 | Get-Service NvTelemetryContainer | Stop-Service -PassThru | Set-Service -StartupType disabled 1845 | } 1846 | 1847 | if ($doSecurityStuff -eq 0) { 1848 | # Airstrike Attack - FDE bypass and EoP on domain joined Windows workstations. An attacker with physical access to a locked device with WiFi capabilities (such as a laptop or a workstation) can abuse this functionality to force the laptop to authenticate against a rogue access point and capture a MSCHAPv2 challenge response hash for the domain computer account. 1849 | RegChange "SOFTWARE\Policies\Microsoft\Windows\System" "DontDisplayNetworkSelectionUI" "0" "Disabling the hardening against the Airstrike Attack" "DWord" 1850 | 1851 | RegChange "SYSTEM\CurrentControlSet\services\WMPNetworkSvc" "Start" "2" "Enabling Windows Media Player Network Sharing Service" "DWord" 1852 | 1853 | # WPAD exposes the system to MITM attack 1854 | RegChange "SYSTEM\CurrentControlSet\Services\WinHttpAutoProxySvc" "Start" "2" "Enabling WPAD WinHttpAutoProxySvc Service" "DWord" 1855 | 1856 | RegChange "SYSTEM\CurrentControlSet\services\Dnscache" "Start" "2" "Enabling DNS Cache Service" "DWord" 1857 | EnableLLMNR 1858 | 1859 | # NetBIOS imposes security risk for layer-4 name resolution spoofing attacks, ARP poisoning, KARMA attack and cache poisoning. 1860 | RegChange "SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces\Tcpip*" "NetbiosOptions" "0" "Enabling NetBIOS over TCP/IP..." "DWord" 1861 | 1862 | #Allowing Anonymous logon users to list all account names and enumerate all shared resources can provide a map of potential points to attack the system. (Stig Viewer V-220930) 1863 | RegChange "SYSTEM\CurrentControlSet\Control\Lsa" "RestrictAnonymous" "0" "Allowing Anonymous enumeration of shares (Allowing anonymous logon users to list all account names and enumerate all shared resources can provide a map of potential points to attack the system.)- Stig Viewer V-220930" "Dword" 1864 | RegChange "SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" "Value" "1" "Enabling Wi-Fi Sense" "Dword" 1865 | RegChange "SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" "Value" "1" "Enabling Wi-Fi Sense, it connects you to open hotspots that are greenlighted through crowdsourcing. Openning doors to Lure10 MITM attack and phishing" "Dword" 1866 | RegChange "SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" "AutoConnectAllowedOEM" "1" "Enabling Wi-Fi Sense" 1867 | RegChange "SYSTEM\CurrentControlSet\Control\Remote Assistance" "fAllowToGetHelp" "1" "Enabling Remote Assistance (RA). RA may allow unauthorized parties access to the resources on the computer. (Stigviewer V-220823)" 1868 | RegChange "SYSTEM\CurrentControlSet001\Control\Remote Assistance" "fAllowToGetHelp" "1" "Enabling Remote Assistance" 1869 | RegChange "SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" "fAllowToGetHelp" "1" "Enabling Remote Assistance" 1870 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer" "NoDriveTypeAutoRun" "149" "Enabling autoplay " "DWord" 1871 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Explorer" "NoAutoplayfornonVolume" "0" "Enabling autoplay " "DWord" 1872 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Explorer" "NoAutorun" "0" "Enabling autorun " "DWord" 1873 | 1874 | # Protect against credential scraping, mimikatz attack 1875 | # Configures lsass.exe as a protected process and disables wdigest 1876 | # Enables delegation of non-exported credentials which enables support for Restricted Admin Mode or Remote Credential Guard 1877 | RegChange "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\LSASS.exe" "AuditLevel" "8" "Hardening LSASS... " "DWord" 1878 | RegChange "SYSTEM\CurrentControlSet\Control\Lsa" "RunAsPPL" "0" "Hardening LSASS... " "DWord" 1879 | RegChange "SYSTEM\CurrentControlSet\Control\Lsa" "DisableRestrictedAdmin" "1" "Hardening LSASS... " "DWord" 1880 | RegChange "SYSTEM\CurrentControlSet\Control\Lsa" "DisableRestrictedAdminOutboundCreds" "0" "Hardening LSASS... " "DWord" 1881 | RegChange "SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest" "UseLogonCredential" "1" "Hardening LSASS... " "DWord" 1882 | RegChange "SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest" "Negotiate" "1" "Hardening LSASS... " "DWord" 1883 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation" "AllowProtectedCreds" "0" "Hardening LSASS... " "DWord" 1884 | 1885 | #Enable the LSA protection to prevent Mimikatz from accessing a specific memory location of the LSASS process and scraping credentials 1886 | RegChange "SYSTEM\CurrentControlSet\Control\Lsa" "RunAsPPL" "0" "Hardening LSASS... " "DWord" 1887 | RegChange "SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest" "UseLogonCredential" "1" "Hardening LSASS... " "DWord" 1888 | 1889 | #Windows 10 must be configured to enable Remote host allows delegation of non-exportable credentials. (Stig Viewer V-74699) 1890 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation" "AllowProtectedCreds" "0" "Hardening LSASS... " "DWord" 1891 | 1892 | Write-Host "Enabling Network Location Awareness Service..." 1893 | Enable-NetAdapterBinding -Name "*" -ComponentID "ms_msclient" 1894 | 1895 | Write-Host "Enabling Network Location Awareness Service..." 1896 | Get-Service NlaSvc | Set-Service -StartupType automatic 1897 | } 1898 | 1899 | if ($doSecurityStuff -eq 1) { 1900 | # Airstrike Attack - FDE bypass and EoP on domain joined Windows workstations. An attacker with physical access to a locked device with WiFi capabilities (such as a laptop or a workstation) can abuse this functionality to force the laptop to authenticate against a rogue access point and capture a MSCHAPv2 challenge response hash for the domain computer account. 1901 | RegChange "SOFTWARE\Policies\Microsoft\Windows\System" "DontDisplayNetworkSelectionUI" "1" "Hardening against the Airstrike Attack" "DWord" 1902 | RegChange "SYSTEM\CurrentControlSet\services\WMPNetworkSvc" "Start" "4" "Disabling Windows Media Player Network Sharing Service" "DWord" 1903 | 1904 | if ($bePrinterSafe -eq 0) { 1905 | # WPAD exposes the system to MITM attack 1906 | RegChange "SYSTEM\CurrentControlSet\Services\WinHttpAutoProxySvc" "Start" "4" "Disabling WPAD WinHttpAutoProxySvc Service" "DWord" 1907 | } else { 1908 | # WPAD exposes the system to MITM attack 1909 | RegChange "SYSTEM\CurrentControlSet\Services\WinHttpAutoProxySvc" "Start" "2" "Enabling WPAD WinHttpAutoProxySvc Service" "DWord" 1910 | } 1911 | DisableLLMNR 1912 | 1913 | Write-Output "Flushing DNS." 1914 | ipconfig /flushDNS 1915 | if ($beWSL2Safe -eq 0) { 1916 | RegChange "SYSTEM\CurrentControlSet\services\Dnscache" "Start" "4" "Disabling DNS Cache Service" "DWord" 1917 | } 1918 | 1919 | # NetBIOS imposes security risk for layer-4 name resolution spoofing attacks, ARP poisoning, KARMA attack and cache poisoning. 1920 | RegChange "SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces\Tcpip*" "NetbiosOptions" "2" "Disabling NetBIOS over TCP/IP..." "DWord" 1921 | 1922 | #Allowing Anonymous logon users to list all account names and enumerate all shared resources can provide a map of potential points to attack the system. (Stig Viewer V-220930) 1923 | RegChange "SYSTEM\CurrentControlSet\Control\Lsa" "RestrictAnonymous" "1" "Disabling Anonymous enumeration of shares..." "Dword" 1924 | RegChange "SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" "Value" "0" "Disabling Wi-Fi Sense" "Dword" 1925 | RegChange "SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" "Value" "0" "Disabling Wi-Fi Sense, it connects you to open hotspots that are greenlighted through crowdsourcing. Openning doors to Lure10 MITM attack and phishing" "Dword" 1926 | RegChange "SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config" "AutoConnectAllowedOEM" "0" "Disabling Wi-Fi Sense" 1927 | RegChange "SYSTEM\CurrentControlSet\Control\Remote Assistance" "fAllowToGetHelp" "0" "Disabling Remote Assistance (RA). RA may allow unauthorized parties access to the resources on the computer. (Stigviewer V-220823)" 1928 | RegChange "SYSTEM\CurrentControlSet001\Control\Remote Assistance" "fAllowToGetHelp" "0" "Disabling Remote Assistance" 1929 | RegChange "SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" "fAllowToGetHelp" "0" "Disabling Remote Assistance" 1930 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer" "NoDriveTypeAutoRun" "255" "Disabling autoplay " "DWord" 1931 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Explorer" "NoAutoplayfornonVolume" "1" "Disabling autoplay " "DWord" 1932 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Explorer" "NoAutorun" "1" "Disabling autorun " "DWord" 1933 | 1934 | # Protect against credential scraping, mimikatz attack 1935 | # Configures lsass.exe as a protected process and disables wdigest 1936 | # Enables delegation of non-exported credentials which enables support for Restricted Admin Mode or Remote Credential Guard 1937 | RegChange "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\LSASS.exe" "AuditLevel" "8" "Hardening LSASS... " "DWord" 1938 | RegChange "SYSTEM\CurrentControlSet\Control\Lsa" "RunAsPPL" "1" "Hardening LSASS... " "DWord" 1939 | RegChange "SYSTEM\CurrentControlSet\Control\Lsa" "DisableRestrictedAdmin" "0" "Hardening LSASS... " "DWord" 1940 | RegChange "SYSTEM\CurrentControlSet\Control\Lsa" "DisableRestrictedAdminOutboundCreds" "1" "Hardening LSASS... " "DWord" 1941 | RegChange "SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest" "UseLogonCredential" "0" "Hardening LSASS... " "DWord" 1942 | RegChange "SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest" "Negotiate" "0" "Hardening LSASS... " "DWord" 1943 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation" "AllowProtectedCreds" "1" "Hardening LSASS... " "DWord" 1944 | 1945 | #Enable the LSA protection to prevent Mimikatz from accessing a specific memory location of the LSASS process and scraping credentials 1946 | RegChange "SYSTEM\CurrentControlSet\Control\Lsa" "RunAsPPL" "1" "Hardening LSASS... " "DWord" 1947 | RegChange "SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest" "UseLogonCredential" "0" "Hardening LSASS... " "DWord" 1948 | 1949 | #Windows 10 must be configured to enable Remote host allows delegation of non-exportable credentials. (Stig Viewer V-74699) 1950 | RegChange "SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation" "AllowProtectedCreds" "1" "Hardening LSASS... " "DWord" 1951 | 1952 | if ($beNetworkFolderSafe -eq 0) { 1953 | Write-Host "Disabling Network Location Awareness Service..." 1954 | Disable-NetAdapterBinding -Name "*" -ComponentID "ms_msclient" 1955 | 1956 | Write-Host "Disabling Network Location Awareness Service..." 1957 | Get-Service NlaSvc | Set-Service -StartupType disabled 1958 | } 1959 | 1960 | if ($beNetworkFolderSafe -eq 1) { 1961 | Write-Host "Enabling Network Location Awareness Service..." 1962 | Get-Service NlaSvc | Set-Service -StartupType automatic 1963 | } 1964 | } 1965 | 1966 | if ($doFingerprintPrevention -eq 0) { 1967 | RegChange "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" "NoRecentDocsHistory" "0" "Enabling Recent docs history " "DWord" 1968 | RegChange "Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" "SaveZoneInformation" "0" "Enabling Windows save zone information..." "DWord" 1969 | RegChange "SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet" "EnableActiveProbing" "1" "Enabling internet connection test... " "DWord" 1970 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" "NoRecycleFiles" "1" "Enabling recycle bin... " "DWord" 1971 | 1972 | # DNS-over-HTTPS (DoH) encrypt the communication between the client and the resolver to prevent the inspection of domain names by network eavesdroppers 1973 | RegChange "SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" "EnableAutoDoh" "0" "Disabling DNS over HTTPS (DoH)... " "DWord" 1974 | } 1975 | 1976 | if ($doFingerprintPrevention -eq 1) { 1977 | RegChange "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" "NoRecentDocsHistory" "1" "Disabling Recent docs history " "DWord" 1978 | RegChange "Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" "SaveZoneInformation" "1" "Disabling Windows save zone information..." "DWord" 1979 | RegChange "SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet" "EnableActiveProbing" "0" "Disabling internet connection test... " "DWord" 1980 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" "NoRecycleFiles" "1" "Disabling recycle bin... " "DWord" 1981 | 1982 | # DNS-over-HTTPS (DoH) encrypt the communication between the client and the resolver to prevent the inspection of domain names by network eavesdroppers 1983 | RegChange "SYSTEM\CurrentControlSet\Services\Dnscache\Parameters" "EnableAutoDoh" "2" "Enabling DNS over HTTPS (DoH)... " "DWord" 1984 | } 1985 | 1986 | if ($darkTheme -eq 0) { 1987 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" "AppsUseLightTheme" "1" "Disabling dark theme mode" "DWord" 1988 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" "SystemUsesLightTheme" "1" "Disabling dark theme for system" "DWord" 1989 | } 1990 | 1991 | if ($darkTheme -eq 1) { 1992 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" "AppsUseLightTheme" "0" "Enabling dark theme mode" "DWord" 1993 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" "SystemUsesLightTheme" "0" "Enabling dark theme for system" "DWord" 1994 | } 1995 | 1996 | if ($disableWindowsFirewall -eq 0) { 1997 | Write-Host "Enabling MpsSvc (Windows Firewall Service)..." 1998 | Get-Service MpsSvc | Set-Service -StartupType automatic 1999 | Write-Host "Enabling Windows Firewall..." 2000 | Get-NetFirewallProfile | Set-NetFirewallProfile -Enabled True | Out-Null 2001 | RegChange "SYSTEM\CurrentControlSet\Services\MpsSvc" "Start" "2" "Enabling Windows Firewall service..." "DWord" 2002 | } 2003 | 2004 | if ($disableWindowsFirewall -eq 1) { 2005 | Write-Host "Stopping and disabling MpsSvc (Windows Firewall Service)..." 2006 | Get-Service MpsSvc | Stop-Service -PassThru | Set-Service -StartupType disabled 2007 | Write-Host "Disabling Windows Firewall..." 2008 | Get-NetFirewallProfile | Set-NetFirewallProfile -Enabled False | Out-Null 2009 | RegChange "SYSTEM\CurrentControlSet\Services\MpsSvc" "Start" "4" "Disabling Windows Firewall service..." "DWord" 2010 | } 2011 | 2012 | if ($firefoxSettings -eq 1) { 2013 | killProcess("firefox"); 2014 | 2015 | $PrefsFiles = Get-Item -Path ($env:APPDATA+"\Mozilla\Firefox\Profiles\*\prefs.js") 2016 | $currentDate = Get-Date -UFormat "%Y-%m-%d-%Hh%M" 2017 | 2018 | $aboutConfigArr = @('geo.enabled', 'general.warnOnAboutConfig', 'dom.push.enabled', 'dom.webnotifications.enabled', 'app.update.auto', 'app.update.checkInstallTime', 'app.update.auto.migrated', 'app.update.service.enabled', 'identity.fxaccounts.enabled', 'privacy.firstparty.isolate', 'privacy.firstparty.isolate.block_post_message', 'privacy.resistFingerprinting', 'browser.cache.offline.enable', 'browser.send_pings', 'browser.sessionstore.max_tabs_undo', 'dom.battery.enabled', 'dom.event.clipboardevents.enabled', 'browser.startup.homepage_override.mstone','browser.cache.disk.capacity', 'dom.event.contextmenu.enabled', 'media.videocontrols.picture-in-picture.video-toggle.enabled', 'skipConfirmLaunchExecutable', 'activity-stream.disableSnippets', 'browser.messaging-system.whatsNewPanel.enabled', 'extensions.htmlaboutaddons.recommendations.enabled', 'extensions.pocket.onSaveRecs', 'extensions.pocket.enabled', 'browser.aboutConfig.showWarning', 'browser.search.widget.inNavBar', 'browser.urlbar.richSuggestions.tail', 'browser.tabs.warnOnCloseOtherTabs', 'network.trr.mode', 'network.trr.uri', 'network.trr.bootstrapAddress', 'network.security.esni.enabled', 'network.dns.echconfig.enabled', 'network.dns.use_https_rr_as_altsvc', 'browser.topsites.blockedSponsors', 'app.update.BITS.enabled', 'app.update.background.interval', 'media.autoplay.default', 'browser.search.widget.inNavBar', 'browser.contentblocking.category', 'network.cookie.cookieBehavior', 'browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons', 'browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features', 'browser.uiCustomization.state','browser.newtabpage.activity-stream.feeds.telemetry','browser.newtabpage.activity-stream.telemetry','browser.ping-centre.telemetry','datareporting.healthreport.service.enabled','datareporting.healthreport.uploadEnabled','datareporting.policy.dataSubmissionEnabled','datareporting.sessions.current.clean','devtools.onboarding.telemetry.logged','toolkit.telemetry.archive.enabled','toolkit.telemetry.bhrPing.enabled','toolkit.telemetry.enabled','toolkit.telemetry.firstShutdownPing.enabled','toolkit.telemetry.hybridContent.enabled','toolkit.telemetry.newProfilePing.enabled','toolkit.telemetry.prompted','toolkit.telemetry.rejected','toolkit.telemetry.reportingpolicy.firstRun','toolkit.telemetry.server','toolkit.telemetry.shutdownPingSender.enabled','toolkit.telemetry.unified','toolkit.telemetry.unifiedIsOptIn','toolkit.telemetry.updatePing.enabled','app.shield.optoutstudies.enabled') 2019 | 2020 | foreach ($file in $PrefsFiles) { 2021 | $path = Get-ItemProperty -Path $file 2022 | Write-Output "editing $path" 2023 | $out = @() 2024 | 2025 | :Outer foreach ($line in Get-Content $file){ 2026 | foreach ($aboutConfigArr2 in $aboutConfigArr){ 2027 | if ($line -match $aboutConfigArr2) { 2028 | continue Outer 2029 | } 2030 | } 2031 | $out+= $line 2032 | } 2033 | 2034 | $out+= 'user_pref("geo.enabled", false);' 2035 | $out+= 'user_pref("general.warnOnAboutConfig", false);' 2036 | $out+= 'user_pref("dom.push.enabled", false);' 2037 | $out+= 'user_pref("dom.webnotifications.enabled", false);' 2038 | $out+= 'user_pref("identity.fxaccounts.enabled", false);' 2039 | $out+= 'user_pref("privacy.resistFingerprinting", true);' 2040 | $out+= 'user_pref("browser.cache.offline.enable", false);' 2041 | $out+= 'user_pref("browser.send_pings", false);' 2042 | $out+= 'user_pref("browser.sessionstore.max_tabs_undo", 0);' 2043 | $out+= 'user_pref("dom.battery.enabled", false);' 2044 | $out+= 'user_pref("dom.event.clipboardevents.enabled", false);' 2045 | $out+= 'user_pref("browser.startup.homepage_override.mstone", ignore);' 2046 | $out+= 'user_pref("browser.cache.disk.capacity", 10000000);' 2047 | $out+= 'user_pref("dom.event.contextmenu.enabled", false);' 2048 | $out+= 'user_pref("media.videocontrols.picture-in-picture.video-toggle.enabled", false);' 2049 | $out+= 'user_pref("browser.download.skipConfirmLaunchExecutable", true);' 2050 | $out+= 'user_pref("browser.newtabpage.activity-stream.disableSnippets", true);' 2051 | $out+= 'user_pref("browser.messaging-system.whatsNewPanel.enabled", false);' 2052 | $out+= 'user_pref("extensions.htmlaboutaddons.recommendations.enabled", false);' 2053 | $out+= 'user_pref("extensions.pocket.onSaveRecs", false);' 2054 | $out+= 'user_pref("extensions.pocket.enabled", false);' 2055 | $out+= 'user_pref("browser.aboutConfig.showWarning", false);' 2056 | $out+= 'user_pref("browser.urlbar.richSuggestions.tail", false);' 2057 | $out+= 'user_pref("browser.tabs.warnOnCloseOtherTabs", false);' 2058 | 2059 | # Disable cross-domain cookie access 2060 | $out+= 'user_pref("privacy.firstparty.isolate", true);' 2061 | $out+= 'user_pref("privacy.firstparty.isolate.block_post_message", true);' 2062 | 2063 | # Disable update 2064 | $out+= 'user_pref("app.update.auto", false);' 2065 | $out+= 'user_pref("app.update.checkInstallTime", false);' 2066 | $out+= 'user_pref("app.update.auto.migrated", false);' 2067 | $out+= 'user_pref("app.update.service.enabled", false);' 2068 | $out+= 'user_pref("app.update.BITS.enabled", false);' 2069 | $out+= 'user_pref("app.update.background.interval", "999999999");' 2070 | 2071 | # DNS-over-HTTPS (DoH) encrypt the communication between the client and the resolver to prevent the inspection of domain names by network eavesdroppers 2072 | $out+= 'user_pref("network.trr.mode", 2);' 2073 | $out+= 'user_pref("network.trr.uri", "https://dns.google/dns-query");' 2074 | $out+= 'user_pref("network.trr.bootstrapAddress", "8.8.8.8");' 2075 | 2076 | # Enable Encrypted Client Hello (ECH) on Firefox, to prevent TLS from leaking any data by encrypting all messages; 2077 | $out+= 'user_pref("network.dns.echconfig.enabled", true);' 2078 | $out+= 'user_pref("network.dns.use_https_rr_as_altsvc", true);' 2079 | 2080 | # Remove Amazon`s shortcut from startup 2081 | $out+= 'user_pref("browser.topsites.blockedSponsors", "[\"amazon\",\"trivago\",\"booking\"]");' 2082 | 2083 | # Allow autoplay of audio and video 2084 | $out+= 'user_pref("media.autoplay.default", "0");' 2085 | 2086 | # Show search bar 2087 | $out+= 'user_pref("browser.search.widget.inNavBar", true);' 2088 | $out+= 'user_pref("browser.uiCustomization.state", "{\"placements\":{\"widget-overflow-fixed-list\":[],\"nav-bar\":[\"back-button\",\"forward-button\",\"stop-reload-button\",\"customizableui-special-spring1\",\"urlbar-container\",\"search-container\",\"customizableui-special-spring2\",\"save-to-pocket-button\",\"downloads-button\",\"fxa-toolbar-menu-button\",\"addon_darkreader_org-browser-action\",\"ublock0_raymondhill_net-browser-action\"],\"toolbar-menubar\":[\"menubar-items\"],\"TabsToolbar\":[\"tabbrowser-tabs\",\"new-tab-button\",\"alltabs-button\"],\"PersonalToolbar\":[\"personal-bookmarks\"]},\"seen\":[\"addon_darkreader_org-browser-action\",\"ublock0_raymondhill_net-browser-action\",\"developer-button\"],\"dirtyAreaCache\":[\"nav-bar\"],\"currentVersion\":17,\"newElementCount\":2}");' 2089 | 2090 | # Block third-party cookies 2091 | $out+= 'user_pref("browser.contentblocking.category", "custom");' 2092 | $out+= 'user_pref("network.cookie.cookieBehavior", "1");' 2093 | 2094 | # Disable recommendations 2095 | $out+= 'user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons", false);' 2096 | $out+= 'user_pref("browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features", false);' 2097 | 2098 | # Telemetry and data collection 2099 | $out+= 'user_pref("browser.newtabpage.activity-stream.feeds.telemetry", false);' 2100 | $out+= 'user_pref("browser.newtabpage.activity-stream.telemetry", false);' 2101 | $out+= 'user_pref("browser.ping-centre.telemetry", false);' 2102 | $out+= 'user_pref("datareporting.healthreport.service.enabled", false);' 2103 | $out+= 'user_pref("datareporting.healthreport.uploadEnabled", false);' 2104 | $out+= 'user_pref("datareporting.policy.dataSubmissionEnabled", false);' 2105 | $out+= 'user_pref("datareporting.sessions.current.clean", true);' 2106 | $out+= 'user_pref("devtools.onboarding.telemetry.logged", false);' 2107 | $out+= 'user_pref("toolkit.telemetry.archive.enabled", false);' 2108 | $out+= 'user_pref("toolkit.telemetry.bhrPing.enabled", false);' 2109 | $out+= 'user_pref("toolkit.telemetry.enabled", false);' 2110 | $out+= 'user_pref("toolkit.telemetry.firstShutdownPing.enabled", false);' 2111 | $out+= 'user_pref("toolkit.telemetry.hybridContent.enabled", false);' 2112 | $out+= 'user_pref("toolkit.telemetry.newProfilePing.enabled", false);' 2113 | $out+= 'user_pref("toolkit.telemetry.prompted", 2);' 2114 | $out+= 'user_pref("toolkit.telemetry.rejected", true);' 2115 | $out+= 'user_pref("toolkit.telemetry.reportingpolicy.firstRun", false);' 2116 | $out+= 'user_pref("toolkit.telemetry.server", "");' 2117 | $out+= 'user_pref("toolkit.telemetry.shutdownPingSender.enabled", false);' 2118 | $out+= 'user_pref("toolkit.telemetry.unified", false);' 2119 | $out+= 'user_pref("toolkit.telemetry.unifiedIsOptIn", false);' 2120 | $out+= 'user_pref("toolkit.telemetry.updatePing.enabled", false);' 2121 | $out+= 'user_pref("app.shield.optoutstudies.enabled", false);' 2122 | 2123 | Copy-Item $file $file$currentDate".txt" 2124 | 2125 | Clear-Content $file 2126 | Add-Content $file $out 2127 | 2128 | Write-Output "Updated $path" 2129 | } 2130 | } 2131 | 2132 | if ($firefoxCachePath) { 2133 | killProcess("firefox"); 2134 | $PrefsFiles = Get-Item -Path ($env:SystemDrive+"\Users\*\AppData\Roaming\Mozilla\Firefox\Profiles\*\prefs.js") 2135 | $currentDate = Get-Date -UFormat "%Y-%m-%d-%Hh%M" 2136 | $aboutConfigArr = @('*"browser.cache.disk.parent_directory"*','*"browser.cache.disk.capacity"*','*"browser.cache.disk.smart_size.enabled"*') 2137 | 2138 | foreach ($file in $PrefsFiles) { 2139 | $path = Get-ItemProperty -Path $file 2140 | Write-Output "editing $path" 2141 | $out = @() 2142 | 2143 | foreach ($line in Get-Content $file){ 2144 | $matchAboutConfig = 0 2145 | foreach ($aboutConfigArr2 in $aboutConfigArr){ 2146 | if ($line -like $aboutConfigArr2) { 2147 | $matchAboutConfig = 1 2148 | } 2149 | } 2150 | 2151 | if ($matchAboutConfig -eq 0) { 2152 | $out+= $line 2153 | } 2154 | } 2155 | 2156 | $out+= 'user_pref("browser.cache.disk.smart_size.enabled", false);' 2157 | $out+= 'user_pref("browser.cache.disk.capacity", 25000000);' 2158 | $out+= 'user_pref("browser.cache.disk.parent_directory", "' + $firefoxCachePath + '");' 2159 | Copy-Item $file $file$currentDate".txt" 2160 | Clear-Content $file 2161 | Add-Content $file $out 2162 | Write-Output "Updated $path" 2163 | } 2164 | } 2165 | 2166 | if ($remove3dObjFolder -eq 0) { 2167 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" "a" "1" "Enabling 3D Objects from explorer My Computer submenu" "DWord" 2168 | RegChange "SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" "a" "1" "Enabling 3D Objects from explorer My Computer submenu" "DWord" 2169 | } 2170 | 2171 | if ($remove3dObjFolder -eq 1) { 2172 | Write-Host "Removing 3D Objects from explorer 'My Computer' submenu" 2173 | regDelete "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" "Removing 3D Objects from explorer My Computer submenu" 2174 | regDelete "SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" "Removing 3D Objects from explorer My Computer submenu" 2175 | } 2176 | 2177 | if ($disableWindowsSounds -eq 1) { 2178 | Write-Host "Disabling Windows sound effects..." 2179 | Get-ChildItem -Path "HKCU:\AppEvents\Schemes\Apps" | Get-ChildItem | Get-ChildItem | Where-Object {$_.PSChildName -eq ".Current"} | Set-ItemProperty -Name "(Default)" -Value ".None" 2180 | } 2181 | 2182 | 2183 | if ($disablePerformanceMonitor -eq 1) { 2184 | deletePath "$env:WINDIR\System32\SleepStudy" "Clearing SleepStudy event trace session log..." 2185 | deletePath "$env:WINDIR\System32\SleepStudy\ScreenOn" "Clearing ScreenOn event trace session log..." 2186 | deletePath "$env:WINDIR\System32\LogFiles\WMI" "Clearing RadioMgr/WMI event trace session log..." 2187 | deletePath "$env:WINDIR\System32\LogFiles\WMI\RtBackup" "Clearing RadioMgr/WMI event trace session log..." 2188 | 2189 | Write-Output "Stopping and disabling PLA service Performance Logs & Alerts" 2190 | Get-Service pla | Stop-Service -PassThru | Set-Service -StartupType disabled 2191 | Get-Service PerfHost | Stop-Service -PassThru | Set-Service -StartupType disabled 2192 | } 2193 | 2194 | if ($beAppxSafe -eq 1) { 2195 | # Windows update services are required for Appx to work 2196 | $disableWindowsUpdates = 0; 2197 | } 2198 | 2199 | if ($disableWindowsUpdates -eq 0) { 2200 | RegChange "SYSTEM\CurrentControlSet\Services\UsoSvc" "Start" "2" "Enabling UsoSvc service" "DWord" 2201 | Get-Service UsoSvc | Set-Service -StartupType automatic 2202 | 2203 | RegChange "SYSTEM\CurrentControlSet\Services\CryptSvc" "Start" "2" "CryptSvc service enabled" "DWord" 2204 | Get-Service CryptSvc | Set-Service -StartupType automatic 2205 | 2206 | 2207 | RegChange "SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" "Start" "2" "Windows Update Medic Service enabled" "DWord" 2208 | Get-Service WaaSMedicSvc | Set-Service -StartupType automatic 2209 | 2210 | RegChange "SYSTEM\CurrentControlSet\Services\wuauserv" "Start" "2" "Windows Updates service enabled" "DWord" 2211 | Get-Service wuauserv | Set-Service -StartupType automatic 2212 | 2213 | # BITS (Background Intelligent Transfer Service), its aggressive bandwidth eating will interfere with you online gameplay, work and navigation. Its aggressive disk usable will reduce your HDD or SSD lifespan 2214 | RegChange "SYSTEM\CurrentControlSet\Services\BITS" "Start" "2" "BITS (Background Intelligent Transfer Service) enabled" "DWord" 2215 | Get-Service BITS | Set-Service -StartupType automatic 2216 | 2217 | RegChange "SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" "NoAutoUpdate" "0" "Windows Update enabled" "DWord" 2218 | 2219 | # This enable "Receive updates for other Microsoft products" 2220 | regDelete "SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" "Clearing network profiles..." 2221 | 2222 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Device Metadata" "PreventDeviceMetadataFromNetwork" "0" "Enabling retrieve device metadata for installed devices from the Internet" "DWord" 2223 | RegChange "SOFTWARE\Policies\Microsoft\Windows\DriverSearching" "DontPromptForWindowsUpdate" "0" "Enabling prompt to search Windows Update" "DWord" 2224 | RegChange "SOFTWARE\Policies\Microsoft\Windows\DriverSearching" "DontSearchWindowsUpdate" "0" "Enabling Windows Update to search for device drivers when no local drivers for a device are present" "DWord" 2225 | RegChange "SOFTWARE\Policies\Microsoft\Windows\DriverSearching" "DriverUpdateWizardWuSearchEnabled" "1" "Enabling DriverUpdateWizardWuSearchEnabled" "DWord" 2226 | RegChange "SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" "ExcludeWUDriversInQualityUpdate" "0" "Enabling Windows Update to include updates that have a Driver classification" "DWord" 2227 | } 2228 | 2229 | if ($disableWindowsUpdates -eq 1) { 2230 | RegChange "SYSTEM\CurrentControlSet\Services\UsoSvc" "Start" "4" "Disabling UsoSvc service" "DWord" 2231 | Get-Service UsoSvc | Set-Service -StartupType disabled 2232 | 2233 | RegChange "SYSTEM\CurrentControlSet\Services\CryptSvc" "Start" "4" "Disabling CryptSvc service" "DWord" 2234 | Get-Service CryptSvc | Set-Service -StartupType disabled 2235 | 2236 | 2237 | RegChange "SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" "Start" "4" "Disabling Windows Update Medic Service" "DWord" 2238 | Get-Service WaaSMedicSvc | Set-Service -StartupType disabled 2239 | 2240 | RegChange "SYSTEM\CurrentControlSet\Services\wuauserv" "Start" "4" "Disabling Windows Updates service" "DWord" 2241 | Get-Service wuauserv | Set-Service -StartupType disabled 2242 | 2243 | # BITS (Background Intelligent Transfer Service), its aggressive bandwidth eating will interfere with you online gameplay, work and navigation. Its aggressive disk usable will reduce your HDD or SSD lifespan 2244 | RegChange "SYSTEM\CurrentControlSet\Services\BITS" "Start" "4" "Disabling BITS (Background Intelligent Transfer Service)" "DWord" 2245 | Get-Service BITS | Set-Service -StartupType disabled 2246 | 2247 | RegChange "SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" "NoAutoUpdate" "1" "Windows Update enabled" "DWord" 2248 | RegChange "SOFTWARE\Policies\Microsoft\Windows\Device Metadata" "PreventDeviceMetadataFromNetwork" "1" "Disabling retrieve device metadata for installed devices from the Internet" "DWord" 2249 | RegChange "SOFTWARE\Policies\Microsoft\Windows\DriverSearching" "DontPromptForWindowsUpdate" "1" "Disabling prompt to search Windows Update" "DWord" 2250 | RegChange "SOFTWARE\Policies\Microsoft\Windows\DriverSearching" "DontSearchWindowsUpdate" "1" "Disabling Windows Update to search for device drivers when no local drivers for a device are present" "DWord" 2251 | RegChange "SOFTWARE\Policies\Microsoft\Windows\DriverSearching" "DriverUpdateWizardWuSearchEnabled" "0" "Disabling DriverUpdateWizardWuSearchEnabled" "DWord" 2252 | RegChange "SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" "ExcludeWUDriversInQualityUpdate" "1" "Disabling Windows Update to include updates that have a Driver classification" "DWord" 2253 | 2254 | } 2255 | 2256 | if ($useGoogleDNS -eq 1) { 2257 | $DC = "8.8.8.8" 2258 | $Internet = "8.8.4.4" 2259 | $dns = "$DC", "$Internet" 2260 | 2261 | $Interface = Get-WmiObject Win32_NetworkAdapterConfiguration 2262 | Write-Host "Registering DNS $dns" -ForegroundColor Green 2263 | $Interface.SetDNSServerSearchOrder($dns) | Out-Null 2264 | } 2265 | 2266 | if ($unnistallWindowsDefender -eq 1) { 2267 | Write-Output "Checking if you are in safe mode..." 2268 | $mySafeMode = gwmi win32_computersystem | select BootupState 2269 | if ($mySafeMode -notlike '*Normal boot*') { 2270 | write-host 'Safe mode confirmed.' 2271 | } else { 2272 | write-host 'System needs to be in safe mode to unninstall Windows Defender.' -ForegroundColor Black -BackgroundColor Red 2273 | } 2274 | 2275 | takeownRegistry("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinDefend") 2276 | 2277 | Write-Output "Disabling Windows Defender Application Guard..." 2278 | Disable-WindowsOptionalFeature -FeatureName "Windows-Defender-ApplicationGuard" -NoRestart -WarningAction SilentlyContinue | Out-Null 2279 | 2280 | deletePath "$env:Programfiles\windows defender" "Deleting Defender run under demand service MpCmdRun.exe..." 2281 | deletePath "$env:Programfiles\Windows Defender Advanced Threat Protection" "Deleting Windows Defender Advanced Threat Protection folder..." 2282 | deletePath "$env:Programfiles(x86)\Windows Defender" "Deleting windows Windows defender x86 folder..." 2283 | deletePath "$env:ProgramData\Microsoft\Windows Defender" "Deleting Defender Antivirus and Defender Antivirus Network Inspection Service folder..." 2284 | deletePath "$env:ProgramData\Microsoft\Windows Defender\Platform" "Deleting Defender run under demand service MpCmdRun.exe..." 2285 | deletePath "$env:ProgramData\Microsoft\Windows Defender Advanced Threat Protection" "Deleting windows Windows defender program data folder..." 2286 | deletePath "$env:ProgramData\Microsoft\Windows Security Health" "Deleting windows Windows defender program data folder..." 2287 | 2288 | regDeleteKey "SOFTWARE\Microsoft\Windows\CurrentVersion\Run\" "SecurityHealth" "Disabling SecurityHealth startup" 2289 | 2290 | RegChange "SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" "SpynetReporting" "0" "Disabling Windows Defender Cloud..." "DWord" 2291 | RegChange "SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" "SubmitSamplesConsent" "2" "Disabling Windows Defender Cloud Sample..." "DWord" 2292 | RegChange "Software\Policies\Microsoft\Windows Defender" "DisableConfig" "1" "Disabling Windows Anti Spyware - DisableConfig" 2293 | RegChange "Software\Policies\Microsoft\Windows Defender" "DisableAntiSpyware" "1" "Disabling Windows Anti Spyware - DisableAntiSpyware" 2294 | RegChange "SYSTEM\CurrentControlSet\Services\WdBoot" "Start" "4" "Disabling WdBoot (Windows Defender)" 2295 | RegChange "SYSTEM\CurrentControlSet\Services\WdFilter" "Start" "4" "Disabling WdFilter (Windows Defender)" 2296 | RegChange "SYSTEM\CurrentControlSet\Services\WdNisDrv" "Start" "4" "Disabling WdNisDrv (Windows Defender)" 2297 | RegChange "SYSTEM\CurrentControlSet\Services\WdNisSvc" "Start" "4" "Disabling WdNisSvc (Windows Defender)" 2298 | RegChange "SYSTEM\CurrentControlSet\Services\WinDefend" "Start" "4" "Disabling WinDefend (Windows Defender)" 2299 | RegChange "SYSTEM\CurrentControlSet\Services\wscsvc" "Start" "4" "Disabling Windows Security Service Center" 2300 | RegChange "SYSTEM\CurrentControlSet\Services\SecurityHealthService" "Start" "4" "Disabling SecurityHealthService (Windows Defender)" 2301 | RegChange "SYSTEM\CurrentControlSet\Services\Sense" "Start" "4" "Disabling Sense (Windows Defender)" 2302 | RegChange "SYSTEM\ControlSet001\Services\WinDefend" "Start" "4" "Disabling WinDefend (Windows Defender)" 2303 | 2304 | # WebThreatDefSvc 2305 | RegChange "SYSTEM\ControlSet001\Services\webthreatdefsvc" "Start" "4" "Disabling WebThreatDefSvc" "DWord" 2306 | Get-Service webthreatdefsvc | Set-Service -StartupType disabled 2307 | RegChange "SYSTEM\ControlSet001\Services\webthreatdefusersvc" "Start" "4" "Disabling WebThreatDefSvc" "DWord" 2308 | Get-Service webthreatdefusersvc | Set-Service -StartupType disabled 2309 | 2310 | # Disable SmartScreen Filter 2311 | RegChange "Software\Microsoft\Windows\CurrentVersion\Explorer" "SmartScreenEnabled" "Off" "Disabling SmartScreen Filter" "String" 2312 | RegChange "Software\Microsoft\Windows\CurrentVersion\AppHost" "EnableWebContentEvaluation" "0" "Disabling SmartScreen Filter" "DWord" 2313 | 2314 | # Necessary bacause Windows still load this service even if its disabled 2315 | deleteFile "$env:WINDIR\system32\SecurityHealthService.exe" "Deleting SecurityHealthService.exe..." 2316 | 2317 | sc.exe config WinDefend start=disabled | Out-Null 2318 | if($?){ write-Host -ForegroundColor Green "Windows Updates Service Disabled" }else{ write-Host -ForegroundColor red "Windows Updates Service Not Disabled" } 2319 | 2320 | Set-MpPreference -DisableRealtimeMonitoring $true -EA SilentlyContinue 2321 | if($?){ write-Host -ForegroundColor Green "Windows Defender Current Session Disabled" }else{ write-Host -ForegroundColor Green "Windows Defender Current Session not running" } 2322 | 2323 | Set-ItemProperty -Path "HKLM:Software\Policies\Microsoft\Windows Defender" -Name "DisableRoutinelyTakingAction" -Type DWord -Value 1 2324 | if($?){ write-Host -ForegroundColor Green "Windows Defender DisableRoutinelyTakingAction Disabled" }else{ write-Host -ForegroundColor red "Windows Defender DisableRoutinelyTakingAction Not Disabled" } 2325 | 2326 | Set-ItemProperty -Path "HKLM:Software\Microsoft\Windows Defender\Real-Time Protection" -Name "DisableBehaviorMonitoring" -Type DWord -Value 1 2327 | if($?){ write-Host -ForegroundColor Green "Windows DisableBehaviorMonitoring Disabled" }else{ write-Host -ForegroundColor red "Windows DisableBehaviorMonitoring not Disabled" } 2328 | 2329 | Set-ItemProperty -Path "HKLM:Software\Microsoft\Windows Defender\Real-Time Protection" -Name "DisableAntiSpywareRealtimeProtection" -Type DWord -Value 1 2330 | if($?){ write-Host -ForegroundColor Green "Windows DisableAntiSpywareRealtimeProtection Disabled" }else{ write-Host -ForegroundColor red "Windows DisableAntiSpywareRealtimeProtection not Disabled" } 2331 | 2332 | Set-ItemProperty -Path "HKLM:Software\Microsoft\Windows Defender\Real-Time Protection" -Name "DisableOnAccessProtection" -Type DWord -Value 1 2333 | if($?){ write-Host -ForegroundColor Green "Windows On Access Protection Disabled" }else{ write-Host -ForegroundColor red "Windows On Access Protection not Disabled" } 2334 | 2335 | Set-ItemProperty -Path "HKLM:Software\Microsoft\Windows Defender\Real-Time Protection" -Name "DisableScanOnRealtimeEnable" -Type DWord -Value 1 2336 | if($?){ write-Host -ForegroundColor Green "Windows Real Time Protection Disabled" }else{ write-Host -ForegroundColor red "Windows Real Time Protection not Disabled" } 2337 | 2338 | # Disable AllowUpdateService 2339 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Update\AllowUpdateService")) { 2340 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Update\AllowUpdateService" | Out-Null 2341 | } 2342 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Update\AllowUpdateService" -Name "value" -Type DWord -Value 0 2343 | if($?){ write-Host -ForegroundColor Green "Windows AllowUpdateService disabled" }else{ write-Host -ForegroundColor red "Windows AllowUpdateService not disabled" } 2344 | 2345 | # Disable AllowAutoUpdate 2346 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Update\AllowAutoUpdate")) { 2347 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Update\AllowAutoUpdate" | Out-Null 2348 | } 2349 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Update\AllowAutoUpdate" -Name "value" -Type DWord -Value 5 2350 | if($?){ write-Host -ForegroundColor Green "Windows AllowAutoUpdate disabled" }else{ write-Host -ForegroundColor red "Windows AllowAutoUpdate not disabled" } 2351 | 2352 | # Disable Windows Defender AllowArchiveScanning 2353 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowArchiveScanning")) { 2354 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowArchiveScanning" | Out-Null 2355 | } 2356 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowArchiveScanning" -Name "value" -Type DWord -Value 0 2357 | if($?){ write-Host -ForegroundColor Green "Windows Defender AllowArchiveScanning disabled" }else{ write-Host -ForegroundColor red "Windows Defender AllowArchiveScanning not disabled" } 2358 | 2359 | # Disable Windows Defender AllowBehaviorMonitoring 2360 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowBehaviorMonitoring")) { 2361 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowBehaviorMonitoring" | Out-Null 2362 | } 2363 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowBehaviorMonitoring" -Name "value" -Type DWord -Value 0 2364 | if($?){ write-Host -ForegroundColor Green "Windows Defender AllowBehaviorMonitoring disabled" }else{ write-Host -ForegroundColor red "Windows Defender AllowBehaviorMonitoring not disabled" } 2365 | 2366 | # Disable Windows Defender AllowCloudProtection 2367 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowCloudProtection")) { 2368 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowCloudProtection" | Out-Null 2369 | } 2370 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowCloudProtection" -Name "value" -Type DWord -Value 0 2371 | if($?){ write-Host -ForegroundColor Green "Windows Defender AllowCloudProtection disabled" }else{ write-Host -ForegroundColor red "Windows Defender AllowCloudProtection not disabled" } 2372 | 2373 | # Disable Windows Defender AllowIntrusionPreventionSystem 2374 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowIntrusionPreventionSystem")) { 2375 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowIntrusionPreventionSystem" | Out-Null 2376 | } 2377 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowIntrusionPreventionSystem" -Name "value" -Type DWord -Value 0 2378 | if($?){ write-Host -ForegroundColor Green "Windows Defender AllowIntrusionPreventionSystem disabled" }else{ write-Host -ForegroundColor red "Windows Defender AllowIntrusionPreventionSystem not disabled" } 2379 | 2380 | # Disable Windows Defender AllowIOAVProtection 2381 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowIOAVProtection")) { 2382 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowIOAVProtection" | Out-Null 2383 | } 2384 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowIOAVProtection" -Name "value" -Type DWord -Value 0 2385 | if($?){ write-Host -ForegroundColor Green "Windows Defender AllowIOAVProtection disabled" }else{ write-Host -ForegroundColor red "Windows Defender AllowIOAVProtection not disabled" } 2386 | 2387 | # Disable Windows Defender AllowOnAccessProtection 2388 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowOnAccessProtection")) { 2389 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowOnAccessProtection" | Out-Null 2390 | } 2391 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowOnAccessProtection" -Name "value" -Type DWord -Value 0 2392 | if($?){ write-Host -ForegroundColor Green "Windows Defender AllowOnAccessProtection disabled" }else{ write-Host -ForegroundColor red "Windows Defender AllowOnAccessProtection not disabled" } 2393 | 2394 | # Disable Windows Defender AllowRealtimeMonitoring 2395 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowRealtimeMonitoring")) { 2396 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowRealtimeMonitoring" | Out-Null 2397 | } 2398 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowRealtimeMonitoring" -Name "value" -Type DWord -Value 0 2399 | if($?){ write-Host -ForegroundColor Green "Windows Defender AllowRealtimeMonitoring disabled" }else{ write-Host -ForegroundColor red "Windows Defender AllowRealtimeMonitoring not disabled" } 2400 | 2401 | # Disable Windows Defender AllowScanningNetworkFiles 2402 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowScanningNetworkFiles")) { 2403 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowScanningNetworkFiles" | Out-Null 2404 | } 2405 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowScanningNetworkFiles" -Name "value" -Type DWord -Value 0 2406 | if($?){ write-Host -ForegroundColor Green "Windows Defender AllowScanningNetworkFiles disabled" }else{ write-Host -ForegroundColor red "Windows Defender AllowScanningNetworkFiles not disabled" } 2407 | 2408 | # Disable Windows Defender AllowScriptScanning 2409 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowScriptScanning")) { 2410 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowScriptScanning" | Out-Null 2411 | } 2412 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowScriptScanning" -Name "value" -Type DWord -Value 0 2413 | if($?){ write-Host -ForegroundColor Green "Windows Defender AllowScriptScanning disabled" }else{ write-Host -ForegroundColor red "Windows Defender AllowScriptScanning not disabled" } 2414 | 2415 | # Disable Windows Defender DisableCatchupFullScan 2416 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\DisableCatchupFullScan")) { 2417 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\DisableCatchupFullScan" | Out-Null 2418 | } 2419 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\DisableCatchupFullScan" -Name "value" -Type DWord -Value 0 2420 | if($?){ write-Host -ForegroundColor Green "Windows Defender DisableCatchupFullScan disabled" }else{ write-Host -ForegroundColor red "Windows Defender DisableCatchupFullScan not disabled" } 2421 | 2422 | # Disable Windows Defender DisableCatchupQuickScan 2423 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\DisableCatchupQuickScan")) { 2424 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\DisableCatchupQuickScan" | Out-Null 2425 | } 2426 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\DisableCatchupQuickScan" -Name "value" -Type DWord -Value 0 2427 | if($?){ write-Host -ForegroundColor Green "Windows Defender DisableCatchupQuickScan disabled" }else{ write-Host -ForegroundColor red "Windows Defender DisableCatchupQuickScan not disabled" } 2428 | 2429 | # Disable Windows Defender EnableNetworkProtection 2430 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\EnableNetworkProtection")) { 2431 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\EnableNetworkProtection" | Out-Null 2432 | } 2433 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\EnableNetworkProtection" -Name "value" -Type DWord -Value 0 2434 | if($?){ write-Host -ForegroundColor Green "Windows Defender EnableNetworkProtection disabled" }else{ write-Host -ForegroundColor red "Windows Defender EnableNetworkProtection not disabled" } 2435 | 2436 | # Disable Windows Defender PUAProtection 2437 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\PUAProtection")) { 2438 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\PUAProtection" | Out-Null 2439 | } 2440 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\PUAProtection" -Name "value" -Type DWord -Value 0 2441 | if($?){ write-Host -ForegroundColor Green "Windows Defender PUAProtection disabled" }else{ write-Host -ForegroundColor red "Windows Defender PUAProtection not disabled" } 2442 | 2443 | # Change Windows Defender RealTimeScanDirection to monitor only outgoing files 2444 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\RealTimeScanDirection")) { 2445 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\RealTimeScanDirection" | Out-Null 2446 | } 2447 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\RealTimeScanDirection" -Name "value" -Type DWord -Value 2 2448 | if($?){ write-Host -ForegroundColor Green "Changed Windows Defender RealTimeScanDirection to monitor only outgoing files" }else{ write-Host -ForegroundColor red "Windows RealTimeScanDirection not changed" } 2449 | 2450 | # Disable Windows Defender AllowEmailScanning 2451 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowEmailScanning")) { 2452 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowEmailScanning" | Out-Null 2453 | } 2454 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Defender\AllowEmailScanning" -Name "value" -Type DWord -Value 0 2455 | if($?){ write-Host -ForegroundColor Green "Windows Defender AllowEmailScanning disabled" }else{ write-Host -ForegroundColor red "Windows Defender AllowEmailScanning not disabled" } 2456 | } 2457 | 2458 | if ($unnistallOneDrive -eq 1) { 2459 | 2460 | Write-Output "Checking if you are in safe mode..." 2461 | $mySafeMode = gwmi win32_computersystem | select BootupState 2462 | if ($mySafeMode -notlike '*Normal boot*') { 2463 | write-host 'Safe mode confirmed.' 2464 | 2465 | killProcess("OneDrive"); 2466 | killProcess("explorer"); 2467 | 2468 | Write-Output "Remove OneDrive" 2469 | if (Test-Path "$env:systemroot\System32\OneDriveSetup.exe") { 2470 | & "$env:systemroot\System32\OneDriveSetup.exe" /uninstall 2471 | } 2472 | if (Test-Path "$env:systemroot\SysWOW64\OneDriveSetup.exe") { 2473 | & "$env:systemroot\SysWOW64\OneDriveSetup.exe" /uninstall 2474 | } 2475 | 2476 | Write-Output "Removing OneDrive leftovers" 2477 | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" 2478 | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" 2479 | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:systemdrive\OneDriveTemp" 2480 | # check if directory is empty before removing: 2481 | If ((Get-ChildItem "$env:userprofile\OneDrive" -Recurse | Measure-Object).Count -eq 0) { 2482 | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive" 2483 | } 2484 | 2485 | Write-Output "Disable OneDrive via Group Policies" 2486 | New-FolderForced -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" 2487 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" 1 2488 | 2489 | Write-Output "Remove Onedrive from explorer sidebar" 2490 | New-PSDrive -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" -Name "HKCR" 2491 | mkdir -Force "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" 2492 | Set-ItemProperty -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 2493 | mkdir -Force "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" 2494 | Set-ItemProperty -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 2495 | Remove-PSDrive "HKCR" 2496 | 2497 | # Thank you Matthew Israelsson 2498 | Write-Output "Removing run hook for new users" 2499 | reg load "hku\Default" "C:\Users\Default\NTUSER.DAT" 2500 | reg delete "HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f 2501 | reg unload "hku\Default" 2502 | 2503 | Write-Output "Removing startmenu entry" 2504 | Remove-Item -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" 2505 | 2506 | Write-Output "Removing scheduled task" 2507 | Get-ScheduledTask -TaskPath '\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false 2508 | 2509 | Write-Output "Restarting explorer" 2510 | Start-Process "explorer.exe" 2511 | } else { 2512 | write-host 'System needs to be in safe mode to unninstall OneDrive.' -ForegroundColor Black -BackgroundColor Red 2513 | } 2514 | } 2515 | 2516 | ########## 2517 | # Program - End 2518 | ########## 2519 | #-------------------------------------------------------------------------- 2520 | 2521 | ########## 2522 | # Fixes - Start 2523 | ########## 2524 | #-------------------------------------------------------------------------- 2525 | 2526 | RegChange "SYSTEM\CurrentControlSet\Services\TimeBrokerSvc" "Start" "2" "Enabling Time Brooker (required by Chrome Installer - Error 44)..." "DWord" 2527 | RegChange "SYSTEM\CurrentControlSet\Services\TokenBroker" "Start" "2" "Enabling NcbService (Network Connection Broker) (NcbService required for night light windows feature)..." "DWord" 2528 | Get-Service NcbService | Set-Service -StartupType automatic 2529 | Start-Service NcbService -Force -NoWait 2530 | 2531 | ########## 2532 | # Fixes - End 2533 | ########## 2534 | #-------------------------------------------------------------------------- 2535 | 2536 | RegChange "SOFTWARE\Microsoft\CTF\LangBar" "ExtraIconsOnMinimized" "1" "Fix language bar..." "DWord" 2537 | RegChange "SOFTWARE\Microsoft\CTF\LangBar" "Label" "1" "Fix language bar..." "DWord" 2538 | RegChange "SOFTWARE\Microsoft\CTF\LangBar" "ShowStatus" "4" "Fix language bar..." "DWord" 2539 | RegChange "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "CTFMON" "ctfmon.exe" "Fix typing in windows search bar..." "String" 2540 | 2541 | $visual = Read-Host "Install Initial Packages? (y/n)" 2542 | 2543 | while("y","n" -notcontains $visual) 2544 | { 2545 | $visual = Read-Host "y or n?" 2546 | } 2547 | 2548 | $showhidden = Read-Host "Show hidden files and extensions (y/n)" 2549 | while("y","n" -notcontains $showhidden) 2550 | { 2551 | $showhidden = Read-Host "y or n?" 2552 | } 2553 | 2554 | $ink = Read-Host "Disable Windows INK (y/n)" 2555 | while("y","n" -notcontains $ink) 2556 | { 2557 | $ink = Read-Host "y or n?" 2558 | } 2559 | 2560 | if ($showhidden -like "y") { 2561 | #SHOW HIDDEN FILES AND EXTENSIONS 2562 | 2563 | $key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 2564 | Set-ItemProperty $key Hidden 1 2565 | if($?){ write-Host -ForegroundColor Green "Windows Hidden Files Disabled" }else{ write-Host -ForegroundColor red "Windows Hidden Files not Disabled" } 2566 | 2567 | Set-ItemProperty $key HideFileExt 0 2568 | if($?){ write-Host -ForegroundColor Green "Windows Hidden Extensions Disabled" }else{ write-Host -ForegroundColor red "Windows Hidden Extensions Options not Disabled" } 2569 | } 2570 | 2571 | 2572 | if ($ink -like "y") { 2573 | #Disable INK 2574 | New-ItemProperty -Path HKLM:SOFTWARE\Policies\Microsoft -Name WindowsInkWorkspace -PropertyType DWord -Value 0 -Force -EA SilentlyContinue | Out-Null 2575 | if($?){ write-Host -ForegroundColor Green "Windows INK disabled" }else{ write-Host -ForegroundColor red "Windows INK not disabled" } 2576 | } 2577 | 2578 | if ($visual -like "y") { 2579 | Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) 2580 | choco install vcredist-all -y 2581 | choco install vcredist2010 -y 2582 | choco install vcredist2017 -y 2583 | choco install dotnet4.0 -y 2584 | choco install dotnet4.5 -y 2585 | choco install dotnetfx -y 2586 | choco install directx -y 2587 | choco install dotnetcore -y 2588 | choco install dotnet-runtime -y 2589 | 2590 | choco install qbittorrent -y 2591 | choco install k-litecodecpackfull -y 2592 | choco install imageglass -y 2593 | choco install 7zip.install -y 2594 | choco install vscode -y 2595 | } 2596 | 2597 | # Disable ShadowCopy 2598 | vssadmin delete shadows /all /quiet | Out-Null 2599 | if($?){ write-Host -ForegroundColor Green "Windows Shadowcopy removed" }else{ write-Host -ForegroundColor green "Windows Shadowcopy already disabled" } 2600 | 2601 | # Disable Windows Tile Notifications 2602 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Notifications\DisallowTileNotification")) { 2603 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Notifications\DisallowTileNotification" | Out-Null 2604 | } 2605 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\Notifications\DisallowTileNotification" -Name "value" -Type DWord -Value 1 2606 | if($?){ write-Host -ForegroundColor Green "Windows Tile Notifications disabled" }else{ write-Host -ForegroundColor red "Windows Tile Notifications not disabled" } 2607 | 2608 | # Disable Windows Defender Enhanced Notifications 2609 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WindowsDefenderSecurityCenter\DisableEnhancedNotifications")) { 2610 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WindowsDefenderSecurityCenter\DisableEnhancedNotifications" | Out-Null 2611 | } 2612 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WindowsDefenderSecurityCenter\DisableEnhancedNotifications" -Name "value" -Type DWord -Value 1 2613 | if($?){ write-Host -ForegroundColor Green "Windows Defender Enhanced Notifications disabled" }else{ write-Host -ForegroundColor red "Windows Defender Enhanced Notifications not disabled" } 2614 | 2615 | # Disable Windows Defender Security Center Notifications 2616 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WindowsDefenderSecurityCenter\DisableNotifications")) { 2617 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WindowsDefenderSecurityCenter\DisableNotifications" | Out-Null 2618 | } 2619 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WindowsDefenderSecurityCenter\DisableNotifications" -Name "value" -Type DWord -Value 1 2620 | if($?){ write-Host -ForegroundColor Green "Windows Defender Security Center Notifications disabled" }else{ write-Host -ForegroundColor red "Windows Defender Security Center Notifications not disabled" } 2621 | 2622 | 2623 | # Disable AllowSuggestedAppsInWindowsInkWorkspace 2624 | If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WindowsInkWorkspace\AllowSuggestedAppsInWindowsInkWorkspace")) { 2625 | New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WindowsInkWorkspace\AllowSuggestedAppsInWindowsInkWorkspace" | Out-Null 2626 | } 2627 | Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WindowsInkWorkspace\AllowSuggestedAppsInWindowsInkWorkspace" -Name "value" -Type DWord -Value 0 2628 | if($?){ write-Host -ForegroundColor Green "AllowSuggestedAppsInWindowsInkWorkspace disabled" }else{ write-Host -ForegroundColor red "AllowSuggestedAppsInWindowsInkWorkspace not disabled" } 2629 | 2630 | # Disable SgrmAgent 2631 | If (!(Test-Path "HKLM:\SYSTEM\CurrentControlSet\Services\SgrmAgent")) { 2632 | New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SgrmAgent" | Out-Null 2633 | } 2634 | Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SgrmAgent" -Name "Start" -Type DWord -Value 2 2635 | if($?){ write-Host -ForegroundColor Green "SgrmAgent disabled" }else{ write-Host -ForegroundColor red "SgrmAgent not disabled" } 2636 | 2637 | # Disable SgrmBroker 2638 | If (!(Test-Path "HKLM:\SYSTEM\CurrentControlSet\Services\SgrmBroker")) { 2639 | New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SgrmBroker" | Out-Null 2640 | } 2641 | Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\SgrmBroker" -Name "Start" -Type DWord -Value 2 2642 | if($?){ write-Host -ForegroundColor Green "SgrmBroker disabled" }else{ write-Host -ForegroundColor red "SgrmBroker not disabled" } 2643 | 2644 | 2645 | PowerCfg -SetActive $powerPlan 2646 | write-Host -ForegroundColor Green "PowerScheme Sucessfully Applied" 2647 | powercfg.exe -x -monitor-timeout-ac $monitorAcTimeout 2648 | powercfg.exe -x -monitor-timeout-dc $monitorDcTimeout 2649 | powercfg.exe -x -disk-timeout-ac $diskAcTimeout 2650 | powercfg.exe -x -disk-timeout-dc $diskDcTimeout 2651 | powercfg.exe -x -standby-timeout-ac $standbyAcTimeout 2652 | powercfg.exe -x -standby-timeout-dc $standbyDcTimeout 2653 | powercfg.exe -x -hibernate-timeout-ac $hybernateAcTimeout 2654 | powercfg.exe -x -hibernate-timeout-dc $hybernateDcTimeout 2655 | 2656 | Write-Output "Patching hosts file..." 2657 | Clear-Content $env:windir\System32\drivers\etc\hosts 2658 | $hostsList = @( 2659 | "localhost" 2660 | 2661 | # Firefox disable update 2662 | if ($firefoxSettings -eq 1) { 2663 | "aus5.mozilla.org" 2664 | } 2665 | ) 2666 | foreach ($line in $hostsList) { 2667 | Add-Content -Path $env:windir\System32\drivers\etc\hosts -Value $("127.0.0.1 " + $line) -Force 2668 | } 2669 | 2670 | Remove-PSDrive HKCR 2671 | PAUSE 2672 | 2673 | # NcbService is required by Windows setting app and night light function 2674 | # sppsvc necessary to keep Windows activated --------------------------------------------------------------------------------