Product: PowerShell Studio 2022 (64 Bit)
Build: v5.8.206
OS: Windows 10 Pro (64 Bit)
Build: v10.0.19044.0
If I create a Powershell script with SFC /Scannow and run the script it works fine, but if I build the script into an .exe then it fails with the error: "Windows Resource Protection could not start the repair service."
For my building settings script engine I am using a target of Microsoft Windows 32bit, Windows PowerShell, and SAPIEN Powershell V5 Host (Command Line)
Any advice would be great, thanks!
SFC /Scannow Not Working
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: SFC /Scannow Not Working
Tools like that need to be run elevated and they will not work if run under some restricted conditions.
Be sure you are signing the EXE. Other than that there is not enough information to know what is going wrong. Start by investigating the logs.
Be sure you are signing the EXE. Other than that there is not enough information to know what is going wrong. Start by investigating the logs.
Re: SFC /Scannow Not Working
Also, you can't run a 64-bit app in a 32-bit host. On 64-bit Windows the utilities are 64 bits. You should get the 32-bit version if running a 32-bit app, so it is more likely that running SFC as a child process requires elevation or there are other issues with your script or system.
Since your issue is about the Sapien product, you should post this issue in the Sapien support forum for PSS.
Since your issue is about the Sapien product, you should post this issue in the Sapien support forum for PSS.
-
- Posts: 4
- Last visit: Wed Apr 26, 2023 12:55 pm
Re: SFC /Scannow Not Working
I am running the exe with elevated permissions. I am not running the exe from within PowerShell Studio. I created a 32-bit exe and I am running it on my 64-bit Windows 10.
Re: SFC /Scannow Not Working
Still not enough information to even venture a guess beyond what I posted above. Read the earlier posts and try the rest of the instructions.jordandombrowski wrote: ↑Tue May 24, 2022 1:42 am I am running the exe with elevated permissions. I am not running the exe from within PowerShell Studio. I created a 32-bit exe and I am running it on my 64-bit Windows 10.
- Alexander Riedel
- Posts: 8479
- Last visit: Thu Mar 28, 2024 9:29 am
- Been upvoted: 37 times
Re: SFC /Scannow Not Working
There is a 32 bit and 64 bit sfc.exe. Since you packaged with a 32 Bit engine the 32 bit SFC.exe will be executed unless you use a specific non-mapped path. What you run in the console on a 64 bit system is (I bet) the 64 bit version. You are mixing platforms for some reason and that never works reliably.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.