I'm having an issue where several users can't update to Windows 11 via the update ring in Intune. They're getting an error message saying 'unable to update system reserved partition.' I've managed to manually execute some commands as an admin on two devices, but I want to know how to automate this process and push it to the other devices using Intune. Here are the commands I've used:
* Diskpart
* List disk
* sel disk 0
* list part
* sel part 1
* assign letter=z
* Exit
* z:
* cd EFI\Microsoft\Boot\Fonts
* del *
Any advice on how to create a script for this would be greatly appreciated!
2 Answers
There’s definitely a better way than just assuming disk 0 and partition 1. You could programmatically determine the system partition with PowerShell using:
```powershell
Get-Partition | Where-Object -Property IsSystem -EQ $true
```
That way, you don’t run the risk of targeting the wrong disk. Remember that drive letters can change, and you'd want to ensure you're working with the right partition. Also, if you do need to delete files from the EFI folder, here's a safer way to handle it by first checking what the correct drive letter is before proceeding.
You can actually run `diskpart` commands from a script using the `/s` parameter. This lets you feed it a file with commands that you want it to execute. Just a heads up, the last part of your manual commands can be translated into a PowerShell script.
For instance, you could use something like this:
```powershell
@(
"List disk"
"sel disk 0"
"list part"
"sel part 1"
"assign letter=z"
) | diskpart.exe
```
This allows you to interactively send commands the same way you would type them out. Let me know if you need more help with the scripting part!
Thanks for the tip! I'm not very confident with PowerShell, though. Can you help me translate those commands into a full script?
Got it! So, basically, check which partition is the system one and then proceed from there. This makes a lot of sense, I'll try implementing that.