FN-GM Posted September 6, 2012 Posted September 6, 2012 Hi, I want to make a script that will do something different depending on the edit code A. biospassword1.exe - if the exit code is 1 clear the exit code so SCCM doesnt know about it, then go to step B then go to step C B. biospassword2.exe - When run go to step C C. ConfigureBios.exe Any thoughts please? Thanks
Steve21 Posted September 9, 2012 Posted September 9, 2012 Thoughts as in code? Does SCCM just run vbs/BAT? Never really used SCCM, but can help on the code side if it is Steve
FN-GM Posted September 9, 2012 Author Posted September 9, 2012 SCCM can run .bat and VBS scripts no problem. It can run pretty much anything. It can also call the installers directly.
Steve21 Posted September 9, 2012 Posted September 9, 2012 SCCM can run .bat and VBS scripts no problem. It can run pretty much anything. It can also call the installers directly. So if I understand you right: Set WshShell = CreateObject("WScript.Shell") returncode = WshShell.Run("biospassword1.exe") If returncode = 1 Then WshShell.Run("biospassword2.exe") WshShell.Run("ConfigureBios.exe") WScript.Quit(0) else End If WScript.Quit(returncode) It'll fire off exeA, "If" that fails (with code 1), it'll run the other two exe's, then exit with a success code? Shouldn't it still exit with an error if 2nd exes fail though? (Can't really test it without the exes etc though, so might not work ) Steve 1
FN-GM Posted September 9, 2012 Author Posted September 9, 2012 Basically run Step A, If its exit code 1 run B & C If its Code 0 run step C without B I could give the .exe but they are configured specific for these Dell clients and will reset your BIOS password and reconfigure the setting. Thanks
Steve21 Posted September 9, 2012 Posted September 9, 2012 Basically run Step A, If its exit code 1 run B & C If its Code 0 run step C without B I could give the .exe but they are configured specific for these Dell clients and will reset your BIOS password and reconfigure the setting. Thanks Ah, try this one then: Set WshShell = CreateObject("WScript.Shell") returncode = WshShell.Run("biospassword1.exe") If returncode = 1 Then WshShell.Run("biospassword2.exe") WshShell.Run("ConfigureBios.exe") WScript.Quit(0) elseif returncode = 0 Then WshShell.Run("ConfigureBios.exe") End If WScript.Quit(returncode) Only thing is do you want it to still fail, and return codes if 2nd+ exe go wrong? or only on first one? Steve
FN-GM Posted September 9, 2012 Author Posted September 9, 2012 If an exit code 1 comes up, and biospassword2.exe & ConfigureBios.exe run ok, i dont want SCCM to know about exit code 1. I need both biospassword1.exe and biospassword2.exe as some machines out there dont have bios passwords set. thanks again
Steve21 Posted September 9, 2012 Posted September 9, 2012 If an exit code 1 comes up, and biospassword2.exe & ConfigureBios.exe run ok, i dont want SCCM to know about exit code 1. I need both biospassword1.exe and biospassword2.exe as some machines out there dont have bios passwords set. thanks again What I mean is currently in my script If returncode = 1 Then WshShell.Run("biospassword2.exe") WshShell.Run("ConfigureBios.exe") WScript.Quit(0) If it returns 1, it'll run the 2 exe's then force exit script with 0 (aka tells SCCM all is good). However it'll force exit on 0 even if biospassword2.exe bombs etc, as it's still telling it it exited ok. Did you want it to actually return the real codes from 2nd/3rd exe? Steve
FN-GM Posted September 9, 2012 Author Posted September 9, 2012 Im with you now Did you want it to actually return the real codes from 2nd/3rd exe? If possible Thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now