为所有用户安装,3和4都尝试了,没有任何作用
如何恢复我的PC自带的照片和电视应用
不小心通过下面的命令移除了window自带的应用如照片、计算器、电影和电视等,我该如何恢复
Get-AppxProvisionedPackage -Online | Where {$_.DisplayName -NotMatch 'Microsoft.StorePurchaseApp' -and $_.DisplayName -NotMatch 'Microsoft.WindowsStore' -and $_.DisplayName -NotMatch 'Microsoft.MicrosoftEdge.Stable' -and $_.DisplayName -NotMatch 'Microsoft.WindowsTerminal' -and $_.DisplayName -NotMatch 'Microsoft.WindowsNotepad'} | Remove-AppxProvisionedPackage -Online -AllUsers
Windows 商业版 | 面向 IT 专业人士的 Windows 客户端 | 设备和部署 | 配置应用程序组
-
义壮 靳 • 0 信誉分
2025-10-20T08:01:29.9233333+00:00 -
Joseph Tran 4,100 信誉分 • 独立顾问
2025-10-20T08:17:19.1833333+00:00 I see, can you try these also ?
1) Make sure Store works
- Check Store & App Installer:
Get-AppxPackage *WindowsStore*, *AppInstaller*- If missing/broken: reinstall App Installer + Store, then reboot.
2) Quick reinstall
- Open the Microsoft Store and install Photos, Calculator, Media Player (search by name). Or use:
winget install -s msstore "Microsoft Photos" winget install -s msstore Microsoft.WindowsCalculator winget install -s msstore "Media Player"3) If Store fails
wsreset.exe DISM /Online /Cleanup-Image /RestoreHealth sfc /scannowReboot, try Store again.
4) Offline install (always works)
- Grab the official .msixbundle for each app (from the app’s Store URL via rg-adguard).
- Install:
Add-AppxPackage -Path "C:\Temp\App.msixbundle"1) Make sure Store works
-
-
Joseph Tran 4,100 信誉分 • 独立顾问
2025-10-20T10:04:04.13+00:00 You need to flow step by step as bellow
1) Prep
- Turn on Developer Mode.
- Make folders:
C:\AppxOffline\Photos
C:\AppxOffline\Calculator C:\AppxOffline\MediaPlayer
- For each app, download the **.msixbundle/.appxbundle** + **all dependencies** (VCLibs, .NET, WindowsAppRuntime) into that app’s folder. **2) Provision (for all NEW users)** ```powershell $App = "C:\AppxOffline\Calculator\Microsoft.WindowsCalculator.msixbundle" $Deps = "C:\AppxOffline\Calculator\Deps" Add-AppxProvisionedPackage -Online -PackagePath $App -DependencyPackagePath $Deps -SkipLicense(Repeat for Photos, Media Player by changing paths/names.)
3) Register for EXISTING users
# Stage if needed Add-AppxPackage -Path $App -DependencyPath $Deps -ForceUpdateFromAnyVersion # Then register for everyone $pkg = Get-AppxPackage -AllUsers Microsoft.WindowsCalculator | Select-Object -First 1 Add-AppxPackage -AllUsers -Register (Join-Path $pkg.InstallLocation 'AppxManifest.xml')(Repeat for
Microsoft.Windows.PhotosandMicrosoft.WindowsMediaPlayeror legacyMicrosoft.ZuneVideo.)Quick tips for you might make things easier
- Missing dependency = install error. Grab the exact ones listed for your app/architecture.
- Use
DISM /Online /Get-ProvisionedAppxPackagesto verify provisioning. - Use
Get-AppxPackage -AllUsers *photos*to check install status.
-
-
-
Joseph Tran 4,100 信誉分 • 独立顾问
2025-10-21T03:09:34.0233333+00:00 好吧,我只是想了一会儿,找到更多的解决方案,接下来你能试试这些吗?
1) 使用正确的 shell 作为管理员
- 关闭 PowerShell 7。
- 以管理员身份****打开 Windows PowerShell 5.1(蓝色图标)。
- 然后您需要检查:
$PSVersionTable.PSVersion # Major should be 5
2)验证文件并解锁
$app = "C:\lib\Microsoft.Windows.Photos_2025.11100.9001.0_neutral_~_8wekyb3d8bbwe.Msixbundle" $deps = "C:\lib\deps" Test-Path $app; Test-Path $deps Unblock-File $app; Get-ChildItem $deps | Unblock-File3) 提供 DISM 我认为这是最可靠的
DISM /Online /Add-ProvisionedAppxPackage ^ /PackagePath:"C:\lib\Microsoft.Windows.Photos_....Msixbundle" ^ /DependencyPackagePath:"C:\lib\deps" /SkipLicense但是,如果 Access 被拒绝,请重新启动一次并再次运行。
4)如果依赖错误
仅保留 最新的
Microsoft.VCLibs.*_x64_*.appxdeps。确保 WindowsAppRuntime 版本与应用包匹配。
5) 您也可以尝试注册现有用户
Add-AppxPackage -Path $app -DependencyPath $deps -ForceUpdateFromAnyVersion $pkg = Get-AppxPackage -AllUsers Microsoft.Windows.Photos | Select-Object -First 1 Add-AppxPackage -AllUsers -Register (Join-Path $pkg.InstallLocation 'AppxManifest.xml')6) 但是如果它仍然被阻止怎么办,好吧,这是我能为你找到的最后手段
reg add "HKLM\Software\Policies\Microsoft\Windows\Appx" /v AllowAllTrustedApps /t REG_DWORD /d 1 /f重新启动并重试步骤 3。
-
-
-
Joseph Tran 4,100 信誉分 • 独立顾问
2025-10-21T03:49:09.57+00:00 我想我明白了这里出了什么问题
- 你使用的是 Windows 10 22H2 (内部版本 19045.6456)。
- 您使用的文件是 Photos_2025...Msixbundle => 这是一个 仅限 Windows 11 的 版本。Win10 无法预配它,这就是您看到 0x80004005 和后来“拒绝访问”的原因。
首先需要获取与 Win10 兼容的捆绑包
- 下载 Windows 10 版本:
- 照片(旧版) >
Microsoft.Photos(或“照片旧版”) - 计算器 >
Microsoft.WindowsCalculator(Win10 版本) - 电影和电视 >
Microsoft.ZuneVideo(Win10)
- 照片(旧版) >
- 确保每个 .appx/.msixbundle 都列出了 MinVersion ≤ 10.0.19041。
- 将 deps 保存在文件夹中(通常为 Microsoft.VCLibs 14.0 x64; ** Win10 上通常不需要 **WindowsAppRuntime)。
以管理员身份从 WinPS 5.1 运行 (蓝色图标)。将文件放在 C:\Temp\Appx (不是 C:\lib)中,然后:
# Photos (example) – one single line DISM /Online /Add-ProvisionedAppxPackage /PackagePath:"C:\Temp\Appx\Microsoft.Photos_<win10>.appxbundle" /DependencyPackagePath:"C:\Temp\Appx\deps" /SkipLicense为现有用户注册
Add-AppxPackage -Path "C:\Temp\Appx\Microsoft.Photos_<win10>.appxbundle" -DependencyPath "C:\Temp\Appx\deps" -ForceUpdateFromAnyVersion $pkg = Get-AppxPackage -AllUsers Microsoft.Photos | Select-Object -First 1 Add-AppxPackage -AllUsers -Register (Join-Path $pkg.InstallLocation 'AppxManifest.xml')如果您仍然点击“访问被拒绝”(错误 5):
- 将文件移动到 C:\Temp\Appx 并 取消阻止文件 。
- 暂时禁用 受控文件夹访问 (Windows 安全>勒索软件保护)。
- 重新启动并重新运行单行 DISM 命令。
-
-
-
Joseph Tran 4,100 信誉分 • 独立顾问
2025-10-21T07:35:05.5666667+00:00 So as you have asked that “MinVersion” is inside the app’s manifest. There is two quick ways to see it:
Method A:
- Copy the .appx/.msixbundle to a temp folder.
- Rename it from
.AppxBundle>.zip. - Open the zip > go to AppxMetadata\AppxBundleManifest.xml.
- Look for:
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.x.x" .../>- Your OS is 10.0.19045.x (Win10 22H2).
- The bundle is OK only if MinVersion ≤ 10.0.19045.x.
Method B by using PowerShell as Admin
Add-Type -AssemblyName System.IO.Compression.FileSystem $bundle = "C:\temp\appx\Microsoft.Windows.Photos_....AppxBundle" $zip = [IO.Compression.ZipFile]::OpenRead($bundle) $entry = $zip.Entries | ? Name -like "*AppxBundleManifest.xml" $xml = New-Object IO.StreamReader($entry.Open()); [xml]$m = $xml.ReadToEnd(); $xml.Close(); $zip.Dispose() $m.AppxBundleManifest.TargetDeviceFamilies.TargetDeviceFamilyThis prints the MinVersion.
And fixes based on your screenshots
You still hit Error 5 (Access denied) once > make sure you run Windows PowerShell 5.1 as Administrator, files live under C:\temp, and run:
Unblock-File C:\temp\appx\*.AppxBundle- In deps, you selected VCLibs x86. On a 64-bit machine you need x64 (
Microsoft.VCLibs.*_x64_*.appx). Keep only the newest x64 VCLibs there, plus the required .NET Native Framework/Runtime 2.2 (x64). Then:
DISM /Online /Add-ProvisionedAppxPackage ^ /PackagePath:"C:\temp\appx\Microsoft.Windows.Photos_....AppxBundle" ^ /DependencyPackagePath:"C:\temp\deps" /SkipLicense=> If the bundle’s MinVersion is higher than 10.0.19045, grab an older Win10 Photos bundle (or Calculator/Movies & TV) whose MinVersion is lower then 19045, then retry.
-
义壮 靳 • 0 信誉分
2025-10-21T08:37:55.3033333+00:00 我将VCLibs x86换成x64版本后,并输入了Unblock-File C:\temp\appx*.AppxBundle,运行依旧显示同样的错误
-
Joseph Tran 4,100 信誉分 • 独立顾问
2025-10-21T09:04:40.3633333+00:00 Well, that was a good sign the problem now is Access denied (Error 5), not deps. Then you need to follow this to the point:
1) Reboot > run the right shell
Reboot once.
Open Windows PowerShell 5.1 (blue) as Administrator.
2) Make sure services are on
sc query appxsvc sc query clipsvc sc query wuauserv net start appxsvc net start clipsvc net start wuauserv3) Use clean paths + unblock (you had a tiny typo)
mkdir C:\Packages\Photos,C:\Packages\deps -ea 0 # move your files there first Unblock-File 'C:\Packages\Photos\*.AppxBundle' Get-ChildItem 'C:\Packages\deps\*' | Unblock-File4) Try a user install first (tests signing + deps)
Add-AppxPackage -Path "C:\Packages\Photos\Microsoft.Windows.Photos_2019.19061.18920.0_neutral_~_8wekyb3d8bbwe.AppxBundle" ` -DependencyPath "C:\Packages\deps" -ForceUpdateFromAnyVersion- If this works, provisioning will work too.
5) Provision for all new users (the part that was failing)
- From elevated CMD (not PowerShell), or run as SYSTEM if needed:
dism /online /Add-ProvisionedAppxPackage ^ /PackagePath:"C:\Packages\Photos\Microsoft.Windows.Photos_2019.19061.18920.0_neutral_~_8wekyb3d8bbwe.AppxBundle" ^ /DependencyPackagePath:"C:\Packages\deps" /SkipLicenseIf Error 5 persists, run it as SYSTEM:
psexec -i -s cmd.exe dism /online /Add-ProvisionedAppxPackage /PackagePath:"C:\Packages\Photos\....AppxBundle" /DependencyPackagePath:"C:\Packages\deps" /SkipLicense6) Register for existing users
$pkg = Get-AppxPackage -AllUsers Microsoft.Photos | Select-Object -First 1 Add-AppxPackage -AllUsers -Register (Join-Path $pkg.InstallLocation 'AppxManifest.xml')7) If it still says Access denied
- Check WindowsApps ACLs and repair component store:
sfc /scannow DISM /Online /Cleanup-Image /RestoreHealth- Make sure Controlled folder access is Off (your screenshot shows it is).
- Confirm you grabbed x64 deps only (you did) and the bundle MinVersion lower than 10.0.19045 (your 2019 bundle is fine).
-
-
Joseph Tran 4,100 信誉分 • 独立顾问
2025-10-22T04:22:37.83+00:00 Based on your pictures the log says two things:
You’re still in PowerShell 7 (see the
pscore6banner). Use Windows PowerShell 5.1.The failure is Access denied (0x80070005) and it can’t open files from deps.
=> You need to do this, exactly and briefly:
1) Open the right shell
- Start > type Windows PowerShell (blue icon) > Run as administrator.
Confirm:
$PSVersionTable.PSVersion.Major # should be 5 "$PSHome" # should show ...\WindowsPowerShell\v1.02) Clean paths & permissions
mkdir C:\Packages\Photos,C:\Packages\Deps -ea 0 # move the bundle + 4 x64 deps here (no (1) in names) icacls C:\Packages /grant Administrators:(OI)(CI)F /T Unblock-File 'C:\Packages\Photos\*.AppxBundle' Get-ChildItem 'C:\Packages\Deps\*' | Unblock-File3) Try current-user install with explicit deps (not a folder)
Add-AppxPackage -Path 'C:\Packages\Photos\Microsoft.Windows.Photos_2019.19061.18920.0_neutral_~_8wekyb3d8bbwe.AppxBundle' ` -DependencyPath @( 'C:\Packages\Deps\Microsoft.VCLibs.140.00_14.0.33519.0_x64__8wekyb3d8bbwe.appx', 'C:\Packages\Deps\Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x64__8wekyb3d8bbwe.appx', 'C:\Packages\Deps\Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x64__8wekyb3d8bbwe.appx', 'C:\Packages\Deps\Microsoft.UI.Xaml.2.1_2.11906.6001.0_x64__8wekyb3d8bbwe.appx' ) -ForceUpdateFromAnyVersion4) Provision for all new users (use CMD, not PowerShell) Open elevated CMD and run (repeat the switch for each dep file):
dism /online /Add-ProvisionedAppxPackage ^ /PackagePath:"C:\Packages\Photos\Microsoft.Windows.Photos_2019.19061.18920.0_neutral_~_8wekyb3d8bbwe.AppxBundle" ^ /DependencyPackagePath:"C:\Packages\Deps\Microsoft.VCLibs.140.00_14.0.33519.0_x64__8wekyb3d8bbwe.appx" ^ /DependencyPackagePath:"C:\Packages\Deps\Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x64__8wekyb3d8bbwe.appx" ^ /DependencyPackagePath:"C:\Packages\Deps\Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x64__8wekyb3d8bbwe.appx" ^ /DependencyPackagePath:"C:\Packages\Deps\Microsoft.UI.Xaml.2.1_2.11906.6001.0_x64__8wekyb3d8bbwe.appx" ^ /SkipLicense5) Still 0x80070005?
You’re hitting a servicing permission block. Run DISM as SYSTEM:
psexec -i -s cmd.exe dism /online /Add-ProvisionedAppxPackage ... (same as above)Or repair servicing, then retry:
sfc /scannow DISM /Online /Cleanup-Image /RestoreHealth6) Finish (register for existing users)
$pkg = Get-AppxPackage -AllUsers Microsoft.Photos | Select-Object -First 1 Add-AppxPackage -AllUsers -Register (Join-Path $pkg.InstallLocation 'AppxManifest.xml') -
-
Joseph Tran 4,100 信誉分 • 独立顾问
2025-10-22T08:35:45.0733333+00:00 As I can see there and as I know you’re hitting 0x80070005 (Access denied) during staging. That’s a permissions/policy block, not a deps issue.
Can you try these step to:
1) Set the appx policies (then reboot)
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Appx" /v AllowAllTrustedApps /t REG_DWORD /d 1 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Appx" /v AllowDevelopmentWithoutDevLicense /t REG_DWORD /d 1 /fReboot once.
2) Temporarily take AV out of the way
- Add an exclusion for
C:\Packagesin Defender (Windows Security > Virus & threat protection > Exclusions).
Or stop 3rd-party AV if present.
3) Install for current user with explicit deps (no folder) Open Windows PowerShell 5.1 as Admin.
$bundle = 'C:\Packages\Photos\Microsoft.Windows.Photos_2019.19061.18920.0_neutral_~_8wekyb3d8bbwe.AppxBundle' $deps = @( 'C:\Packages\Deps\Microsoft.VCLibs.140.00_14.0.33519.0_x64__8wekyb3d8bbwe.appx', 'C:\Packages\Deps\Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x64__8wekyb3d8bbwe.appx', 'C:\Packages\Deps\Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x64__8wekyb3d8bbwe.appx', 'C:\Packages\Deps\Microsoft.UI.Xaml.2.1_2.11906.6001.0_x64__8wekyb3d8bbwe.appx' ) Unblock-File $bundle; $deps | % { Unblock-File $_ } Add-AppxPackage -Path $bundle -DependencyPath $deps -ForceUpdateFromAnyVersionIf this succeeds, Photos is installed for the current user.
4) Provision for all new users (run as SYSTEM) Error 5 often vanishes when DISM runs as SYSTEM:
psexec -i -s cmd.exe dism /online /Add-ProvisionedAppxPackage ^ /PackagePath:"C:\Packages\Photos\Microsoft.Windows.Photos_2019.19061.18920.0_neutral_~_8wekyb3d8bbwe.AppxBundle" ^ /DependencyPackagePath:"C:\Packages\Deps\Microsoft.VCLibs.140.00_14.0.33519.0_x64__8wekyb3d8bbwe.appx" ^ /DependencyPackagePath:"C:\Packages\Deps\Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x64__8wekyb3d8bbwe.appx" ^ /DependencyPackagePath:"C:\Packages\Deps\Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x64__8wekyb3d8bbwe.appx" ^ /DependencyPackagePath:"C:\Packages\Deps\Microsoft.UI.Xaml.2.1_2.11906.6001.0_x64__8wekyb3d8bbwe.appx" ^ /SkipLicense5) If it still says 0x80070005 Run these to fix servicing/ACLs, then retry step 3:
sfc /scannow DISM /Online /Cleanup-Image /RestoreHealth icacls "C:\Program Files\WindowsApps" /verify(If
WindowsAppsACLs are broken, we can repair them, but don’t take ownership unless needed.)6) Quick WDAC/AppLocker check (if in a domain)
(Get-CimInstance Win32_DeviceGuard).UsermodeCodeIntegrityPolicyEnforcementStatus Get-AppLockerPolicy -Effective -ErrorAction SilentlyContinue | Select -ExpandProperty RuleCollectionsIf WDAC/AppLocker is Enforced, your IT policy is blocking sideloads—either relax the policy or install via Microsoft Store.
- Add an exclusion for
登录以评论 -
-
Joseph Tran 4,100 信誉分 • 独立顾问
2025-10-20T03:00:30.82+00:00 嘿,你好
据我所知,如果您不小心使用该 PowerShell 命令删除了内置的 Windows 应用程序,如照片、计算器或电影和电视,我认为您可以通过尝试以下方法快速恢复它们:
1. 从 Microsoft Store 重新安装是最简单的方法:
- 打开Microsoft商店>搜索每个应用程序照片、计算器、媒体播放器,...>单击安装。
2. 使用 Winget(命令行):
winget install -s msstore "Microsoft Photos" winget install -s msstore "Microsoft.WindowsCalculator" winget install -s msstore "Movies & TV"这将为当前用户重新安装它们。
3. 为所有用户恢复(可选): 如果您希望这些应用程序为每个用户返回,请挂载您的 Windows ISO,找到
install.wimsources,然后运行:Add-AppxProvisionedPackage -Online -PackagePath "C:\Path\to\App.appxbundle" -SkipLicense**4. 如果没有任何效果:从 ISO ** 运行 Windows 安装程序并选择保留个人文件和应用程序。这将修复 Windows 并恢复所有默认应用程序。