Video Screencast Help
Give us your opinion and win with Symantec! Please help us by taking this survey to tell us about your experience with Symantec Connect, so that we can continue to grow and improve.  Take the survey.

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.

Comments 1 CommentJump to latest comment

Palvaran's picture

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."

SOLUTION