you must not be a golfer, -ge (greater than or equals), -lt (less than), -eq (equals) if you don't know what you're doing then I don't advise monkeying with these files or it'll break O-O on your machine.
I have another question: How can I add this script during the provision of the image? https://forums.mydigitallife.net/th...y-destroyer-with-a-batch-and-ps-script.63677/ And also how can I remove OneDrive?
... script is 5 years old (last edited 3 years ago), not sure I would entertain using it ... believe you need to use .ISO as source (not .wim) .. edit .json setup = true, edit Content/Additional/Setup/ SetpComplete.cmd to call Remove-OneDrive.cmd -> see ReadMe.md in Setup folder further info credit @spanishfly
@spnanishfly raised an issue on the github Optimize-Offline issues page regarding the need to update a key in the file \Content\Additional\Setup\Set-Additional.ps1. As it seems, the "HKLM\SYSTEM\CurrentControlSet\Control\WMI\Autologger\AutoLogger-Diagtrack-Listener" was renamed to "HKLM\SYSTEM\CurrentControlSet\Control\WMI\Autologger\Diagtrack-Listener" In the newer O-O 4.0.1.7 the issue remains… However, it applies “4” (disabled) to the “Start” value of “AutoLogger-Diagtrack-Listener” and others (check line 90), and not the suggested “0” (boot start). In addition, I believe the “Status” should also be set to “0” (needs confirmation), as the Status seems to be related to the system general telemetry settings (also needs confirmation). I can’t find much about this anyway… specially from M$... Can anybody please confirm or correct me if I'm wrong
About the 'Set-Additional.cmd'. Before you run it, paid Microsoft Store apps like games install just fine. After running it I get a weird Windows Update is disabled error. Windows Update IS working and I checked, all the Windows Update and other required services for the Microsoft Store ARE running. Any ideas anyone?
"Set-Additional.cmd" only checks for elevation in order to set the execution policy to “bypass”, and triggers the "Set-Additional.ps1". I can’t check right now on a live system… try changing the status of the services disabled by the shell script (line 52). My guess would be "UnistoreSvc" and "UserDataSvc" (by default they are set as manual). Other than that, at first glance, maybe the firewall rules? The “Delivery Optimization” (line 98)?
I am pretty sure this has been covererd in the thread previously .. merely points to the Content/Additional/Setup Folder of 4.0.1.7, allowing the stuff in there to run see readme in folder 1. use Rufus to create bootable media of original .ISO 2. Point O-O to install.wim in sources folder of USB 3. Optimize your image 4. replace install.wim in USB/Sources with newly optimized install.wim in O-O Folder (dated).. and you are good to go if you really need an ISO there are many cd/dvd tools available that can convert the contents of the USB folder to a bootable ISO... just google hope this helps
Code: Index : 0 Exception : The process cannot access the file because it is being used by another process. Category : NotSpecified: (:) [Get-AppxProvisionedPackage], COMException ErrorID : Microsoft.Dism.Commands.GetAppxProvisionedPackageCommand Target : Command : If ((Get-AppxProvisionedPackage -Path $InstallMount -ScratchDirectory $ScratchFolder -LogPath $DISMLog -LogLevel 1).Count -eq 0) { Get-ChildItem -Path (GetPath -Path $InstallMount -Child 'Program Files\WindowsApps') -Force | Purge -Force } Script : C:\Users\win\Optimize-Offline-4.0.1.7\Optimize-Offline.psm1 Line : 615 Column : 11 Any idea why i get this error?
Sometimes if you have a folder open and File Explorer open you get that error. Try closing all File Explorer windows when running the script. I know of one person that had to end task the explorer.exe process in the Task Manager and restart it when they were done. I believe if you open Task Manager and browse to the C:\Windows folder you can start explorer.exe from there after end tasking it when the script is done.
I just did the kill explorer.exe method seems not to work. That doesn't seem to be the problem. I see by quickly browsing the script that the instruction is correctly executed in previous line but it can't access for this specific call.
Question: How can i execute Scheduledtasks.json and Services.json in Additional Setup? Also are there any addtional regitry tweaks / scripts that someone can suggest?
So a setupComplete.cmd like this should do the work right? Code: CD /D "%~dp0" REM Answer files should ALWAYS be removed from the 'Windows\Panther' and 'Windows\System32\Sysprep' directories immediately after they've been processed. PowerShell.exe -NoProfile -ExecutionPolicy Bypass -File "%WINDIR%\Setup\Scripts\Refresh-Explorer.ps1" PowerShell.exe -NoProfile -ExecutionPolicy Bypass -File "%WINDIR%\Setup\Scripts\Remove-OneDrive.ps1" PowerShell.exe -NoProfile -ExecutionPolicy Bypass -File "%WINDIR%\Setup\Scripts\Set-Additional.ps1" DEL /F /Q "%WINDIR%\Setup\Scripts\Remove-OneDrive.ps1" >NUL 2>&1 DEL /F /Q "%WINDIR%\Setup\Scripts\Refresh-Explorer.ps1" >NUL 2>&1 DEL /F /Q "%WINDIR%\Setup\Scripts\Set-Additional.ps1" >NUL 2>&1 DEL /F /Q "%WINDIR%\Panther\unattend.xml" >NUL 2>&1 DEL /F /Q "%WINDIR%\System32\Sysprep\unattend.xml" >NUL 2>&1 DEL "%~f0"
In the D:\Optimize-Offline-4.0.1.7\Optimize-Offline-4.0.1.7\Src\ folder in Offline-Resources.psm1 file change en-US to en-GB with Notepad++ and save.
I assume you are referring to Post #660 The issue you are describing was exactly the problem I was experiencing with versions prior to 4.1.7, where for some reason it worked Before version 4.1.7 the only resolution that worked for me was to; Optimize-Offline-4.0.1.7\Src\Public\en-US <- leave as en-US Optimize-Offline-4.0.1.7\Src\Offline-Resources.psm1 <- Leave culture as en-US ... but bear in mind @KedarWolf's Post #655 (a direct response to my using the above workaround) that some things like calculator may not get integrated, don't use it so never noticed the issue .. Edit: Just completed a test on 20262 (without above workaround) with no issues Spoiler: LOG Code: *************************************************************************************************** Running Module : Optimize-Offline 4.0.1.7 Optimize Start : 12/01/2020 01:30:56 PM Identity Name : W0LF Computer Name : DESKTOP-XXXXXXX *************************************************************************************************** 2020-12-01T13:30:56 [INFO]: Supported Image Build: [20262] 2020-12-01T13:30:59 [INFO]: Mounting Windows 10 Enterprise 2020-12-01T13:32:19 [INFO]: Pre-Optimization Image Health State: [Healthy] ... leaving out the boring bits [App Removals] 2020-12-01T13:42:05 [INFO]: Integrating the Win32 Calculator. 2020-12-01T13:42:09 [INFO]: Applying Optimized Registry Settings. 2020-12-01T13:42:24 [INFO]: Applying Setup Content. 2020-12-01T13:42:27 [INFO]: Importing Registry Template: Additional Tweaks.reg 2020-12-01T13:42:34 [INFO]: Cleaning-up the Start Menu Layout. 2020-12-01T13:42:42 [INFO]: Post-Optimization Image Health State: [Healthy] 2020-12-01T13:42:45 [INFO]: Saving and Dismounting Windows 10 Enterprise 2020-12-01T13:44:38 [INFO]: Rebuilding and Exporting Windows 10 Enterprise using Fast compression. 2020-12-01T13:46:50 [INFO]: Finalizing Optimizations. 2020-12-01T13:46:50 [INFO]: Optimize-Offline completed in [16] minutes with [0] errors. *************************************************************************************************** Optimizations Finalized : 12/01/2020 01:46:50 PM *************************************************************************************************** en-GB OS