Feeding Windows Exit Code to Deployment Server/Solution
Created: 10 Aug 2012 | Updated: 13 Aug 2012 | 1 comment
This issue has been solved. See solution.
Hey Everyone,
I am trying to generate a script that can be run on a DS that can give user's a quick way to verify a registry setting.
Setx _scforce /k "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\scforceoption" /m
IF "%_scforce% " == "0" (
exit 10001
) ELSE (
IF "%_scforce% " == "1" (
exit 10002
))
Has anyone had any luck with this? I can set the variable, but I am having a difficult time sending that variable back to Windows and to the DS.
Discussion Filed Under:
Comments 1 Comment • Jump to latest comment
Got it working!
For future reference, here is an example of a script we created.
@echo off
for /f "tokens=*" %%a in ('"REG QUERY HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System /v scforceoption"') do set REGVAR=%%a
set REGVAR=%REGVAR:~-1%
IF %REGVAR% == 0 GOTO SCOFF
IF %REGVAR% == 1 GOTO SCON
GOTO EXIT
:SCOFF
exit 10001
GOTO EXIT
:SCON
exit 10002
GOTO EXIT
:EXIT
exit 10003
Systems Administrator
Rice University
Remember, "The happiness of your life, depends on the quality of your thoughts."
Would you like to reply?
Login or Register to post your comment.