The gui is meant to work as an optional thing. I also did it to put to my CV some WPF experience After all i need to gain also something from the project No i meant about the not removing some feature that you said. Nevermind About the device guard script, it is meant to be run in an online system. I have incorporated the " DisableVirtualizationSecurity", isn't it disabling device guard already?
@gdeliana In Windows 11 22623 with the latest updates opening Elevated Command prompt from the Context Menu no longer works if you use the tweak for the Additional Tweaks.reg in the script. The CMD window never opens. The below code works, however. Oh, at the bottom of the script I added a tweak to show all tray icons. I really prefer it. Code: Windows Registry Editor Version 5.00 ; Add Extract for Msi file types to Context Menu [HKEY_CLASSES_ROOT\Msi.Package\shell\Extract] "MUIVerb"="@shell32.dll,-31382" "Icon"="shell32.dll,-16817" [HKEY_CLASSES_ROOT\Msi.Package\shell\Extract\Command] @="msiexec.exe /a \"%1\" /qb TARGETDIR=\"%1 extracted\"" ; Add Install CAB to Context Menu [-HKEY_CLASSES_ROOT\CABFolder\Shell\runas] [HKEY_CLASSES_ROOT\CABFolder\Shell\runas] @="Install Package" "MUIVerb"="@shell32.dll,-10210" "HasLUAShield"="" "NeverDefault"="" [HKEY_CLASSES_ROOT\CABFolder\Shell\runas\Command] @="CMD /K Dism /Online /Add-Package /PackagePath:\"%1\" /NoRestart & Pause" ; Add Open with Notepad to Context Menu [HKEY_CLASSES_ROOT\*\shell\Open with Notepad] "Icon"="\"%WINDIR%\\System32\\notepad.exe\"" [HKEY_CLASSES_ROOT\*\shell\Open with Notepad\command] @="notepad.exe %1" ; Add Elevated Command Prompt to Context Menu [HKEY_CLASSES_ROOT\Directory\shell\Elevated Command Prompt] @="Elevated Command Prompt" "Icon"="imageres.dll,-5324" "Extended"=- "HasLUAShield"="" "SeparatorBefore"="" "Position"="Bottom" [HKEY_CLASSES_ROOT\Directory\shell\Elevated Command Prompt\command] @="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs\"" [HKEY_CLASSES_ROOT\Directory\Background\shell\Elevated Command Prompt] @="Elevated Command Prompt" "Icon"="imageres.dll,-5324" "Extended"=- "HasLUAShield"="" "SeparatorBefore"="" "Position"="Bottom" [HKEY_CLASSES_ROOT\Directory\Background\shell\Elevated Command Prompt\command] @="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs\"" [HKEY_CLASSES_ROOT\Drive\shell\Elevated Command Prompt] @="Elevated Command Prompt" "Icon"="imageres.dll,-5324" "Extended"=- "HasLUAShield"="" "SeparatorBefore"="" "Position"="Bottom" [HKEY_CLASSES_ROOT\Drive\shell\Elevated Command Prompt\command] @="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs\"" [HKEY_CLASSES_ROOT\LibraryFolder\background\shell\Elevated Command Prompt] @="Elevated Command Prompt" "Icon"="imageres.dll,-5324" "Extended"=- "HasLUAShield"="" "SeparatorBefore"="" "Position"="Bottom" [HKEY_CLASSES_ROOT\LibraryFolder\background\shell\Elevated Command Prompt\command] @="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs\"" ; Add Elevated PowerShell to Context Menu [HKEY_CLASSES_ROOT\Directory\Background\shell\Elevated PowerShell] @="Elevated PowerShell" "Icon"="PowerShell.exe" "Extended"=- "HasLUAShield"="" "SeparatorAfter"="" "Position"="Bottom" [HKEY_CLASSES_ROOT\Directory\Background\shell\Elevated PowerShell\command] @="PowerShell -Windowstyle Hidden -Command \"Start-Process CMD -ArgumentList ('/S, /K, PUSHD, %V && START PowerShell && EXIT') -Verb RunAs\"" [HKEY_CLASSES_ROOT\Directory\shell\Elevated PowerShell] @="Elevated PowerShell" "Icon"="PowerShell.exe" "Extended"=- "HasLUAShield"="" "SeparatorAfter"="" "Position"="Bottom" [HKEY_CLASSES_ROOT\Directory\shell\Elevated PowerShell\command] @="PowerShell -Windowstyle Hidden -Command \"Start-Process CMD -ArgumentList ('/S, /K, PUSHD, %V && START PowerShell && EXIT') -Verb RunAs\"" [HKEY_CLASSES_ROOT\Drive\shell\Elevated PowerShell] @="Elevated PowerShell" "Icon"="PowerShell.exe" "Extended"=- "HasLUAShield"="" "SeparatorAfter"="" "Position"="Bottom" [HKEY_CLASSES_ROOT\Drive\shell\Elevated PowerShell\command] @="PowerShell -Windowstyle Hidden -Command \"Start-Process CMD -ArgumentList ('/S, /K, PUSHD, %V && START PowerShell && EXIT') -Verb RunAs\"" [HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Elevated PowerShell] @="Elevated PowerShell" "Icon"="PowerShell.exe" "Extended"=- "HasLUAShield"="" "SeparatorAfter"="" "Position"="Bottom" [HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Elevated PowerShell\command] @="PowerShell -Windowstyle Hidden -Command \"Start-Process CMD -ArgumentList ('/S, /K, PUSHD, %V && START PowerShell && EXIT') -Verb RunAs\"" ; Add Take Ownership to Context Menu [-HKEY_CLASSES_ROOT\*\shell\Take Ownership] [-HKEY_CLASSES_ROOT\*\shell\runas] [HKEY_CLASSES_ROOT\*\shell\runas] @="Take Ownership" "Extended"=- "HasLUAShield"="" "NoWorkingDirectory"="" "Position"="Middle" [HKEY_CLASSES_ROOT\*\shell\runas\command] @="CMD.EXE /C TAKEOWN /F \"%1\" && ICACLS \"%1\" /GRANT *S-1-3-4:F /C /L & PAUSE" "IsolatedCommand"="CMD.EXE /C TAKEOWN /F \"%1\" && ICACLS \"%1\" /GRANT *S-1-3-4:F /C /L & PAUSE" [HKEY_CLASSES_ROOT\Directory\shell\Take Ownership] @="Take Ownership" "AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\Users\" OR System.ItemPathDisplay:=\"C:\\ProgramData\" OR System.ItemPathDisplay:=\"C:\\Windows\" OR System.ItemPathDisplay:=\"C:\\Windows\\System32\" OR System.ItemPathDisplay:=\"C:\\Program Files\" OR System.ItemPathDisplay:=\"C:\\Program Files (x86)\")" "Extended"=- "HasLUAShield"="" "NoWorkingDirectory"="" "Position"="Middle" [HKEY_CLASSES_ROOT\Directory\shell\Take Ownership\command] @="PowerShell -WindowStyle Hidden -Command \"Start-Process CMD -ArgumentList ('/C TAKEOWN /F \\\"%1\\\" /R /D Y && ICACLS \\\"%1\\\" /GRANT *S-1-3-4:F /T /C /L /Q & PAUSE') -Verb RunAs\"" "IsolatedCommand"="PowerShell -WindowStyle Hidden -Command \"Start-Process CMD -ArgumentList ('/C TAKEOWN /F \\\"%1\\\" /R /D Y && ICACLS \\\"%1\\\" /GRANT *S-1-3-4:F /T /C /L /Q & PAUSE') -Verb RunAs\"" [HKEY_CLASSES_ROOT\Drive\shell\runas] @="Take Ownership" "AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\\")" "Extended"=- "HasLUAShield"="" "NoWorkingDirectory"="" "Position"="Middle" [HKEY_CLASSES_ROOT\Drive\shell\runas\command] @="CMD.EXE /C TAKEOWN /F \"%1\\\" /R /D Y && ICACLS \"%1\\\" /GRANT *S-1-3-4:F /T /C & PAUSE" "IsolatedCommand"="CMD.EXE /C TAKEOWN /F \"%1\\\" /R /D Y && ICACLS \"%1\\\" /GRANT *S-1-3-4:F /T /C & PAUSE" ; Add Run with PowerShell (Admin) to Context Menu [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Run with PowerShell (Admin)] [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Run with PowerShell (Admin)\Command] @="\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-Command\" \"\"& { Start-Process PowerShell.exe -ArgumentList ('-ExecutionPolicy RemoteSigned -File \\\"%1\\\"') -Verb RunAs }\"" ; Add Copy To Folder to Context Menu [HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\{C2FBB630-2971-11D1-A18C-00C04FD75D13}] ; Add Move To Folder to Context Menu [HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\{C2FBB631-2971-11D1-A18C-00C04FD75D13}] ; Remove Burn ISO from Context Menu [HKEY_CLASSES_ROOT\Windows.IsoFile\shell\burn] "ProgrammaticAccessOnly"="" ; Remove New Bitmap from Context Menu [-HKEY_CLASSES_ROOT\.bmp\ShellNew] "ItemName"=hex(2):40,00,25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,\ 6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,\ 00,6d,00,73,00,70,00,61,00,69,00,6e,00,74,00,2e,00,65,00,78,00,65,00,2c,00,\ 2d,00,35,00,39,00,34,00,31,00,34,00,00,00 "NullFile"="" ; Remove New Contact from Context Menu [-HKEY_CLASSES_ROOT\.contact\ShellNew] "command"=hex(2):22,00,25,00,70,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,\ 69,00,6c,00,65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,\ 00,20,00,4d,00,61,00,69,00,6c,00,5c,00,57,00,61,00,62,00,2e,00,65,00,78,00,\ 65,00,22,00,20,00,2f,00,43,00,72,00,65,00,61,00,74,00,65,00,43,00,6f,00,6e,\ 00,74,00,61,00,63,00,74,00,20,00,22,00,25,00,31,00,22,00,00,00 "iconpath"=hex(2):25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,\ 6c,00,65,00,73,00,28,00,78,00,38,00,36,00,29,00,25,00,5c,00,57,00,69,00,6e,\ 00,64,00,6f,00,77,00,73,00,20,00,4d,00,61,00,69,00,6c,00,5c,00,77,00,61,00,\ 62,00,2e,00,65,00,78,00,65,00,2c,00,31,00,00,00 "MenuText"=hex(2):40,00,25,00,43,00,6f,00,6d,00,6d,00,6f,00,6e,00,50,00,72,00,\ 6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,65,00,73,00,25,00,5c,00,73,\ 00,79,00,73,00,74,00,65,00,6d,00,5c,00,77,00,61,00,62,00,33,00,32,00,72,00,\ 65,00,73,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,31,00,30,00,32,00,30,00,33,\ 00,00,00 ; Remove New RTF from Context Menu [-HKEY_CLASSES_ROOT\.rtf\ShellNew] "Data"="{\\rtf1}" "ItemName"=hex(2):40,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,\ 69,00,6c,00,65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,\ 00,20,00,4e,00,54,00,5c,00,41,00,63,00,63,00,65,00,73,00,73,00,6f,00,72,00,\ 69,00,65,00,73,00,5c,00,57,00,4f,00,52,00,44,00,50,00,41,00,44,00,2e,00,45,\ 00,58,00,45,00,2c,00,2d,00,32,00,31,00,33,00,00,00 ; Remove New Zip from Context Menu [-HKEY_CLASSES_ROOT\.zip\CompressedFolder\ShellNew] "Data"=hex:50,4b,05,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 "ItemName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,\ 6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,\ 00,7a,00,69,00,70,00,66,00,6c,00,64,00,72,00,2e,00,64,00,6c,00,6c,00,2c,00,\ 2d,00,31,00,30,00,31,00,39,00,34,00,00,00 ; Set PowerShell Execution Policy to RemoteSigned [HKEY_CURRENT_USER\Software\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell] "ExecutionPolicy"="RemoteSigned" ; Enable full image rebasing (ResetBase) [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide\Configuration] "DisableResetbase"=dword:00000000 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] "EnableAutoTray"=dword:00000000
Yeah, it's meant to run on an online system, then does the tweaks on first boot. The disable guard script I mean. You might want to look at the code though. When I get to Disable Optional Features, whether I select anything or even if I don't, I get this error. Code: Index : 0 Exception : Cannot validate argument on parameter 'FeatureName'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. Category : InvalidData: (:) [Disable-WindowsOptionalFeature], ParameterBindingValidationException ErrorID : ParameterArgumentValidationError,Microsoft.Dism.Commands.DisableWindowsOptionalFeatureCommand Target : Command : [Void](Disable-WindowsOptionalFeature @DisableFeatureParams) Script : D:\Optimize-Offline-master\Optimize-Offline-master\Optimize-Offline.psm1 Line : 1485 Column : 45
Inserted the new registry and thanks. Regarding the device guard script will check it some weeks later, coz now i am really busy with my work, that requires more deep analyzing. However if anyone makes it already for offline images then let me know and will insert it. The featurename bug, i think its related to the FeaturesToDisable.json not having the FeatureName key. Check that the json file has a structure like this one: Code: { "FeatureName" : [ ] }
Just wanted to share with everyone how delighted i felt when i rolled back to windows 10... Just wow, WTF totally i don't understand why i stayed with 11. 10 is smoother, better, everything opens up in a snap. I will continue to provide support for 10, because i believe 11 is just either too premature, or a never will be system.
I was on 22621 latest cumulative patch. Lag was everywhere, opening of programs, internet speed, file copy speed, windows animation speed, not to mention the crap start menu that has become redundant. I also thought the same as you when i was following 22xxx builds one by one, yes performance increased in them. But just yesterday decided to test a w10 build with the tool for compatibility purposes, and it seems like a different planet compared to w11. I only noticed the lag when i switched back to w10.
Completely agreed with you i know you wont test my BareBone OS tool for win11 22H2 Build or else i am sure your opinion on this will be quite different Happy Computing | Stay Blessed & Pl be happy always ...
Well i am sure this is doing a great job, but i see there you are using toolkithelper.exe, which is a binary from msmg toolkit, nothing against any of these projects, but personally i prefer open source things to modify my system. Maybe will give it a try in a VM environment. Thanks anyway!
Hey trying the GUI kept getting "Error GUI: Execution policy prevents scripts to run in the system". Reading start.ps, function RunOO, seems like if you try to run the script as unrestricted or if you set Execution Policy as unrestricted in your machine the script will fail. Script only works if everything is set to RemoteSigned. I tried to use a slightly modified windows image but the script failed, log shows "Failed to retrieve the necessary image metadata from the boot.wim". I found a workaround just editing Optimize-Offline.psm1, around line 480 i changed index 2 to 1 in two places. The image boot.wim has WinPE removed, so there is no index 2 metadata. Minor QOL suggestion, the window to select edition while using the GUI tool is invisible at first, it would be better if it was always on top.
Hello mate, thanks for the suggestions. Have changed the execution policy to RemoteSigned, let me know if it works better now. Regarding the image indexes, i see them hardcoded, we need to find a better way to detect which one is the install/boot/winre image. I will take a look into this, but am really busy at the moment, during the weekend will get my hands on the script
Anyone think of anything that would cause the following install error using a "successful" OO made image? This occurs after it's finished copying the install files from USB. "Windows could not set the offline locale information. Error code: 0x80000001" Using latest OO, tried both using Rufus and OO built in creator. This is using 22H2 base iso but OO said it was compatible.
In trying to fix above error during install I completely reset all of my files and started making the image again and got this. Code: Index : 0 Exception : An advanced installer failed during setup or servicing. Category : NotSpecified: (:) [Enable-WindowsOptionalFeature], COMException ErrorID : Microsoft.Dism.Commands.EnableWindowsOptionalFeatureCommand Target : Command : [Void](Enable-WindowsOptionalFeature @EnableFeatureParams) Script : H:\Optimize-Offline-Nov3\Optimize-Offline-285aef8a0d5867d557dc2f99c8bfd8a941697788\Optimize-Offline.psm1 Line : 1552 Column : 14
@gdeliana The Whitelist option on the GUI not working. It's trying to remove every app. I checked my lists, and they are fine. Edit: My configuration.json was messed up. Trying again. No, same problem, and the GUI changes the formatting of the configuration.json, might be the issue. Also the Start-Optimize.bat tried to remove all apps using Whitelist. Is my list a problem? WindowsAppsWhitelist.json Edit: Same lists work on an older version of OO. Code: { "DisplayName": [ "CortanaApp.View.App", "Microsoft.DesktopAppInstaller", "Microsoft.GamingApp", "Microsoft.HEIFImageExtension", "Microsoft.HEVCVideoExtension", "Microsoft.NET.Native.Framework.1.3", "Microsoft.NET.Native.Framework.1.7", "Microsoft.NET.Native.Framework.2.2", "Microsoft.NET.Native.Runtime.1.4", "Microsoft.NET.Native.Runtime.1.7", "Microsoft.NET.Native.Runtime.2.2", "Microsoft.Paint", "Microsoft.PowerAutomateDesktop", "Microsoft.RawImageExtension", "Microsoft.ScreenSketch", "Microsoft.StorePurchaseApp", "Microsoft.UI.Xaml.2.1", "Microsoft.UI.Xaml.2.3", "Microsoft.UI.Xaml.2.4", "Microsoft.UI.Xaml.2.7", "Microsoft.VCLibs.140.00", "Microsoft.VCLibs.140.00.UWPDesktop", "Microsoft.VP9VideoExtensions", "Microsoft.WebMediaExtensions", "Microsoft.WebpImageExtension", "microsoft.windowscommunicationsapps", "Microsoft.WindowsStore", "Microsoft.WindowsTerminal", "Microsoft.Xbox.TCUI", "Microsoft.XboxGameOverlay", "Microsoft.XboxGamingOverlay", "Microsoft.XboxIdentityProvider", "Microsoft.XboxSpeechToTextOverlay", "MicrosoftWindows.Client.WebExperience" ] }
Bumping these. Might have to switch to base *barf* install of Windowes for a bit Linux isn't able to fully utilize all of my laptops powerful parts due to the way everything is integrated.