Jump to content


sybux

How to use computer variables in TS

Recommended Posts

Hi,

 

I want to have in my TS the screen resolution change. So I've created 2 variables on my computers Xres and Yres to set to the good value.

 

Now my question (which is very tricky I'm sure), how can I use this variables in a "Run Command Line" step ?

 

Thx in advance for your help.

Share this post


Link to post
Share on other sites

AFAIK that trick only work post-winPE. So for the first half of your TS you can't use that method.

What I'd do is:

1)get setres.exe (http://www.iansharpe.com/setres.php)

2) make a package out of it, with no program

3) creat a run commandline step running "setres.exe H1024 V768 b16" with your package selected at the "package" checkbox

Share this post


Link to post
Share on other sites

Ok I've created a step like this :

 

setres.exe H%Hres% V%Vres% b16

 

HRes and Vres are variables set to computer.

Problem : during the OSD, the value are empty.

Share this post


Link to post
Share on other sites

what does your smsts.log file reveal ? how are you defining the variables and how are you running the Run Command Line step ?

Share this post


Link to post
Share on other sites

I don't understand why you are using collection variables (Vres & Hres) in my example? What does that accomplish compared to typing the values in directly?

Share this post


Link to post
Share on other sites

I don't understand why you are using collection variables (Vres & Hres) in my example? What does that accomplish compared to typing the values in directly?

The fact that I can use a global TS which read the value for each computer/collection

Share this post


Link to post
Share on other sites

what does your smsts.log file reveal ? how are you defining the variables and how are you running the Run Command Line step ?

 

Here is the output of the smsts.log. Variables are defined in the computer variable tab. And in the TS, I've created a step "Run Command Line", defined in the command line : setres.exe H%Hres% V%Vres% b16 and select a package which contains the setres.exe

 

 

Expand a string: smsswd.exe /run:HEG0000C setres.exe H%Hres% V%Vres% b16 TSManager 04.06.2012 14:53:41 1368 (0x0558)
Expand a string:  TSManager 04.06.2012 14:53:41 1368 (0x0558)
Command line for extension .exe is "%1" %* TSManager 04.06.2012 14:53:41 1368 (0x0558)
Set command line: smsswd.exe /run:HEG0000C setres.exe H%Hres% V%Vres% b16 TSManager 04.06.2012 14:53:41 1368 (0x0558)
Start executing the command line: smsswd.exe /run:HEG0000C setres.exe H%Hres% V%Vres% b16 TSManager 04.06.2012 14:53:41 1368 (0x0558)
!--------------------------------------------------------------------------------------------! TSManager 04.06.2012 14:53:41 1368 (0x0558)
Expand a string: WinPEandFullOS TSManager 04.06.2012 14:53:41 1368 (0x0558)
Executing command line: smsswd.exe /run:HEG0000C setres.exe H%Hres% V%Vres% b16 TSManager 04.06.2012 14:53:41 1368 (0x0558)
[ smsswd.exe ] InstallSoftware 04.06.2012 14:53:41 196 (0x00C4)
PackageID = 'HEG0000C' InstallSoftware 04.06.2012 14:53:41 196 (0x00C4)
BaseVar = '', ContinueOnError='' InstallSoftware 04.06.2012 14:53:41 196 (0x00C4)
ProgramName = 'setres.exe H%Hres% V%Vres% b16' InstallSoftware 04.06.2012 14:53:41 196 (0x00C4)
SwdAction = '0001' InstallSoftware 04.06.2012 14:53:41 196 (0x00C4)
DownloadOnDemand flag is true. Attempting to download content locally for Package HEG0000C.. InstallSoftware 04.06.2012 14:53:41 196 (0x00C4)
Package Flags: 0x1000000 InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
GetDirectoryListing() entered InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Initializing HTTP transport. InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
  Setting URL = http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/HEG0000C. InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
  Address=http://HEG-36.ge-em.ad.etat-ge.ch, Scheme=http, Object=/SMS_DP_SMSPKG$/HEG0000C, Port=80. InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
  Setting Authenticator. InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Set authenticator in transport InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
WinHttp credentials set InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
CLibSMSMessageWinHttpTransport::Send: URL: HEG-36.ge-em.ad.etat-ge.ch:80  PROPFIND /SMS_DP_SMSPKG$/HEG0000C InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
401 - Authentication failure on request with anonymous access, retrying with context credentials. InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Using thread token for request InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Request was succesful. InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
DAV response string is:
<?xml version="1.0" encoding="utf-8" ?><D:multistatus xmlns:D="DAV:"><D:response><D:href>http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/sccm?/HEG0000C/</D:href><D:propstat><D:status>HTTP/1.1 200 OK</D:status><D:prop><D:getcontenttype/><D:supportedlock/><D:getetag/><D:creationdate/><D:iscollection>1</D:iscollection><D:resourcetype><D:collection/></D:resourcetype><D:ishidden>0</D:ishidden><D:displayname>http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/sccm?/HEG0000C/</D:displayname><D:getlastmodified></D:getlastmodified><D:getcontentlanguage/><D:getcontentlength>0</D:getcontentlength></D:prop></D:propstat></D:response><D:response><D:href>http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/HEG0000C/sccm?/activateWindows.bat</D:href><D:propstat><D:status>HTTP/1.1 200 OK</D:status><D:prop><D:getcontenttype/><D:lockdiscovery/><D:supportedlock/><D:getetag/><D:getcontentlanguage/><D:iscollection>0</D:iscollection><D:creationdate/><D:resourcetype/><D:ishidden>0</D:ishidden><D:displayname>http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/HEG0000C/sccm?/activateWindows.bat</D:displayname><D:getlastmodified>Thu, 03 May 2012 08:31:05 GMT</D:getlastmodified><D:getcontentlength>116</D:getcontentlength></D:prop></D:propstat></D:response><D:response><D:href>http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/HEG0000C/sccm?/SetRes.exe</D:href><D:propstat><D:status>HTTP/1.1 200 OK</D:status><D:prop><D:getcontenttype/><D:lockdiscovery/><D:supportedlock/><D:getetag/><D:getcontentlanguage/><D:iscollection>0</D:iscollection><D:creationdate/><D:resourcetype/><D:ishidden>0</D:ishidden><D:displayname>http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/HEG0000C/sccm?/SetRes.exe</D:displayname><D:getlastmodified>Fri, 30 Apr 2010 19:58:50 GMT</D:getlastmodified><D:getcontentlength>22470</D:getcontentlength></D:prop></D:propstat></D:response><D:response><D:href>http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/HEG0000C/sccm?/SI_Tools.bat</D:href><D:propstat><D:status>HTTP/1.1 200 OK</D:status><D:prop><D:getcontenttype/><D:lockdiscovery/><D:supportedlock/><D:getetag/><D:getcontentlanguage/><D:iscollection>0</D:iscollection><D:creationdate/><D:resourcetype/><D:ishidden>0</D:ishidden><D:displayname>http://HEG-36.ge-em.ad.etat-ge.ch/SMS_DP_SMSPKG$/HEG0000C/sccm?/SI_Tools.bat</D:displayname><D:getlastmodified>Wed, 30 May 2012 14:00:35 GMT</D:getlastmodified><D:getcontentlength>24</D:getcontentlength></D:prop></D:propstat></D:response></D:multistatus> InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
List of files to be downloaded InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
 File: http://HEG-36.ge-em.ad.etat-ge.ch:80/SMS_DP_SMSPKG$/HEG0000C/sccm?/activateWindows.bat InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
 File: http://HEG-36.ge-em.ad.etat-ge.ch:80/SMS_DP_SMSPKG$/HEG0000C/sccm?/SetRes.exe InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
 File: http://HEG-36.ge-em.ad.etat-ge.ch:80/SMS_DP_SMSPKG$/HEG0000C/sccm?/SI_Tools.bat InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
GetDirectoryListing() successfully completed InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Succeeded loading resource DLL 'C:\Windows\CCM\1036\TSRES.DLL' InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
401 - Authentication failure on request with anonymous access, retrying with context credentials. InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Downloaded file from http://HEG-36.ge-em.ad.etat-ge.ch:80/SMS_DP_SMSPKG$/HEG0000C/sccm?/activateWindows.bat to C:\_SMSTaskSequence\Packages\HEG0000C\activateWindows.bat  InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
401 - Authentication failure on request with anonymous access, retrying with context credentials. InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Downloaded file from http://HEG-36.ge-em.ad.etat-ge.ch:80/SMS_DP_SMSPKG$/HEG0000C/sccm?/SetRes.exe to C:\_SMSTaskSequence\Packages\HEG0000C\SetRes.exe  InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
401 - Authentication failure on request with anonymous access, retrying with context credentials. InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Downloaded file from http://HEG-36.ge-em.ad.etat-ge.ch:80/SMS_DP_SMSPKG$/HEG0000C/sccm?/SI_Tools.bat to C:\_SMSTaskSequence\Packages\HEG0000C\SI_Tools.bat  InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Download done setting progress bar to 100 InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
VerifyContentHash: Hash algorithm is 32780 InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Content successfully downloaded at C:\_SMSTaskSequence\Packages\HEG0000C InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Resolved source to 'C:\_SMSTaskSequence\Packages\HEG0000C' InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Command line for extension .exe is "%1" %* InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Set command line: Run command line InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Working dir 'C:\_SMSTaskSequence\Packages\HEG0000C' InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Executing command line: Run command line InstallSoftware 04.06.2012 14:53:42 196 (0x00C4)
Process completed with exit code 1 InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
SETRES SINGLE MONITOR - v2.3 - 30 Apr 2010 (c) Ian Sharpe - www.iansharpe.com  InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
Open source software released under GPLv3 or greater (www.gnu.org/licenses/) InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
=============================================================================== InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
Change screen resolution, colour depth and refresh frequency in Windows InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
SETRES hXXXX vXXXX [bXX] [fXX] [n] InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
hXXXX = Horizontal size of screen in pixels		  Not optional. 640 minimum InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
vXXXX = Vertical size of screen in pixels			Not optional. 480 minimum InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 bXX = Bit (colour) depth such as 8, 16 24, 32	  Optional InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 fXX = Refresh frequncy in Hertz, e.g. 60, 75, 85   Optional InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
n = No 'Press a key' wait in error report		Optional InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
EXAMPLES: InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
SETRES h1024 v768 InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
SETRES h800 v600 b24 InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
SETRES h1280 v1024 b32 f75 InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
SETRES h1024 v768 n InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
WARNING: SETRES does not check the capabilities of your hardware. Windows InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
is supposed to reject unsupported settings but do not rely on this. InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
If you specify unsupported settings, I WILL NOT ACCEPT RESPONSIBILITY. InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
***  ERROR: Valid horizontal and/or vertical size not specified. 640x480 minimum.  *** InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN 15 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN 14 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN 13 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN 12 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN 11 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN 10 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN  9 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN  8 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN  7 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN  6 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN  5 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN  4 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN  3 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN  2 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
 PRESS A KEY - TIMEOUT IN  1 SECONDS - SEE SETRES.TXT FOR HELP InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
Command line returned 1 InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
Entering ReleaseSource() for C:\_SMSTaskSequence\Packages\HEG0000C InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
reference count 1 for the source C:\_SMSTaskSequence\Packages\HEG0000C before releasing InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
Delete source directory C:\_SMSTaskSequence\Packages\HEG0000C InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
Released the resolved source C:\_SMSTaskSequence\Packages\HEG0000C InstallSoftware 04.06.2012 14:53:57 196 (0x00C4)
Process completed with exit code 1 TSManager 04.06.2012 14:53:57 1368 (0x0558)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...