schooltech06 Posted September 24, 2013 Report post Posted September 24, 2013 Hi everyone, I'm trying to push a simple batch file that will disable startup repair on windows 7. The batch file is only 2 lines but needs to run as an administrator: bcdedit /set {default} recoveryenabled No bcdedit /set {default} bootstatuspolicy ignoreallfailures I saved that as a .bat and created a package to deploy it to a collection. I set the command line option to be the name of the bat file, set it as a required package and set it to run as Administrator. When it runs on the client machine, the execmgr log shows it running and exiting with error code 1. No changes are made in bcdedit. If I copy the script to the local machine, run a command prompt as admin, and run the script, it works fine. It seems like it's a permissions issue on the account that SCCM uses to run the script. Are there certain SCCM accounts that should be local admins on the client computers? I have no issues when installing MSI's and EXE's using SCCM, but I can't figure this one out. Any pointers anyone can offer? Thanks Quote Share this post Link to post Share on other sites More sharing options...
AmrelMahdy Posted September 24, 2013 Report post Posted September 24, 2013 Did u test this Script Manually ( Without SCCM ) ? Quote Share this post Link to post Share on other sites More sharing options...
schooltech06 Posted September 24, 2013 Report post Posted September 24, 2013 I did. If I run it as a normal non-admin user it fails. If I run it from an elevated command prompt, it works fine and makes the changes to the BCD file. Quote Share this post Link to post Share on other sites More sharing options...
kvineets Posted September 25, 2013 Report post Posted September 25, 2013 While creating the program , specify to run it with admin access not in user context. in CM 7, you have the option to chose where it say , whether or not used is logged in, which automatically takes it into admin context Quote Share this post Link to post Share on other sites More sharing options...
schooltech06 Posted September 26, 2013 Report post Posted September 26, 2013 I think I figured the problem. All our clients are 64-bit Windows 7. Apparently when SCCM runs a script, it uses a 32-bit command line. From what I can tell, I was calling Bcdedit and the 32-bit command line was redirecting it to C:\Windows\Syswow64 where there is no BCDEdit. I found this blog entry that talks about the issue http://madluka.wordpress.com/2012/09/24/configmgr-2012-64bit-file-system-redirection-bites-again/ I tried using his suggested code at the top of my batch file and the BCD file actually gets changed now. IF "%PROCESSOR_ARCHITEW6432%"=="" GOTO native %SystemRoot%\Sysnative\cmd.exe /c %0 %* Exit :native <your script starts here> It's still returning an exit code of 1 saying there was an error, but that could be because of the new code I added. Quote Share this post Link to post Share on other sites More sharing options...
Johan_A Posted December 27, 2018 Report post Posted December 27, 2018 I encountered the same problem. I think its solved like this in a single line TS. I will confirm this tomorrow after testing. mklink cmdin64.exe "c:\Windows\System32\cmd.exe" & cmdin64.exe /c "command (in my case bcdedit /set testsigning on)" Quote Share this post Link to post Share on other sites More sharing options...