<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>vbscript &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/vbscript/</link>
	<description>Feed of posts on WordPress.com tagged "vbscript"</description>
	<pubDate>Thu, 26 Nov 2009 09:22:50 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Nontraditional way to sort an Array]]></title>
<link>http://softwaretesting9.wordpress.com/2009/11/23/nontraditional-way-to-sort-an-array-using-vbscript/</link>
<pubDate>Mon, 23 Nov 2009 07:51:29 +0000</pubDate>
<dc:creator>Bibek Khatiwwaraa</dc:creator>
<guid>http://softwaretesting9.wordpress.com/2009/11/23/nontraditional-way-to-sort-an-array-using-vbscript/</guid>
<description><![CDATA[A question has been raised on one of the forums; &#8220;Is there any method to sort an array in VBSc]]></description>
<content:encoded><![CDATA[A question has been raised on one of the forums; &#8220;Is there any method to sort an array in VBSc]]></content:encoded>
</item>
<item>
<title><![CDATA[Identify Driver Problems in MDT 2010 Litetouch (new tool)]]></title>
<link>http://deployment.xtremeconsulting.com/2009/11/19/identify-driver-problems-in-mdt-2010-litetouch-new-tool/</link>
<pubDate>Thu, 19 Nov 2009 18:00:26 +0000</pubDate>
<dc:creator>keithga</dc:creator>
<guid>http://deployment.xtremeconsulting.com/2009/11/19/identify-driver-problems-in-mdt-2010-litetouch-new-tool/</guid>
<description><![CDATA[This tool is in response to a common question: In my MDT 2010 Litetouch environment, how do I identi]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>This tool is in response to a common question:</p>
<blockquote><p>In my MDT 2010 Litetouch environment, how do I identify which hardware devices are not being installed with the correct drivers?</p></blockquote>
<p>Introducing the “Yellow Bang” tool!</p>
<p>Yellow bang is a slang term used to describe drivers that have “problems” represented by a Yellow exclamation point ( ! ) in the Windows Device Manager:</p>
<p><a href="http://tmintner.files.wordpress.com/2009/11/image3.png"><img style="display:inline;border-width:0;" title="image" src="http://tmintner.files.wordpress.com/2009/11/image_thumb3.png?w=442&#038;h=152" border="0" alt="image" width="442" height="152" /></a></p>
<p>Now typically, most IT professionals will be using SCCM, that can gather from each machine in the environment, and query computer status in a more structured way. This solution is only designed for IT departments that are using Litetouch only.</p>
<h3>New Tool</h3>
<p>Use this tool in MDT 2010 to identify all drivers that have problems on a client machine running MDT Litetouch. These are the drivers that have a Yellow Exclamation point (Bang) in the Windows Device Manager. Simply add this script to your …\scripts\ directory, and add the script to your task sequence.</p>
<p>For each driver that is not working properly the details are written to the bdd.log and the ZTIYellowBang.log file for later review.</p>
<h3><strong>Example Output</strong></h3>
<p>For this example, I have a HP Laptop that is missing a driver for the ACPI\HPQ0004 device, which is the “HP 3D DriveGuard”. &#60;meh&#62;</p>
<pre>Microsoft Deployment Toolkit version: 5.0.1641.0
SUCCESS: 0: Create object: Set oScriptClass = New ZTIYellowBang  DRIVER_ERROR [28: Device drivers are not installed.]
DeviceID [ACPI\HPQ0004\3&#38;33FD14CA&#38;0]
HardwareID [ACPI\HPQ0004]
HardwareID [*HPQ0004]
CompatibleID []
ZTIYellowBang processing completed successfully.</pre>
<h3><strong>Steps</strong></h3>
<p>Simply copy the ZTIYellowBang.wsf script to the Deployment Share under the &#8230;\scripts\ directory. Then add the ZTIYellowBang.wsf script as a Step to your Task Sequence:</p>
<pre>Cscript.exe “%ScriptRoot%\ZTIYellowBang.wsf</pre>
<h3>Links</h3>
<p><a href="http://deploymentlive.com/blog/ZTIYellowBang.zip">ZTIYellowBang.zip</a></p>
<p>Keith</p>
<address><a href="http://keithga.com"><span style="color:#993300;">Keith Garner</span></a><span style="color:#993300;"> is a Deployment Specialist with </span><a href="http://deployment.xtremeconsulting.com/"><span style="color:#993300;">Xtreme Consulting Group</span></a></address>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Using built-in and system dialogs in QTP]]></title>
<link>http://automationbeyond.wordpress.com/2009/11/19/using-built-in-and-system-dialogs-in-qtp/</link>
<pubDate>Thu, 19 Nov 2009 13:03:53 +0000</pubDate>
<dc:creator>Albert Gareev</dc:creator>
<guid>http://automationbeyond.wordpress.com/2009/11/19/using-built-in-and-system-dialogs-in-qtp/</guid>
<description><![CDATA[Even though automated testing scripts are intended to communicate with application under test there ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Even though automated testing scripts are intended to communicate with application under test there are cases when communication with tester is required. With QTP, we can use either built-in <strong>MsgBox</strong> / <strong>InputBox</strong> functions or link standard Windows dialogs through COM.</p>
<p style="text-align:center;"><strong>MsgBox</strong></p>
<p>Use this function to report information (like value of a variable) during debugging or to report a critical issue that caused test execution to stop.</p>
<blockquote><p><strong><em>MsgBox(prompt[, buttons][, title][, helpfile, context])</em></strong><br />
&#8216;Example.<br />
Dim MyVar<br />
MyVar = MsgBox (&#8220;Hello World!&#8221;, 65, &#8220;MsgBox Example&#8221;)<br />
   &#8216; MyVar contains either 1 or 2, depending on which button is clicked.</p></blockquote>
<p>For a complete description please refer to Quick Test Professional Help.</p>
<p style="text-align:center;"><strong>InputBox</strong></p>
<p>Use this function to ask a tester to input a short simple value, like environment name. Do not use InputBox dialog for a long text input, like file path, or complex data input, like username/password.</p>
<blockquote><p><strong><em>InputBox(prompt[, title][, default][, xpos][, ypos][, helpfile, context])</em></strong><br />
&#8216;Example<br />
Dim Input<br />
Input = InputBox(&#8220;Enter your name&#8221;)<br />
MsgBox (&#8220;You entered: &#8221; &#38; Input)</p></blockquote>
<p>For a complete description please refer to Quick Test Professional Help.</p>
<p>For complex data input dialog you can <a href="http://automationbeyond.wordpress.com/2009/06/18/dotnetfactory-advanced/" target="_blank">create your own custom one</a> using DotNetFactory interface.</p>
<p style="text-align:center;"><strong>Standard Dialogs &#8211; MSComDlg</strong></p>
<p>The MSComDlg component could be used to display several types of dialogs: open file, save file, printer, color and font dialogs.</p>
<blockquote><p>&#8216;Example<br />
Dim CDLG<br />
<em><strong>Set CDLG = CreateObject(&#8220;MSComDlg.CommonDialog&#8221;)</strong></em><br />
  With CDLG<br />
    .DialogTitle = &#8220;Get me a File!&#8221;<br />
    .Filter = _<br />
      &#8220;Documents&#124;*.doc&#124;Templates&#124;*.dot&#124;Text Files&#124;*.txt&#8221;<br />
    .ShowOpen<br />
    MsgBox .FileName<br />
  End With<br />
  Set CDLG = Nothing</p></blockquote>
<p>You may refer to the following resource for additional information: MSDN Article <a href="http://msdn.microsoft.com/en-us/library/aa155724(office.10).aspx" target="_blank">Enhance Your Apps with Common Dialogs</a></p>
<p>You may experience a licensing issue with this control if you don&#8217;t have Visual  Studio installed on the machine executing the code that uses MSComDlg. To resolve the issue please refer to the <a href="http://support.microsoft.com/?kbid=168917" target="_blank">article</a> or use another dialog component.</p>
<p style="text-align:center;"><strong>Standard Dialogs &#8211; UserAccounts</strong></p>
<p>The UserAccounts component is available in Windows family beginning from Windows XP.</p>
<blockquote><p>&#8216;Create Dialog<br />
<strong><em>Set objDialog = CreateObject(&#8220;UserAccounts.CommonDialog&#8221;)</em></strong> <br />
objDialog.Filter = &#8220;Test Plan Spreadsheets&#124;*.xls&#8221; <br />
objDialog.FilterIndex = 1 <br />
objDialog.InitialDir = &#8220;C:\Test Suite\Test Plans&#8221; <br />
&#8216;Show Dialog<br />
intRC = objDialog.ShowOpen <br />
sTestPlan = objDialog.FileName<br />
&#8216;release<br />
Set objDialog = Nothing</p></blockquote>
<p>You may refer to the following resource for additional information and step-by-step explanations: <a href="http://blogs.technet.com/heyscriptingguy/archive/2005/01/28/how-can-i-show-users-a-dialog-box-for-selecting-files.aspx" target="_blank">How Can I Show Users a Dialog Box for Selecting Files?</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to add users to &ldquo;Remote Desktop Users&rdquo; Group]]></title>
<link>http://deployment.xtremeconsulting.com/2009/11/18/how-to-add-users-to-remote-desktop-users-group/</link>
<pubDate>Wed, 18 Nov 2009 18:00:19 +0000</pubDate>
<dc:creator>keithga</dc:creator>
<guid>http://deployment.xtremeconsulting.com/2009/11/18/how-to-add-users-to-remote-desktop-users-group/</guid>
<description><![CDATA[Someone posted a question recently that I thought was intresting: What is the correct way to use ZTI]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Someone posted a question recently that I thought was intresting:</p>
<blockquote><p>What is the correct way to use ZTIGroups.wsf, the Restore Groups MDT action, to populate local group membership of groups that have a space in the name?  As a test I’m trying to use CustomSettings.ini to add domain users/groups to the local Remote Desktop Users group.  I didn’t find a lot of detail in the MDT docs on doing anything other than Administrators or Power Users. </p></blockquote>
<p>I had done some work in ZTIGroups.wsf earlier this year. We added the ability to save the list of group names, and create the groups dynamically during restore time, in addition to the ability to add members to the group.</p>
<p>I had done testing with ZTIGroups.wsf, however I didn’t recall testing with the group “Remote Desktop Users” group. How did that work?</p>
<p>I tried running a command:</p>
<pre>C:\&#62;cscript ZTIGroups.wsf   /Groups1:"Remote Desktop Users"   "/Remote Desktop Users1:pickett\keith.garner"   /restore /Debug:True /DebugCapture</pre>
<p>While looking at the output I noticed that the script was looking for a new property: “RemoteDesktopUsers”, where did that come from?</p>
<p>It turns out that the ZTIGroups.wsf script will look for members using the properly name derived from the name of the group being populated, *without* the spaces in the property name.</p>
<p>So running a deployment with the following properties in the customsettings.ini worked:</p>
<pre>Groups001=Remote Desktop Users  RemoteDesktopUsers001=pickett\Keith.Garner</pre>
<p>Keith</p>
<address><a href="http://keithga.com"><span style="color:#993300;">Keith Garner</span></a><span style="color:#993300;"> is a Deployment Specialist with </span><a href="http://deployment.xtremeconsulting.com/"><span style="color:#993300;">Xtreme Consulting Group</span></a></address>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[QTP-XML service functions (7) - Add processing instruction]]></title>
<link>http://automationbeyond.wordpress.com/2009/11/15/qtp-xml-service-functions-7/</link>
<pubDate>Sun, 15 Nov 2009 12:12:19 +0000</pubDate>
<dc:creator>Albert Gareev</dc:creator>
<guid>http://automationbeyond.wordpress.com/2009/11/15/qtp-xml-service-functions-7/</guid>
<description><![CDATA[Parent page: Service Functions – XML (QTP, VBScript) Description This particular example demonstrate]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Parent page: <a title="Permanent Link to Service Functions – XML (QTP, VBScript)" rel="bookmark" href="http://automationbeyond.wordpress.com/2009/10/02/service-functions-xml/" target="_blank"><strong>Service Functions – XML (QTP, VBScript)</strong></a></p>
<p><span style="text-decoration:underline;"><strong>Description</strong></span></p>
<p>This particular example demonstrates adding XSL call that contains instructions transforming XML tree to a web-page (HTML).</p>
<p>Built-in QTP support for XML does not provide mapping for XML methods that operate special nodes, like <a href="http://www.developerfusion.com/samplechapter/1704/beginning-xml/10/" target="_blank">Processing Instructions</a>. It can be done through Microsoft XML DOM object.</p>
<blockquote><p>Dim objXMLDoc<br />
Dim objNode</p>
<p>Set objXMLDoc = CreateObject(&#8220;Microsoft.XMLDOM&#8221;)<br />
objXMLDoc.async = False<br />
objXMLDoc.load(&#8220;C:\Temp\textdiff.xml&#8221;)</p>
<p>Set objNode = objXMLDoc.CreateProcessingInstruction(&#8220;xml-stylesheet&#8221;, &#8220;type=&#8221;"text/xsl&#8221;" href=&#8221;".\showdiff.xsl&#8221;"&#8221;)<br />
objXMLDoc.InsertBefore objNode, objXMLDoc.FirstChild</p>
<p>objXMLDoc.Save(&#8220;C:\Temp\textdiff.xml&#8221;)</p>
<p>Set objXMLDoc = Nothing<br />
Set objNode = Nothing</p></blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Make ur computer "Talk"!!]]></title>
<link>http://gotoandcode.wordpress.com/2009/11/15/make-ur-computer-talk/</link>
<pubDate>Sun, 15 Nov 2009 03:29:54 +0000</pubDate>
<dc:creator>Abhilash MG Poovathur</dc:creator>
<guid>http://gotoandcode.wordpress.com/2009/11/15/make-ur-computer-talk/</guid>
<description><![CDATA[Open Notepad and type the following: Dim msg, sapi msg=InputBox(&#8220;Enter your text&#8221;,]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Open Notepad and type the following:</p>
<p>Dim msg, sapi<br />
msg=InputBox(&#8220;Enter your text&#8221;,&#8221;Talk it&#8221;)<br />
Set sapi=CreateObject(&#8220;sapi.spvoice&#8221;)<br />
sapi.Speak msg</p>
<p>Save the file with a (*.vbs) extension, it will create a VBScript File.<br />
Now open the saved file, input the text and press ok.&#8221;</p>
<p>U will hear what u typed&#8230; <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[QTP-XML service functions (6) – CreateChildElementByName]]></title>
<link>http://automationbeyond.wordpress.com/2009/11/14/qtp-xml-service-functions-6/</link>
<pubDate>Sat, 14 Nov 2009 12:34:22 +0000</pubDate>
<dc:creator>Albert Gareev</dc:creator>
<guid>http://automationbeyond.wordpress.com/2009/11/14/qtp-xml-service-functions-6/</guid>
<description><![CDATA[Parent page: Service Functions – XML (QTP, VBScript) Description Uses .AddChildElementByName method ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Parent page: <a title="Permanent Link to Service Functions – XML (QTP, VBScript)" rel="bookmark" href="http://automationbeyond.wordpress.com/2009/10/02/service-functions-xml/" target="_blank"><strong>Service Functions – XML (QTP, VBScript)</strong></a></p>
<p><span style="text-decoration:underline;"><strong>Description</strong></span></p>
<p>Uses .AddChildElementByName method to create a child XML node, then returns reference to the newly created object. If Parent XML node is not defined returns &#8220;Nothing&#8221;.</p>
<blockquote><p>Public Function CreateChildElementByName(ByRef objXMLParent, ByVal sTagName, ByVal sInnerText)<br />
 Dim objColl</p>
<p> If objXMLParent is Nothing Then<br />
  Set CreateChildElementByName = Nothing<br />
  Exit Function<br />
 End If</p>
<p> objXMLParent.AddChildElementByName sTagName, sInnerText</p>
<p> Set objColl = objXMLParent.ChildElementsByPath(“./”&#38;sTagName)<br />
 If objColl.Count &#62;0 Then<br />
  Set CreateChildElementByName = objColl.Item(objColl.Count)<br />
 Else<br />
  Set CreateChildElementByName = Nothing<br />
 End If<br />
 <br />
End Function</p></blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[QTP Script Examples]]></title>
<link>http://gcreddy.wordpress.com/2009/11/14/qtp-script-examples/</link>
<pubDate>Sat, 14 Nov 2009 07:41:20 +0000</pubDate>
<dc:creator>gcreddy</dc:creator>
<guid>http://gcreddy.wordpress.com/2009/11/14/qtp-script-examples/</guid>
<description><![CDATA[1)    Verify Login Boundary  (Check all the boundary conditions of the Login dialog box. Checks to s]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>1)    </strong><strong>Verify Login Boundary</strong><strong>  </strong>(Check all the boundary conditions of the Login dialog box. Checks to see if the correct message appears in the error window (Flight Reservation Message)</p>
<p>ApplicationDir = Environment(&#8220;ProductDir&#8221;)</p>
<p>ApplicationPath = &#8220;\samples\flight\app\flight4a.exe&#8221;</p>
<p>If  Window(&#8220;Flight Reservation&#8221;).Exist(2) Then</p>
<p>Window(&#8220;Flight Reservation&#8221;).Close</p>
<p>SystemUtil.Run ApplicationDir &#38; ApplicationPath</p>
<p>Elseif Not Dialog(&#8220;Login&#8221;).Exist(1) Then</p>
<p>SystemUtil.Run ApplicationDir &#38; ApplicationPath</p>
<p>End If</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set Datatable.Value (&#8220;AgentName&#8221;,dtGlobalSheet)</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).Set Datatable.Value (&#8220;Password&#8221;,dtGlobalSheet)</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>If  Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).Exist(1) and Datatable.Value (&#8220;Status&#8221;,dtGlobalSheet)=&#8221;Fail&#8221; Then</p>
<p>Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).Static(&#8220;Agent name must be at&#8221;).Check CheckPoint(&#8220;Agent name must be at least 4 characters long.&#8221;)</p>
<p>Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Elseif  Window(&#8220;Flight Reservation&#8221;).Exist(10) and Datatable.Value (&#8220;Status&#8221;,dtGlobalSheet)=&#8221;Pass&#8221; Then</p>
<p>Reporter.ReportEvent PASS,&#8221;Login: &#8220;,&#8221;Succeeded&#8221;                   </p>
<p>Else</p>
<p>Reporter.ReportEvent Fail,&#8221;Login: &#8220;,&#8221;Combination #&#8221; &#38; Datatable.GetCurrentRow  &#38; &#8221; was not according to Excel file&#8221;            </p>
<p>End If</p>
<p><strong> </strong></p>
<p><strong>2)    </strong><strong>Verify Cancel Operation</strong><strong> </strong>(in Login Dialog box, if user selects cancel button, before enter any data after enter data dialog box should be disappeared.)   <strong></strong></p>
<p>1)     Invokeapplication &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>2)     Dialog(&#8220;Login&#8221;).Activate</p>
<p>3)     Dialog(&#8220;Login&#8221;).WinButton(&#8220;Cancel&#8221;).Click</p>
<p>4)     If Dialog(&#8220;Login&#8221;).Exist (2) =True Then</p>
<p>5)     Reporter.ReportEvent 1,&#8221;sd&#8221;,&#8221;Fail&#8221;</p>
<p>6)     Else</p>
<p>7)     Reporter.ReportEvent 0,&#8221;sd&#8221;,&#8221;Pass&#8221;</p>
<p>8)     Invokeapplication &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>9)     End If</p>
<p>10) Dialog(&#8220;Login&#8221;).Activate</p>
<p>11) Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;asdf&#8221;</p>
<p>12) Dialog(&#8220;Login&#8221;).WinButton(&#8220;Cancel&#8221;).Click</p>
<p>13) If Dialog(&#8220;Login&#8221;).Exist (2) =True Then</p>
<p>14) Reporter.ReportEvent 1,&#8221;sd&#8221;,&#8221;Fail&#8221;</p>
<p>15) Else</p>
<p>16) Reporter.ReportEvent 0,&#8221;sd&#8221;,&#8221;Pass&#8221;</p>
<p>17) Invokeapplication &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>18) End If</p>
<p>19) Dialog(&#8220;Login&#8221;).Activate</p>
<p>20) Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;asdf&#8221;</p>
<p>21) Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4a993af45dcbd506c8451b274d2da07b38ff5531&#8243;</p>
<p>22) Dialog(&#8220;Login&#8221;).WinButton(&#8220;Cancel&#8221;).Click</p>
<p>23) If Dialog(&#8220;Login&#8221;).Exist (2)=True Then</p>
<p>24) Reporter.ReportEvent 1,&#8221;sd&#8221;,&#8221;Fail&#8221;</p>
<p>25) Else</p>
<p>26) Reporter.ReportEvent 0,&#8221;sd&#8221;,&#8221;Pass&#8221;</p>
<p>27) Invokeapplication &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>28) End If</p>
<p>29) Dialog(&#8220;Login&#8221;).Activate</p>
<p>30) Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;asdf&#8221;</p>
<p>31) Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4a993af45dcbd506c8451b274d2da07b38ff5531&#8243;</p>
<p>32) Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p><strong>3)    </strong><strong>Verify Addition, Subtraction, Multiplication and Division Operations in Calculator Application.</strong></p>
<p>1)     Dim aRes,sRes,dRes,mRes</p>
<p>2)     VbWindow(&#8220;VbWindow&#8221;).Activate</p>
<p>3)     VbWindow(&#8220;VbWindow&#8221;).VbEdit(&#8220;VbEdit&#8221;).Set &#8220;10&#8243;</p>
<p>4)     VbWindow(&#8220;VbWindow&#8221;).VbEdit(&#8220;VbEdit_2&#8243;).Set &#8220;20&#8243;</p>
<p>5)     v1=VbWindow(&#8220;VbWindow&#8221;).VbEdit(&#8220;VbEdit&#8221;).GetROProperty (&#8220;text&#8221;)</p>
<p>6)     v2=VbWindow(&#8220;VbWindow&#8221;).VbEdit(&#8220;VbEdit_2&#8243;).GetROProperty (&#8220;text&#8221;)</p>
<p>7)     VbWindow(&#8220;VbWindow&#8221;).VbButton(&#8220;ADD&#8221;).Click</p>
<p>8)     aRes=VbWindow(&#8220;VbWindow&#8221;).VbEdit(&#8220;VbEdit_3&#8243;).GetVisibleText</p>
<p>9)     VbWindow(&#8220;VbWindow&#8221;).VbButton(&#8220;SUB&#8221;).Click</p>
<p>10) sRes=VbWindow(&#8220;VbWindow&#8221;).VbEdit(&#8220;VbEdit_3&#8243;).GetVisibleText</p>
<p>11) VbWindow(&#8220;VbWindow&#8221;).VbButton(&#8220;MUL&#8221;).Click</p>
<p>12) mRes=VbWindow(&#8220;VbWindow&#8221;).VbEdit(&#8220;VbEdit_3&#8243;).GetVisibleText</p>
<p>13) VbWindow(&#8220;VbWindow&#8221;).VbButton(&#8220;DIV&#8221;).Click</p>
<p>14) dRes=VbWindow(&#8220;VbWindow&#8221;).VbEdit(&#8220;VbEdit_3&#8243;).GetVisibleText</p>
<p>15) v1=cdbl(v1)</p>
<p>16) v2=cdbl(v2)</p>
<p>17) aRes=cdbl (aRes)</p>
<p>18) sRes=cdbl (sRes)</p>
<p>19) mRes=cdbl (mRes)</p>
<p>20) dRes=cdbl (dRes)</p>
<p>21) If aRes=v1+v2 Then</p>
<p>22) Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Addition Passed&#8221;</p>
<p>23) else</p>
<p>24) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Addition Failed&#8221;</p>
<p>25) End If</p>
<p>26) If sRes=v1-v2 Then</p>
<p>27) Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Subtraction Passed&#8221;</p>
<p>28) else</p>
<p>29) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Subtraction Failed&#8221;</p>
<p>30) End If</p>
<p>31) If mRes=v1*v2 Then</p>
<p>32) Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Multiplecation Passed&#8221;</p>
<p>33) else</p>
<p>34) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Multiplecation Failed&#8221;</p>
<p>35) End If</p>
<p>36) If dRes=v1/v2 Then</p>
<p>37) Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Division Passed&#8221;</p>
<p>38) else</p>
<p>39) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Division Failed&#8221;</p>
<p>40) End If</p>
<p><strong>4) Verify state of Update Order Button, before open an Order and after open an Order </strong>(in Flight Reservation before opening an order Update Order button should be disabled after opening an order enabled.) </p>
<p>1)     Option explicit</p>
<p>2)     Dim bo,ao</p>
<p>3)     If Not window(&#8220;Flight Reservation&#8221;).Exist (2) Then</p>
<p>4)     SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>5)     Dialog(&#8220;Login&#8221;).Activate</p>
<p>6)     Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;Gcreddy&#8221;</p>
<p>7)     Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4aa8bce9984f1a15ea187a2da5b18c545abb01cf&#8221;</p>
<p>8)     Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>9)     End If</p>
<p>10) Window(&#8220;Flight Reservation&#8221;).Activate</p>
<p>11) bo=Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;Update Order&#8221;).GetROProperty (&#8220;Enabled&#8221;)</p>
<p>12) Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;Button&#8221;).Click</p>
<p>13) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Order No.&#8221;).Set &#8220;ON&#8221;</p>
<p>14) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinEdit(&#8220;Edit&#8221;).Set &#8220;1&#8243;</p>
<p>15) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>16) ao=Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;Update Order&#8221;).GetROProperty (&#8220;Enabled&#8221;)</p>
<p>17) If bo=False Then</p>
<p>18) Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Update Order Button Disabled&#8221;</p>
<p>19) else</p>
<p>20) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Update Order Button Enabled&#8221;</p>
<p>21) End If</p>
<p>22) If ao=True Then</p>
<p>23) Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Update Order Button Enabled&#8221;</p>
<p>24) else</p>
<p>25) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Update Order Button Disabled&#8221;</p>
<p>26) End If</p>
<p><strong>5) Price Consistency, In Flight Reservation </strong>(In Flight Reservation, First class price=3*Economy class price and Business class price=2*Economy class price)</p>
<p>1)     Option explicit</p>
<p>2)     Dim n,f,b,e</p>
<p>3)     If Not window(&#8220;Flight Reservation&#8221;).Exist (2) Then</p>
<p>4)     SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>5)     Dialog(&#8220;Login&#8221;).Activate</p>
<p>6)     Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;asdf&#8221;</p>
<p>7)     Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4aa8b7b7c5823680cfcb24d30714c9bbf0dff1eb&#8221;</p>
<p>8)     Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>9)     End If</p>
<p>10) For n= 1 to 10 step 1</p>
<p>11) Window(&#8220;Flight Reservation&#8221;).Activate</p>
<p>12) Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;Button&#8221;).Click</p>
<p>13) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Order No.&#8221;).Set &#8220;ON&#8221;</p>
<p>14) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinEdit(&#8220;Edit&#8221;).Set n</p>
<p>15) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>16) Window(&#8220;Flight Reservation&#8221;).WinRadioButton(&#8220;First&#8221;).Set</p>
<p>17) f=Window(&#8220;Flight Reservation&#8221;).WinEdit(&#8220;Price:&#8221;).GetVisibleText</p>
<p>18) Window(&#8220;Flight Reservation&#8221;).WinRadioButton(&#8220;Business&#8221;).Set</p>
<p>19) b=Window(&#8220;Flight Reservation&#8221;).WinEdit(&#8220;Price:&#8221;).GetVisibleText</p>
<p>20) Window(&#8220;Flight Reservation&#8221;).WinRadioButton(&#8220;Economy&#8221;).Set</p>
<p>21) e=Window(&#8220;Flight Reservation&#8221;).WinEdit(&#8220;Price:&#8221;).GetVisibleText</p>
<p>22) f=cdbl(mid(f,2,len (f-1)))</p>
<p>23) b=cdbl(mid(b,2,len (b-1)))</p>
<p>24) e=cdbl(mid(e,2,len (e-1)))</p>
<p>25) If f=3*e and b=2*e Then</p>
<p>26) Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Pricy Consistancy is there&#8221;</p>
<p>27) else</p>
<p>28) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Pricy Consistancy is NOT there&#8221;</p>
<p>29) End If</p>
<p>30) Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;Button_2&#8243;).Click</p>
<p>31) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Flight Reservations&#8221;).WinButton(&#8220;No&#8221;).Click</p>
<p>32) Next</p>
<p><strong>6) Verify Total, In Flight Reservation </strong>(In Flight Reservation, Total = Tickets * Price)<strong></strong></p>
<p>1)     Option Explicit</p>
<p>2)     Dim t,p,tot,n</p>
<p>3)     For n= 1 to 10 step 1</p>
<p>4)     If Not window(&#8220;Flight Reservation&#8221;).Exist (2) Then</p>
<p>5)     SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;,&#8221;",&#8221;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\&#8221;,&#8221;open&#8221;</p>
<p>6)     Dialog(&#8220;Login&#8221;).Activate</p>
<p>7)     Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;Gcreddy&#8221;</p>
<p>8)     Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4aa892d62c529f1c23298175ad78c58f43da8e34&#8243;</p>
<p>9)     Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>10) End If</p>
<p>11) Window(&#8220;Flight Reservation&#8221;).Activate</p>
<p>12) Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;Button&#8221;).Click</p>
<p>13) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Order No.&#8221;).Set &#8220;ON&#8221;</p>
<p>14) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinEdit(&#8220;Edit&#8221;).Set n</p>
<p>15) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>16) t=Window(&#8220;Flight Reservation&#8221;).WinEdit(&#8220;Tickets:&#8221;).GetVisibleText</p>
<p>17) p=Window(&#8220;Flight Reservation&#8221;).WinEdit(&#8220;Price:&#8221;).GetVisibleText</p>
<p>18) tot=Window(&#8220;Flight Reservation&#8221;).WinEdit(&#8220;Total:&#8221;).GetVisibleText</p>
<p>19) t=cdbl (t)</p>
<p>20) p=Cdbl(mid(p,2,len (p-1)))</p>
<p>21) tot=Cdbl(mid(tot,2,len (tot-1)))</p>
<p>22) If tot=t*p Then</p>
<p>23) Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Calculation Passed&#8221;</p>
<p>24) else</p>
<p>25) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Calculation Failed&#8221;</p>
<p>26) End If</p>
<p>27) Next</p>
<p><strong>7) Verify Flight From &#38; Flight To Combo Boxes </strong>(In Flight reservation, select an item from Fly From: combo box and verify weather that item available or not in Fly To: combo box, like this select all items one by one in Fly From and verify weather selected items available or not in Fly To.)<strong></strong></p>
<p>1)     Option explicit</p>
<p>2)     Dim qtp,flight_app,f,t,i,j,x,y</p>
<p>3)     If Not Window(&#8220;text:=Flight Reservation&#8221;).Exist (7)= True Then</p>
<p>4)     QTP=Environment(&#8220;ProductDir&#8221;)</p>
<p>5)     Flight_app=&#8221;\samples\flight\app\flight4a.exe&#8221;</p>
<p>6)     SystemUtil.Run QTP &#38; Flight_app</p>
<p>7)     Dialog(&#8220;text:=Login&#8221;).Activate</p>
<p>8)     Dialog(&#8220;text:=Login&#8221;).WinEdit(&#8220;attached text:=Agent Name:&#8221;).Set &#8220;asdf&#8221;</p>
<p>9)     Dialog(&#8220;text:=Login&#8221;).WinEdit(&#8220;attached text:=Password:&#8221;).SetSecure &#8220;4aa5ed3daf680e7a759bee1c541939d3a54a5b65&#8243;</p>
<p>10) Dialog(&#8220;text:=Login&#8221;).WinButton(&#8220;text:=OK&#8221;).Click</p>
<p>11) End If</p>
<p>12) Window(&#8220;text:=Flight Reservation&#8221;).Activate</p>
<p>13) Window(&#8220;text:=Flight Reservation&#8221;).WinButton(&#8220;window id:=6&#8243;).Click</p>
<p>14) Window(&#8220;text:=Flight Reservation&#8221;).ActiveX(&#8220;acx_name:=MaskEdBox&#8221;,&#8221;window id:=0&#8243;).Type &#8220;090910&#8243;</p>
<p>15) f=Window(&#8220;text:=Flight Reservation&#8221;).WinComboBox(&#8220;attached text:=Fly From:&#8221;).GetItemsCount</p>
<p>16) For i= 0 to f-1 step 1</p>
<p>17) Window(&#8220;text:=Flight Reservation&#8221;).WinComboBox(&#8220;attached text:=Fly From:&#8221;).Select (i)</p>
<p>18) x=Window(&#8220;text:=Flight Reservation&#8221;).WinComboBox(&#8220;attached text:=Fly From:&#8221;).GetROProperty (&#8220;text&#8221;)</p>
<p>19) t=Window(&#8220;text:=Flight Reservation&#8221;).WinComboBox(&#8220;attached text:=Fly To:&#8221;,&#8221;x:=244&#8243;,&#8221;y:=147&#8243;).GetItemsCount</p>
<p>20) For j= 0 to t-1 step 1</p>
<p>21) Window(&#8220;text:=Flight Reservation&#8221;).WinComboBox(&#8220;attached text:=Fly To:&#8221;,&#8221;x:=244&#8243;,&#8221;y:=147&#8243;).Select (j)</p>
<p>22) y=Window(&#8220;text:=Flight Reservation&#8221;).WinComboBox(&#8220;attached text:=Fly To:&#8221;,&#8221;x:=244&#8243;,&#8221;y:=147&#8243;).GetROProperty (&#8220;text&#8221;)</p>
<p>23) If x &#60;&#62; y Then</p>
<p>24) Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Test Passed&#8221;</p>
<p>25) Else</p>
<p>26) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Test Failed&#8221;</p>
<p>27) End If</p>
<p>28) Next</p>
<p>29) Next</p>
<p><strong> <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Verify Order No Entry in Flight Reservation.</strong><strong> </strong>(In Open Order dialog box, Order No object accepts numeric values only.)</p>
<p>1)     If Not window(&#8220;Flight Reservation&#8221;).Exist (2) Then</p>
<p>2)     SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>3)     Dialog(&#8220;Login&#8221;).Activate</p>
<p>4)     Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;asdf&#8221;</p>
<p>5)     Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4aa9ccae3bb00962b47ff7fb0ce3524c1d88cb43&#8243;</p>
<p>6)     Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>7)     End If</p>
<p>8)     Window(&#8220;Flight Reservation&#8221;).Activate</p>
<p>9)     Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;Button&#8221;).Click</p>
<p>10) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Order No.&#8221;).Set &#8220;ON&#8221;</p>
<p>11) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinEdit(&#8220;Edit&#8221;).Set &#8220;a&#8221;</p>
<p>12) ord=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinEdit(&#8220;Edit&#8221;).GetVisibleText</p>
<p>13) If ord= &#8220;a&#8221; Then</p>
<p>14) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Order No Object is taking invalid data&#8221;</p>
<p>15) else</p>
<p>16) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinEdit(&#8220;Edit&#8221;).Set &#8220;1&#8243;</p>
<p>17) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>18) End If</p>
<p><strong>9) Get Test Data from a Flat file and use in Data Driven Testing (through Scripting)</strong></p>
<p>1)     Dim fso,myfile</p>
<p>2)     Set fso=createobject(&#8220;scripting.filesystemobject&#8221;)</p>
<p>3)     Set myfile= fso.opentextfile (&#8220;F:\gcr.txt&#8221;,1)</p>
<p>4)     myfile.skipline</p>
<p>5)     While myfile.atendofline &#60;&#62; True</p>
<p>6)     x=myfile.readline</p>
<p>7)     s=split (x, &#8220;,&#8221;)</p>
<p>8)     SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>9)     Dialog(&#8220;Login&#8221;).Activate</p>
<p>10) Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set s(0)</p>
<p>11) Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure s(1)</p>
<p>12) Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>13) Window(&#8220;Flight Reservation&#8221;).Close</p>
<p>14) Wend</p>
<p><strong>10) Get Test Data From a Database and use in Data Driven Testing (through Scripting)</strong></p>
<p><strong> </strong></p>
<p>1)     Dim con,rs</p>
<p>2)     Set con=createobject(&#8220;Adodb.connection&#8221;)</p>
<p>3)     Set rs=createobject(&#8220;Adodb.recordset&#8221;)</p>
<p>4)     con.provider=(&#8220;microsoft.jet.oledb.4.0&#8243;)</p>
<p>5)     con.open &#8220;C:\Documents and Settings\Administrator\My Documents\Gcr.mdb&#8221;</p>
<p>6)     rs.open &#8220;Select * From Login&#8221;,con</p>
<p>7)     While rs.eof &#60;&#62;True</p>
<p>8)     SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>9)     Dialog(&#8220;Login&#8221;).Activate</p>
<p>10) Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set rs.fields (&#8220;Agent&#8221;)</p>
<p>11) Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).Set rs.fields (&#8220;Password&#8221;)</p>
<p>12) Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>13) Window(&#8220;Flight Reservation&#8221;).Close</p>
<p>14) rs.movenext</p>
<p>15) Wend</p>
<p><strong>11) Count, how many links available in Mercury Tours Home Page.</strong></p>
<p>1)     Set oDesc = Description.Create()</p>
<p>2)     oDesc(&#8220;micclass&#8221;).Value = &#8220;Link&#8221;</p>
<p>3)     Set Lists = Browser(&#8220;Welcome: Mercury&#8221;).Page(&#8220;Welcome: Mercury&#8221;).ChildObjects (oDesc)</p>
<p>4)     NumberOfLinks = Lists.Count()</p>
<p>5)     Reporter.ReportEvent 2,&#8221;Res&#8221;,&#8221;Number of Links are: &#8220;&#38;NumberOfLinks</p>
<p><strong>12) Count, how many Buttons and Edit boxes available in Flight Reservation main window.</strong></p>
<p>1)     If Not window(&#8220;Flight Reservation&#8221;).Exist (2) Then</p>
<p>2)     SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>3)     Dialog(&#8220;Login&#8221;).Activate</p>
<p>4)     Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;Gcreddy&#8221;</p>
<p>5)     Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).Set &#8220;mercury&#8221;</p>
<p>6)     Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>7)     End If</p>
<p>8)     Set oDesc = Description.Create()</p>
<p>9)     oDesc(&#8220;micclass&#8221;).Value = &#8220;WinButton&#8221;</p>
<p>10) Set Buttons = Window(&#8220;text:=Flight Reservation&#8221;).ChildObjects (oDesc)</p>
<p>11) Num_Buttons = Buttons.Count()</p>
<p>12) Set oDesc1=Description.Create()</p>
<p>13) oDesc1(&#8220;micclass&#8221;).Value=&#8221;WinEdit&#8221;</p>
<p>14) Set Editboxes=Window(&#8220;text:=Flight Reservation&#8221;).ChildObjects (oDesc1)</p>
<p>15) Num_Editboxes= editboxes.count ()</p>
<p>16) sum= Num_Buttons+Num_Editboxes</p>
<p>17) Reporter.ReportEvent 2, &#8220;Res&#8221;,&#8221;Total Buttons: &#8220;&#38; Num_Buttons &#38;&#8221;Total Edit boxes: &#8220;&#38; Num_Editboxes</p>
<p><strong>13) Verify search options in Open Order Dialog box</strong></p>
<p><strong>(</strong>After selecting open order, 3 search options should be enabled and not checked,</p>
<p>After selecting Order No option, other options should be disabled,</p>
<p>After selecting Customer Name, Flight date option enabled and Order No disabled</p>
<p>After selecting Flight date option, Customer Name enabled and Order No disabled<strong>)</strong></p>
<p>1)     If Not window(&#8220;Flight Reservation&#8221;).Exist (2) Then</p>
<p>2)     SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>3)     Dialog(&#8220;Login&#8221;).Activate</p>
<p>4)     Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;Gcreddy&#8221;</p>
<p>5)     Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4aa9ed25bc0ebde66ed726ad87d7e991347d8b9c&#8221;</p>
<p>6)     Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>7)     End If</p>
<p>8)     Window(&#8220;Flight Reservation&#8221;).Activate</p>
<p>9)     Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;Button&#8221;).Click</p>
<p>10) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).Activate</p>
<p>11) oe=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Order No.&#8221;).GetROProperty (&#8220;Enabled&#8221;)</p>
<p>12) ce=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Customer Name&#8221;).GetROProperty (&#8220;Enabled&#8221;)</p>
<p>13) fe=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Flight Date&#8221;).GetROProperty(&#8220;Enabled&#8221;)</p>
<p>14) oc=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Order No.&#8221;).GetROProperty (&#8220;Checked&#8221;)</p>
<p>15) cc=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Customer Name&#8221;).GetROProperty (&#8220;Checked&#8221;)</p>
<p>16) fc=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Flight Date&#8221;).GetROProperty(&#8220;Checked&#8221;)</p>
<p>17) If  (oe=true and ce=true and fe=true) and (oc=&#8221;OFF&#8221; and cc=&#8221;OFF&#8221; and fc=&#8221;OFF&#8221;) Then</p>
<p>18) Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Pass&#8221;</p>
<p>19) else</p>
<p>20) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Fail&#8221;</p>
<p>21) End If</p>
<p>22) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Order No.&#8221;).Set &#8220;ON&#8221;</p>
<p>23) ono=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Order No.&#8221;).GetROProperty (&#8220;Checked&#8221;)</p>
<p>24) If  Then</p>
<p>25) fd=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Flight Date&#8221;).GetROProperty (&#8220;Enabled&#8221;)</p>
<p>26) ono=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Customer Name&#8221;).GetROProperty (&#8220;Enabled&#8221;)</p>
<p>27) fd=false</p>
<p>28) ono=false</p>
<p>29) Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Pass&#8221;</p>
<p>30) else</p>
<p>31) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Fail&#8221;</p>
<p>32) End If</p>
<p>33) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Order No.&#8221;).Set &#8220;OFF&#8221;</p>
<p>34) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Customer Name&#8221;).Set &#8220;ON&#8221;</p>
<p>35) cn=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Customer Name&#8221;).GetROProperty (&#8220;Checked&#8221;)</p>
<p>36) If cn=&#8221;ON&#8221;  Then</p>
<p>37) ono=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Order No.&#8221;).GetROProperty (&#8220;Enabled&#8221;)</p>
<p>38) fd=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Flight Date&#8221;).GetROProperty (&#8220;Enabled&#8221;)</p>
<p>39) fd=True</p>
<p>40) ono=false</p>
<p>41) Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Pass&#8221;</p>
<p>42) else</p>
<p>43) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Fail&#8221;</p>
<p>44) End If</p>
<p>45) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Customer Name&#8221;).Set &#8220;OFF&#8221;</p>
<p>46) Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Flight Date&#8221;).Set &#8220;ON&#8221;</p>
<p>47) fd=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Flight Date&#8221;).GetROProperty (&#8220;Checked&#8221;)</p>
<p>48) If fd=&#8221;ON&#8221;  Then</p>
<p>49) ono=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Order No.&#8221;).GetROProperty (&#8220;Enabled&#8221;)</p>
<p>50) cn=Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Customer Name&#8221;).GetROProperty (&#8220;Enabled&#8221;)</p>
<p>51) cn=True</p>
<p>52) ono=false</p>
<p>53) Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Pass&#8221;</p>
<p>54) else</p>
<p>55) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Fail&#8221;</p>
<p>56) End If</p>
<p><strong>14) In Login Dialog box, Verify Help message </strong>(The message is ‘The password is &#8216;MERCURY&#8217;)</p>
<p>1)     If Not Dialog(&#8220;Login&#8221;).Exist (2) Then</p>
<p>2)     SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>3)     End If</p>
<p>4)     Dialog(&#8220;Login&#8221;).Activate</p>
<p>5)     Dialog(&#8220;Login&#8221;).WinButton(&#8220;Help&#8221;).Click</p>
<p>6)     message=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).Static(&#8220;The password is &#8216;MERCURY&#8217;&#8221;).GetROProperty(&#8220;text&#8221;)</p>
<p>7)     If message=&#8221;The password is &#8216;MERCURY&#8217;&#8221; Then</p>
<p>8)     Reporter.ReportEvent 0,&#8221;Res&#8221;,&#8221;Correct message &#8220;&#38;message</p>
<p>9)     else</p>
<p>10) Reporter.ReportEvent 1,&#8221;Res&#8221;,&#8221;Worng message &#8220;</p>
<p>11) End If</p>
<p><strong>15) Count all opened Browsers on desktop and close them all?</strong></p>
<p>1)     Set oDesc = Description.Create()</p>
<p>2)     oDesc(&#8220;micclass&#8221;).Value = &#8220;Browser&#8221;</p>
<p>3)     Set Browsers =Desktop.ChildObjects (oDesc)</p>
<p>4)     NumberofBrowsers = Browsers.Count()</p>
<p>5)     Reporter.ReportEvent 2,&#8221;Res&#8221;,&#8221;Number of Browsers are: &#8220;&#38;NumberOfBrowsers</p>
<p>6)     For Counter=0 to NumberofBrowsers-1</p>
<p>7)     Browsers(Counter).Close</p>
<p>8)     Next</p>
<p><strong> </strong></p>
<p><strong>16)</strong> <strong>Create an Excel file, enter some data and save the file through VB scripting? </strong></p>
<p><strong> </strong></p>
<p>1)     Dim objexcel</p>
<p>2)     Set objExcel = createobject(&#8220;Excel.application&#8221;)</p>
<p>3)     objexcel.Visible = True</p>
<p>4)     objexcel.Workbooks.add</p>
<p>5)     objexcel.Cells(1, 1).Value = &#8220;Testing&#8221;</p>
<p>6)     objexcel.ActiveWorkbook.SaveAs(&#8220;f:\exceltest.xls&#8221;)</p>
<p>7)     objexcel.Quit</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ZTIUtility.vbs updated version]]></title>
<link>http://deployment.xtremeconsulting.com/2009/11/13/ztiutility-vbs-updated-version/</link>
<pubDate>Fri, 13 Nov 2009 22:40:15 +0000</pubDate>
<dc:creator>keithga</dc:creator>
<guid>http://deployment.xtremeconsulting.com/2009/11/13/ztiutility-vbs-updated-version/</guid>
<description><![CDATA[Someone was asking this week about the official version of ZTIUtility.vbs used to fix the error: 0]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Someone was asking this week about the official version of ZTIUtility.vbs used to fix the error:</p>
<p>0&#215;800704C3</p>
<pre>ERROR_SESSION_CREDENTIAL_CONFLICT winerror.h
# Multiple connections to a server or shared
# resource by the same user, using more than
# one user name, are not allowed. Disconnect
# all previous connections  to the server or
# shared resource and try again.</pre>
<p>Microsoft posted a blog entry regarding this fix with a description of the changes:</p>
<p><a title="http://blogs.technet.com/msdeployment/archive/2009/09/18/fix-for-multiple-connections-to-a-server-or-shared-resource-by-the-same-user-using-more-than-one-user-name-are-not-allowed-problem-with-mdt-2010.aspx" href="http://blogs.technet.com/msdeployment/archive/2009/09/18/fix-for-multiple-connections-to-a-server-or-shared-resource-by-the-same-user-using-more-than-one-user-name-are-not-allowed-problem-with-mdt-2010.aspx">http://blogs.technet.com/msdeployment/archive/2009/09/18/fix-for-multiple-connections-to-a-server-or-shared-resource-by-the-same-user-using-more-than-one-user-name-are-not-allowed-problem-with-mdt-2010.aspx</a></p>
<p>However someone was asking about an official version:</p>
<blockquote><p>Is there an official KB yet  or an official patch I can grab?</p></blockquote>
<p>There is no official version out yet, but here is a link to a tested version of ZTIUtility.vbs with the fix:</p>
<p><a href="http://deploymentlive.com/blog/ZTIUtility.vbs">http://deploymentlive.com/blog/ZTIUtility.vbs</a></p>
<p>Keith</p>
<address><a href="http://keithga.com"><span style="color:#993300;">Keith Garner</span></a><span style="color:#993300;"> is a Deployment Specialist with </span><a href="http://deployment.xtremeconsulting.com/"><span style="color:#993300;">Xtreme Consulting Group</span></a></address>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[New Tool: MDT 2010 Build-out/Hydration Evaluation]]></title>
<link>http://deployment.xtremeconsulting.com/2009/11/13/new-tool-mdt-2010-build-outhydration-evaluation/</link>
<pubDate>Fri, 13 Nov 2009 18:05:28 +0000</pubDate>
<dc:creator>keithga</dc:creator>
<guid>http://deployment.xtremeconsulting.com/2009/11/13/new-tool-mdt-2010-build-outhydration-evaluation/</guid>
<description><![CDATA[I wanted to give a glimpse of some projects we are working here at Xtreme Consulting Services – Depl]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I wanted to give a glimpse of some projects we are working here at Xtreme Consulting Services – Deployment Team.</p>
<p>This is a Microsoft Deployment Toolkit 2010 Build-out (sometimes called Hydration) system.</p>
<p>It starts off as a small 3MB *.zip file. The MDTBuildout.exe program will automatically download all required files (around 10GB of riles), create a Virtual Machine running Windows Server 2008, and build out a functional MDT 2010 system. All the files downloaded are publicly avaiable over the internet.</p>
<p>This sample is *not* designed for production environments. The Server OS and Windows 7 Client OS&#8217;es downloaded are time-limited Evaluation versions of Microsoft OS’es, and not intended for production environments. If you would like to setup a functional system for your corporate environment, please let us know.</p>
<p>Xtreme Consulting Service’s Deployment Team is ready to assist you with your deployment needs.</p>
<h3>Features</h3>
<p>When complete, this Buildout (Hydration) system will create:</p>
<ul>
<li>A Virtual Machine running Windows Server 2008 (R1) x86 Server Standard.</li>
<li>MDT 2010, with all dependencies installed (including WAIK).
<ul>
<li>OS&#8217;es: <strong><span style="text-decoration:underline;">Server 2008</span></strong> R1 x86, <strong><span style="text-decoration:underline;">Windows 7</span></strong> x86 and <strong><span style="text-decoration:underline;">Windows 7</span></strong> x64.</li>
<li>Microsoft <strong><span style="text-decoration:underline;">Office 2007 </span></strong>Enterprise Evaluataion Version.</li>
<li>Applications: <strong><span style="text-decoration:underline;">7-zip, Foxit PDF Reader, MacroMedia player, Silverlight player, SQL Server 2008 Express, Sun Java Runtime, Video Lan Player, Windows Debugger (windbg).</span></strong></li>
<li>Sample Driver package: Intel Chipset drivers.</li>
<li>Sample Packages: <strong><span style="text-decoration:underline;">Windows 7 Language Packs</span></strong>, <strong><span style="text-decoration:underline;">Hyper-V Drivers, Remote Server Administration Tools (RSAT) </span></strong></li>
</ul>
</li>
<li><strong><span style="text-decoration:underline;">A Windows 7 Media build DVD image with Office 2007</span></strong>.</li>
<li>It will also enable a <strong><span style="text-decoration:underline;">PXE/WDS Service </span></strong>for servicing MDT 2010 WinPE Images (<strong><span style="text-decoration:underline;">no Domain Controller required</span></strong>).</li>
<li>A blank Virtual Machine ready to perform a capture of Windows 7 back to the MDT 2010 server.</li>
</ul>
<h3>Requirements</h3>
<ul>
<li>Your machine must be running windows with a version of either Hyper-V (for Windows Server 2008) or Virtual PC 7 (for Windows 7).</li>
<li>Your machine must have at least 2GB of ram, and 60GB of free hard disk space.</li>
</ul>
<h3>Walkthrough</h3>
<p>Download the MDTBuildout.zip file to your local machine and expand the contents to their own folder. You should see the manual: MDTBuildout.rtf and the Wizard Wrapper MDTBuildout.exe. Go ahead and launch the MDTBuildout.exe.</p>
<p>The MDTBuildout.exe wizard will guide you through the process of creating the virtual machine and downloading the necessary files to get it started. The wizard will create to Virtual Machines:</p>
<p>MDTVirtualServer &#8211; This is the Virtual Server that will host MDT 2010. It takes a couple of hours to setup, depending on the speed of your network connection.</p>
<p><a href="http://tmintner.files.wordpress.com/2009/11/image.png"><img style="display:inline;border-width:0;" title="image" src="http://tmintner.files.wordpress.com/2009/11/image_thumb.png?w=244&#038;h=195" border="0" alt="image" width="244" height="195" /></a></p>
<p>MDTVirtualClient &#8211; This Virtual Machine will be used later on to capture a reference image of Windows 7 with Office 2007.</p>
<p><a href="http://tmintner.files.wordpress.com/2009/11/image1.png"><img style="display:inline;border-width:0;" title="image" src="http://tmintner.files.wordpress.com/2009/11/image_thumb1.png?w=244&#038;h=195" border="0" alt="image" width="244" height="195" /></a></p>
<p>It is recommended that you use the default settings during the MDTBuildout.exe wizard, although, you can override the settings if required. Be sure to give the Virtual Machines enough memory, place the *.VHD files on a disk with 40+GB of space free, and select the Virtual Networking adapter with internet access.</p>
<p>When you select &#8220;Build&#8221; the wizard will begin the process of downloading the Windows Server 2008 Eval *.iso file to the local machine, this file is about 1.8GB. When done, the wizard will automatically create the virtual machines with the required parameters, and start the process. You can continue to watch the progress in the VM window.</p>
<p>The entire build process can take several hours depending on the speed of your network connection. Let the install run. When complete, you should see a dialog showing the status.</p>
<p>The password for the MDT Server is: P@ssword</p>
<p>When complete, you can start the MDT 2010 Workbench (start &#8211;&#62; Microsoft Deployment Toolkit &#8211;&#62; Deployment Workbench), and view the components added to the system.</p>
<p><a href="http://tmintner.files.wordpress.com/2009/11/image2.png"><img style="display:inline;border-width:0;" title="image" src="http://tmintner.files.wordpress.com/2009/11/image_thumb2.png?w=244&#038;h=205" border="0" alt="image" width="244" height="205" /></a></p>
<p>The deployment share should be at: c:\deploymentshare</p>
<p>The media share should be at: c:\media</p>
<p>If you wish, you can start the PXE server, to allow other computers on the network to boot into MDT 2010, this is a great way to upgrade machines on your corporate network in a &#8220;self-service&#8221; fashion. To enable the pxe server, run the command &#8220;net start wdsserver&#8221;. <span style="color:#ff0000;"><strong>WARNING</strong>: The PXE/WDS Server running on the Virtual Machine *will* conflict with other PXE/WDS servers on the network.</span><span style="color:#ff0000;"> Please ensure that you are the *only* PXE/WDS server on the network before starting! This is why the WDS service is disabled by default.</span></p>
<p>You can also burn the contents of the Win7 Media ISO to a DVD drive. Or perhaps copy the *.iso file to the local machine.</p>
<p>Use this server to evaluate MDT 2010 and try deploying Windows 7 (Evaluation Version), to your test lab.</p>
<p>When ready, you can boot the MDTVirtualClient Virtual Machine, using either the Win7 Media ISO image, or PXE/WDS. The Client Virtual Machine has been specially configured to auto install Windows 7 and upload the captured image back to the MDT 2010 Server in a completely hands off fashion.</p>
<p>More documentation, walkthroughs, and videos to follow.</p>
<h3>Link</h3>
<p><a href="http://deploymentlive.com/blog/MDTBuildout.zip">MDTBuildout.zip</a></p>
<p>Keith</p>
<address><a href="http://keithga.com"><span style="color:#993300;">Keith Garner</span></a><span style="color:#993300;"> is a Deployment Specialist with </span><a href="http://deployment.xtremeconsulting.com/"><span style="color:#993300;">Xtreme Consulting Group</span></a></address>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[The Case of the Disappearing Task Sequences]]></title>
<link>http://deployment.xtremeconsulting.com/2009/11/13/the-case-of-the-disappearing-task-sequences/</link>
<pubDate>Fri, 13 Nov 2009 15:00:08 +0000</pubDate>
<dc:creator>tmintner</dc:creator>
<guid>http://deployment.xtremeconsulting.com/2009/11/13/the-case-of-the-disappearing-task-sequences/</guid>
<description><![CDATA[We’ve gotten quite a few emails on this so I figured it was time to put this on the blog.   The prob]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>We’ve gotten quite a few emails on this so I figured it was time to put this on the blog. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   The problem that most people run into is that sometimes when they go through the Lite Touch Client Deployment Wizard, the task sequence list is empty.  So what causes the task sequence list to be empty?  The simple answer is if the DeployRoot cannot be found or is incorrect.  The DeployRoot is the location of the DeploymentShare or content of the MDT Media Point. </p>
<p>&#160;</p>
<p>Here is the basic process that should help troubleshoot the problem:</p>
<p>· Windows PE boots up and runs litetouch.wsf</p>
<p>· Litetouch.wsf calls ztigather /inifile:bootstrap.ini and the DeployRoot value is read from the bootstrap.ini</p>
<p>· Litetouch.wsf then makes a call to connect to the DeployRoot using the wizard credentials or the credentials in the bootrap.ini</p>
<p>· Litetouch.wsf then calls ztigather and reads the values from the customsettings.ini (note if a full Media Deployment is inserted in the DVD or USB drive the customsettings.ini will be read from that location instead of the DeployRoot)</p>
<p>· If the DeployRoot value has changed In the customsettings.ini, the value is updated and Litetouch.wsf tries to connect to the DeployRoot</p>
<p>· The wizard is started and the tasksequences.xml file is read from the DeployRoot</p>
<p>· If the DeployRoot does not contain a valid tasksequences.xml then a blank Task Sequence wizard is displayed</p>
<p>&#160;</p>
<p>Steps to troubleshoot:</p>
<p>· Open BDD.Log</p>
<p>· Search for the value DeployRoot and do a Find Next to make sure that all values in the log file for DeployRoot are the same.  If they are not then there is some setting either in CustomSettings.ini, the database, or on local media that is changing the value</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Getting Debug information in Client Scripts]]></title>
<link>http://deployment.xtremeconsulting.com/2009/11/05/getting-debug-information-in-client-scripts/</link>
<pubDate>Thu, 05 Nov 2009 19:00:48 +0000</pubDate>
<dc:creator>keithga</dc:creator>
<guid>http://deployment.xtremeconsulting.com/2009/11/05/getting-debug-information-in-client-scripts/</guid>
<description><![CDATA[(New for MDT 2010) Most of the client script in BDD/MDT are written in VBScript. VBScript is a power]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><em>(New for MDT 2010)</em></p>
<p>Most of the client script in BDD/MDT are written in VBScript. VBScript is a powerful scripting language, and it is avaiable on <strong><em>all </em></strong>versions of windows that MDT supports.</p>
<p>I would have loved to work in a more modern language like Powershell and/or C#, however when deploying an operating system from scratch, there are very few guarantees what kind of run time environments are going to be available. The .NET framework, for example, is not available on Windows XP. So back to VBScript for me.</p>
<h4>Error Handling</h4>
<p>VBScript has the ability to skip/ignore errors if it comes across them when executing them, using the “On error resume next” command.</p>
<p>This can be helpful if you have a long series of non-interdependent tasks. However if you have a long set of dependent tasks, this can be problematic since the failure of any one step in the task could cause the entire thing to fail.</p>
<p>I would have to agree with Eric Lippert’s <a href="http://blogs.msdn.com/ericlippert/archive/2004/08/25/error-handling-in-vbscript-part-three.aspx">comments</a> about error handling in VBScript (He was one of the architects of VBScript):</p>
<blockquote><p>I think I&#8217;m old school in saying that error handling should be very tight. Handle errors where you expect to find them. Everything else is left to fail. <strong>I&#8217;d rather have a program end in a messy death than to blithely continue on in an unpredictable fashion</strong>. Some of my cohorts would rather do broad error handling (whole subroutines or sections of the script). They seem to assume that only the errors they expect will happen. And even if other errors do happen, it&#8217;s better to have the script finish as best it can than to do nothing at all.</p>
</blockquote>
<p>Most of the code in the MDT client scripts is written with this in mind. If it’s possible for a routine to return an error, the script will handle the error cases. If the results of a routine are unexpected or bad, then we want to halt execution to be notified of the problem, rather than continue in an unexpected state.</p>
<h4>MDT Error Handling</h4>
<p>BDD/MDT was written with a really cool feature that allows it to pick up run time errors identified by the VBScript host program. These errors are logged to the bdd.log file for review later.</p>
<p>The only problem is that the built in error handling routines made available by the VBScript Host program are not as complete as if we were to run it using cscript.exe with the error written to the console.</p>
<p>For example, here is what an undefined variable error would look like when processed by MDT and it’s built in error handling routines:</p>
<pre>c:\&#62;cscript zti_test.wsf
ZTI ERROR - Unhandled error returned by
zti_test: Variable is undefined (500)</pre>
<p>New for MDT 2010, is the ability to disable the “on error resume next” main error handler in all MDT client VBScript programs, with the “<strong><span style="text-decoration:underline;">/DebugCapture</span></strong>” flag. When we run the same script with that flag, we get the following output:</p>
<pre>c:\&#62;cscript zti_test.wsf <strong>/debugcapture</strong>
Property debugcapture is now =
c:\zti_test.wsf(10, 10) Microsoft
VBScript runtime error: Variable
is undefined: 'UndefinedVariableFoo'</pre>
<p>Note that when calling the script with the /debugcapture flag, the cscript.exe host program not only found the run time error as in the previous example, but it also displayed the <strong><span style="text-decoration:underline;">line number</span></strong> where the error occurred and the <strong><span style="text-decoration:underline;">name</span></strong> of the actual variable!?!?</p>
<p>Really cool stuff, and it has been invaluable for me while debugging scripts in MDT 2010.</p>
<p>Keith</p>
<address><a href="http://keithga.com"><span style="color:#993300;">Keith Garner</span></a><span style="color:#993300;"> is a Deployment Specialist with </span><a href="http://deployment.xtremeconsulting.com/"><span style="color:#993300;">Xtreme Consulting Group</span></a></address>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Adobe Reader Script - Part 01 - cscript Invocation]]></title>
<link>http://transmitterdown.wordpress.com/2009/11/05/adobe-reader-script-part-01-cscript-invocation/</link>
<pubDate>Thu, 05 Nov 2009 08:04:46 +0000</pubDate>
<dc:creator>Michael</dc:creator>
<guid>http://transmitterdown.wordpress.com/2009/11/05/adobe-reader-script-part-01-cscript-invocation/</guid>
<description><![CDATA[Let&#8217;s start at the beginning. Dave wrote: cscript &#8220;\\LocalServer\share\folder\adberdr81S]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Let&#8217;s start at the beginning.</p>
<p><a href="http://transmitterdown.wordpress.com/2009/11/03/script-to-check-adobe-version-and-update-if-needed/" target="_blank">Dave wrote</a>:</p>
<blockquote><p>cscript &#8220;\\LocalServer\share\folder\adberdr81Silent\setup files\adobe814.vbs&#8221; /quiet /passive</p>
<p>This calls the script silently and does not ask the user if they want to run or whatever other BS safety messages Windows XP vomits at you normally when you run a file off the network.</p></blockquote>
<p>Before we analyze this, let&#8217;s take a quick look at the help output from cscript:</p>
<blockquote><p>&#62; cscript /?<br />
Microsoft (R) Windows Script Host Version 5.7<br />
Copyright (C) Microsoft Corporation. All rights reserved.</p>
<p>Usage: CScript scriptname.extension [option...] [arguments...]</p>
<p>Options:<br />
//B         Batch mode: Suppresses script errors and prompts from displaying<br />
//D         Enable Active Debugging<br />
//E:engine  Use engine for executing script<br />
//H:CScript Changes the default script host to CScript.exe<br />
//H:WScript Changes the default script host to WScript.exe (default)<br />
//I         Interactive mode (default, opposite of //B)<br />
//Job:xxxx  Execute a WSF job<br />
//Logo      Display logo (default)<br />
//Nologo    Prevent logo display: No banner will be shown at execution time<br />
//S         Save current command line options for this user<br />
//T:nn      Time out in seconds:  Maximum time a script is permitted to run<br />
//X         Execute script in debugger<br />
//U         Use Unicode for redirected I/O from the console</p></blockquote>
<p>You will notice two things:</p>
<ol>
<li>&#8220;/quiet&#8221; and &#8220;/passive&#8221; are not cscript options.</li>
<li>All cscript options have a double forward slash. (//)</li>
</ol>
<p>So where are Dave&#8217;s options going? I wrote a quick script to demonstrate what happens to them. This script simply says &#8216;return the first and second argument passed to the script&#8217;. Here is the script:</p>
<blockquote><p>&#8216; quiet and passive demo.vbs<br />
wscript.echo &#8220;Parameter 1 : &#8221; &#38; Wscript.Arguments(0)<br />
wscript.echo &#8220;Parameter 2 : &#8221; &#38; Wscript.Arguments(1)</p></blockquote>
<p>Here is the result if we don&#8217;t pass any arguments:</p>
<blockquote><p>&#62; cscript &#8220;quiet and passive demo.vbs&#8221;<br />
Microsoft (R) Windows Script Host Version 5.7<br />
Copyright (C) Microsoft Corporation. All rights reserved.</p>
<p>C:\Documents and Settings\mmientus\Desktop\Dave\Adobe Reader Script\quiet and passive demo.vbs(2, 1) Microsoft VBScript runtime error: Subscript out of range</p></blockquote>
<p>Here is the result if we pass two arguments:</p>
<blockquote><p>&#62; cscript &#8220;quiet and passive demo.vbs&#8221; /quiet /passive<br />
Microsoft (R) Windows Script Host Version 5.7<br />
Copyright (C) Microsoft Corporation. All rights reserved.</p>
<p>Parameter 1 : /quiet<br />
Parameter 2 : /passive</p></blockquote>
<p>As you can see, the script has a hold of those parameters and not cscript.</p>
<p>The next logical question is, &#8220;So does Dave&#8217;s script use those parameters?&#8221; A quick text search of Dave&#8217;s script reveals no Wscript.Arguments calls. So we can logically conclude that Dave&#8217;s script does not use the &#8220;/quiet&#8221; and &#8220;/passive&#8221; parameters passed to it.</p>
<p>But, maybe the arguments are getting magically passed to the setup file via the shell invocation in Dave&#8217;s script. And the setup file is then using those parameters.</p>
<p>Let&#8217;s check.</p>
<p>We&#8217;ve already got a script that can tell us what parameters were passed to it. Now all we have to do is mimic Dave&#8217;s shell call to see how parameters are handled inside VBScript. Maybe parameters are implicitly passed to the shell invocation.</p>
<p>Below is a script that depends on that first script already being in the same directory. The second demo script takes two parameters and makes a call similar to Dave&#8217;s &#8220;WshShell.Run &#8220;setup.exe&#8221;" call including the commands that set up that call. In this first call/test, we are testing to see if arguments passed to the script are implicitly passed to the shell invocation. And we do this by making *no mention* of &#8220;Wscript.Argument&#8221; in the call. Here is the first test:</p>
<blockquote><p>WshShell.Run &#8220;wscript &#8221; &#38; chr(34) &#38; &#8220;quiet and passive demo.vbs&#8221; &#38; chr(34)</p></blockquote>
<p>The next thing the script does is make the same call again and explicitly include the arguments passed to the script. Here is the second test:</p>
<blockquote><p>WshShell.Run &#8220;wscript &#8221; &#38; chr(34) &#38; &#8220;quiet and passive demo.vbs&#8221; &#38; chr(34) &#38; &#8221; &#8221; &#38; Wscript.Arguments(0) &#38; &#8221; &#8221; &#38; Wscript.Arguments(1)</p></blockquote>
<p>Here is the whole script:</p>
<blockquote><p>&#8216; demo 2 arguments.vbs<br />
&#8216; where do the arguments go?<br />
On Error Resume Next<br />
Set WshShell = WScript.CreateObject(&#8220;WScript.Shell&#8221;)<br />
strCurrentDirectory = left(WScript.ScriptFullName,(Len(WScript.ScriptFullName))-(Len(WScript.ScriptName)))<br />
WshShell.CurrentDirectory = strCurrentDirectory<br />
&#8216; command being sent to the shell:<br />
&#8216; wscript &#8220;quiet and passive demo.vbs&#8221;<br />
WshShell.Run &#8220;wscript &#8221; &#38; chr(34) &#38; &#8220;quiet and passive demo.vbs&#8221; &#38; chr(34)<br />
&#8216; wscript &#8220;quiet and passive demo.vbs&#8221; /quiet /passive<br />
WshShell.Run &#8220;wscript &#8221; &#38; chr(34) &#38; &#8220;quiet and passive demo.vbs&#8221; &#38; chr(34) &#38; &#8221; &#8221; &#38; Wscript.Arguments(0) &#38; &#8221; &#8221; &#38; Wscript.Arguments(1)</p></blockquote>
<p>You&#8217;ll have to copy and paste both scripts above and run the second demo yourself. I chose to use wscript in my example because cscript just opens and closes a command prompt window before you can read any of the output. And that is not very helpful. By using wscript, we can see the output from the tests. Also note I set &#8220;On Error Resume Next&#8221; so the first error (if there is one) will be ignored and we can see the result of our second test without having to do anything extra.</p>
<p>When you run this second demo, you will see the wscript output of the first test reads:</p>
<blockquote><p>Subscript out of range</p></blockquote>
<p>We get that error whenever we ask for an argument we have not passed to the script. We saw it when we ran the first demo with no arguments. And it is exactly what we would expect if VBScript *is not* implicitly passing parameters to shell invocations. This first result is strong evidence the arguments (/quiet and /passive) are not being implicitly passed to the shell.</p>
<p>Let&#8217;s take a look at the result from the second test:</p>
<blockquote><p>Parameter: 1 and Parameter: 2</p></blockquote>
<p>This is the same output we got when we passed two arguments to our original demo.</p>
<p>So we indeed have to pass the arguments explicitly to the shell.</p>
<p>And all this means that /quiet and /passive aren&#8217;t doing anything in Dave&#8217;s logon script. So Dave, what happens when you take those two options out of the logon script?</p>
<p>Finally, all this begs the question, &#8220;How do I suppress cscript output?&#8221; Well, we had the answer all along. Let&#8217;s go back and take a look at this option from the cscript help output:</p>
<blockquote><p>//B         Batch mode: Suppresses script errors and prompts from displaying</p></blockquote>
<p>It looks exactly like what we need. And it is. Let&#8217;s take a look at the first demo again, but this time with a different invocation:</p>
<blockquote><p>&#62; cscript &#8220;quiet and passive demo.vbs&#8221; //B /quiet /passive</p>
<p>&#62;</p></blockquote>
<p>We get no output as expected.</p>
<p>Hopefully, I have shed some light on this part of Dave&#8217;s logon script. And hopefully I have shed some light on how to use cscript and VBScript.</p>
<p>I will be breaking down and explaining the other parts of Dave&#8217;s post in the coming days.</p>
<p>Mike</p>
<p>PS</p>
<p>Here are the scripts and output in convenient PDF documents.</p>
<ul>
<li><a href="http://transmitterdown.wordpress.com/files/2009/11/2009-11-05-01-09-48-quiet-and-passive-demo.pdf" target="_blank">quiet and passive demo</a></li>
<li><a href="http://transmitterdown.wordpress.com/files/2009/11/2009-11-05-01-09-28-demo-2-arguments.pdf" target="_blank">demo 2 arguments</a></li>
<li><a href="http://transmitterdown.wordpress.com/files/2009/11/2009-11-05-01-55-44-my-reply.pdf" target="_blank">my reply</a></li>
<li><a href="http://transmitterdown.wordpress.com/files/2009/11/2009-11-05-01-49-44-output.pdf" target="_blank">output</a></li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Troubleshooting Database Issues with MDT 2010]]></title>
<link>http://deployment.xtremeconsulting.com/2009/11/04/troubleshooting-database-issues-with-mdt-2010/</link>
<pubDate>Wed, 04 Nov 2009 20:00:30 +0000</pubDate>
<dc:creator>tmintner</dc:creator>
<guid>http://deployment.xtremeconsulting.com/2009/11/04/troubleshooting-database-issues-with-mdt-2010/</guid>
<description><![CDATA[There have been a few really great posts on how to troubleshoot database connection issues with BDD ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>There have been a few really great posts on how to troubleshoot database connection issues with BDD and MDT over the past couple of years.  Ben Hunter wrote a great post on this here: <a title="http://blogs.technet.com/benhunter/archive/2007/07/10/bdd-2007-troubleshooting-database-issues.aspx" href="http://blogs.technet.com/benhunter/archive/2007/07/10/bdd-2007-troubleshooting-database-issues.aspx">http://blogs.technet.com/benhunter/archive/2007/07/10/bdd-2007-troubleshooting-database-issues.aspx</a>.  However, if you try to do this with MDT 2010 you will get a few errors in the output.  In MDT 2010 the structure of the scripts have changed somewhat and the functionality of ztigather has been extended to also gather additional information that now requires some compiled code.  So with MDT 2010, you can perform the same steps with the following modifications:</p>
<p>1. Create a folder on the client device and copy the following files from the deployment point to this folder:</p>
<ul>
<li>ZTIGather.wsf</li>
<li>ZTIGather.xml</li>
<li>ZTIUtility.vbs</li>
<li>CustomSettings.ini</li>
<li>ZTIDataAccess.vbs (new script file in MDT 2010 for accessing data sources)</li>
<li>Create a Tools folder and create an X86 and X64 folders underneath the Tools folder.  Copy the Microsoft.BDD.Utility.dll file from the Tools\X64 and Tools\X86 folders in your deployment share to your newly created Tools\X86 and Tools\X64 folder</li>
</ul>
<p>  2. Delete C:\MININT directory if it already exists. This folder can also be located at X:\MININT if the C drive is not available.</p>
<p><em><strong>NOTE: </strong>MDT stores configuration and progress information in the MININT folder, if this folder is not removed between tests then the results will be invalid.</em></p>
<p>  3. From the command prompt navigate to the newly created folder and execute the rule processing script using the following command:</p>
<blockquote><p><em>&#8220;cscript.exe ZTIGather.wsf /debug:true&#8221;</em></p></blockquote>
<p>      The script will then be processed and the results outputted to the command prompt and a log file ( .\MININT\SMSOSD\OSDLOGS\ZTIGather.log)</p>
<p><em><strong>NOTE: </strong>The script can be run within Windows PE or the host operating system.</em></p>
<p>  4. Review the results of the script.</p>
<p>Enjoy!</p>
<p>Tim Mintner is a Principal Consultant with Xtreme Consulting Group</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Windows Password Change Notification Script]]></title>
<link>http://smtpport25.wordpress.com/2009/11/04/windows-password-change-notification-script/</link>
<pubDate>Wed, 04 Nov 2009 14:08:36 +0000</pubDate>
<dc:creator>Krishna</dc:creator>
<guid>http://smtpport25.wordpress.com/2009/11/04/windows-password-change-notification-script/</guid>
<description><![CDATA[If your orginization has users who is working outside office network and they normally access email ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If your orginization has users who is working outside office network and they normally access email through pop3 then chances that they do not have any notification on password change. This script helps to intimate the give list of users to change the password.</p>
<p>Please find the copy of the script in the below link</p>
<p><a href="http://powershell.com/cs/members/smtpport25.wordpress/files/PasswordChangeNotification.txt.aspx">http://powershell.com/cs/members/smtpport25.wordpress/files/PasswordChangeNotification.txt.aspx</a></p>
<p>&#160;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Writing custom scripts with MDT 2010]]></title>
<link>http://deployment.xtremeconsulting.com/2009/11/03/writing-custom-scripts-with-mdt-2010/</link>
<pubDate>Wed, 04 Nov 2009 05:26:15 +0000</pubDate>
<dc:creator>tmintner</dc:creator>
<guid>http://deployment.xtremeconsulting.com/2009/11/03/writing-custom-scripts-with-mdt-2010/</guid>
<description><![CDATA[Ben Hunter wrote a great blog post a few years ago on how to create a custom VBscript to use with BD]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Ben Hunter wrote a great blog post a few years ago on how to create a custom VBscript to use with BDD 2007 (<a title="http://blogs.technet.com/benhunter/archive/2007/04/15/bdd-2007-ndash-tips-and-tricks-ndash-how-to-write-a-custom-script.aspx" href="http://blogs.technet.com/benhunter/archive/2007/04/15/bdd-2007-ndash-tips-and-tricks-ndash-how-to-write-a-custom-script.aspx">http://blogs.technet.com/benhunter/archive/2007/04/15/bdd-2007-ndash-tips-and-tricks-ndash-how-to-write-a-custom-script.aspx</a>).  Ben’s script template will still work with MDT 2010 however If you have spent any time looking at the scripts in MDT 2010 you will notice that the format of the built in scripts have changed.  So you might be wondering how to create a custom script with MDT 2010.  MDT 2010 introduced some script structure changes to better handle error reporting and to make the scripts a bit easier to read and test.  The new template is listed below.  So how do you use the template?  Start by pasting the following code into a script file with a WSF extension (somefile.wsf).  After creating the file edit the Class <strong>ScriptName</strong>  with the name of your script.  As an example if you named your custom script somescript.wsf then the Class would be Class SomeScript.</p>
<p>Now that you have your script and your class named correctly you can add your code under the Function Main.  Once you are finished you just need to save the file and put it into the scripts folder in your deployment share. </p>
<p>So what does the new structure give you beyond what Ben’s post originally pointed out?  First it gives you some nice debugging capabilities.  Normally you would run your script by calling cscript.exe “%scriptroot%\somescript.wsf” in the task sequence.  If you want to use the advanced debugging you can add /debugcapture.  Adding the /debugcapture will turn on advanced debugging features by disabling the standard On Error Resume Next in the scripts and capturing any errors in the script that might occur and displaying them to the screen.  For example if you forgot to declare a variable the /debugcapture will display the variable that could not be found and the line number that the error occurred on.  You can also use your own test hook scripts to unit test the different functions in the script (more on that later).  For right now, enjoy the template and we will definitely be posting more custom script samples over the next few months!</p>
<p>&#60;job id=&#8221;ZTIConnect&#8221;&#62;<br />
   &#60;script language=&#8221;VBScript&#8221; src=&#8221;ZTIUtility.vbs&#8221;/&#62;<br />
   &#60;script language=&#8221;VBScript&#8221;&#62;</p>
<p>Option Explicit<br />
RunNewInstance</p>
<p>&#8216;//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8216;//  Global Constants<br />
&#8216;//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Const ANSWER_TO_LIFE_THE_UNIVERSE_AND_EVERYTHING = 42</p>
<p>&#8216;//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8216;//  Main Class<br />
&#8216;//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Class <em>ScriptName</em></p>
<p>    &#8216;//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
    &#8216;//  Global constant and variable declarations<br />
    &#8216;//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>    Dim iRetVal</p>
<p>    &#8216;//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
    &#8216;//  Constructor to initialize needed global objects<br />
    &#8216;//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>    Private Sub Class_Initialize</p>
<p>    End Sub<br />
    &#8216;//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
    &#8216;//  Main routine<br />
    &#8216;//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>    Function Main</p>
<blockquote><p>‘Insert your code here</p></blockquote>
<p>    End Function</p>
<p>End Class</p>
<p>   &#60;/script&#62;<br />
&#60;/job&#62;</p>
<p>&#160;</p>
<p>Tim Mintner is a Principal Consultant with Xtreme Consulting Group</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Script to Check Adobe Version and update if needed]]></title>
<link>http://transmitterdown.wordpress.com/2009/11/03/script-to-check-adobe-version-and-update-if-needed/</link>
<pubDate>Tue, 03 Nov 2009 15:05:52 +0000</pubDate>
<dc:creator>Dave</dc:creator>
<guid>http://transmitterdown.wordpress.com/2009/11/03/script-to-check-adobe-version-and-update-if-needed/</guid>
<description><![CDATA[Here you are Mike, I&#8217;ve played with a few scripts and had great results&#8230; but this one ha]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Here you are Mike, I&#8217;ve played with a few scripts and had great results&#8230; but this one has to be my crowning achievement at this point.</p>
<p>Some background info first: We needed most of our PCs to have Adobe Reader version 8.1.4   installed. We have automatic updates for adobe blocked on the firewall, and we also couldn&#8217;t install 9.0 because it would not be supported by another piece of software. Some of the PCs still had adobe reader 7.0, most had 8.0 or 8.1. I wanted a script that got called in a login script and checked what version they had and ran a silent install of adobe 8.1.4 if needed.</p>
<p>First, I got myself a full exe of Adobe 8.1.3 (for some annoying reason you can only patch to 8.1.4 from 8.1.3, and there is no full install of 8.1.4). I used resources that adobe themselves provide to make a custom msi package and also set it to include the separate 8.1.4 patch. This all gets dumped into a directory on a network share that all users have access to.</p>
<p>I then added this line to the users login scripts (batch files) to call the script:</p>
<blockquote><p>cscript &#8220;\\LocalServer\share\folder\adberdr81Silent\setup files\adobe814.vbs&#8221;  /quiet /passive</p></blockquote>
<p>This calls the script silently and does not ask the user if they want to run or whatever other BS safety messages Windows XP vomits at you normally when you run a file off the network.</p>
<p><strong>Now the VBscript (script in blue, my comments for this post in normal):</strong></p>
<blockquote><p><span style="color:#0000ff;">Dim FilePath<br />
Dim fso<br />
Dim version<br />
Dim WshShell</span></p>
<p><span style="color:#0000ff;">Set objFSO = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)</span></p>
<p><span style="color:#0000ff;">If objFSO.FileExists(&#8220;c:\program files\adobe\reader 8.0\reader\acrord32.exe&#8221;) Then<br />
Set objNet = WScript.CreateObject(&#8220;WScript.Network&#8221;)<br />
strCaption = &#8220;Adobe Reader&#8221;<br />
Set objWMI = GetObject(&#8220;winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2&#8243;)<br />
For Each objSoftware in objWMI.ExecQuery(&#8220;SELECT * FROM Win32_Product Where Caption Like &#8216;%&#8221; &#38; strCaption &#38; &#8220;%&#8217;&#8221;)<br />
version = objSoftware.Version<br />
Next</span></p>
<p>^ This says look to see if the folder for adobe 8.0 exists on the local C:, and if it does, it searches the registry for what exact version it is and stores it in the &#8220;version&#8221; variable. If the folder for 8.0 does not exist, the script can assume that either 7.0 is installed, or no version of adobe is installed and will run the setup in the &#8220;else&#8221; option below:</p>
<p><span style="color:#0000ff;">Else</span></p>
<p><span style="color:#0000ff;">set objWshShell= CreateObject(&#8220;Wscript.Shell&#8221;)<br />
set objEnviroment = objWshShell.Environment(&#8220;PROCESS&#8221;)<br />
objEnviroment (&#8220;SEE_MASK_NOZONECHECKS&#8221;) = 1</span></p>
<p>^ This changes the registry so that it will disable those annoying open file warnings during the script</p>
<p><span style="color:#0000ff;">Set WshShell = WScript.CreateObject(&#8220;WScript.Shell&#8221;)<br />
WScript.Echo WshShell.CurrentDirectory<br />
WshShell.CurrentDirectory = &#8220;Y:\folder\adberdr81Silent\Setup Files&#8221;</span></p>
<p>^ This changes the running directory (I had trouble with some stations thinking I was trying to run setup.exe out of the windows directory, this fixed that) Y: is mapped to the &#8220;share&#8221;  on the local server.</p>
<p><span style="color:#0000ff;">Set WshShell = WScript.CreateObject(&#8220;WScript.Shell&#8221;)<br />
WshShell.Run &#8220;setup.exe&#8221;</span></p>
<p><span style="color:#0000ff;">set objWshShell= CreateObject(&#8220;Wscript.Shell&#8221;)<br />
set objEnviroment = objWshShell.Environment(&#8220;PROCESS&#8221;)<br />
objEnviroment (&#8220;SEE_MASK_NOZONECHECKS&#8221;) = 0</span></p>
<p><span style="color:#0000ff;">WScript.quit</span></p>
<p>^ This calls the setup.exe located in that folder and the custom adobe msi I made to install completely silently (among other custom settings) takes it from here. Then the script undoes the change I made to disable the open file warnings and exits the script. Adobe 8.1.4 is now installed.</p>
<p><span style="color:#0000ff;">End If</span></p>
<p><span style="color:#0000ff;">If version = &#8220;8.1.4&#8243; Then</span></p>
<p><span style="color:#0000ff;">WScript.quit</span></p>
<p>^ Here we have the other option, the script finds the adobe 8.0 directory and is now going to check that version variable. For my purposes, checking if the version is 8.1.4 (highest version of reader 8 ) is what I needed. If that version is already installed the script quits and does nothing further.</p>
<p><span style="color:#0000ff;">Else</span></p>
<p><span style="color:#0000ff;">set objWshShell= CreateObject(&#8220;Wscript.Shell&#8221;)<br />
set objEnviroment = objWshShell.Environment(&#8220;PROCESS&#8221;)<br />
objEnviroment (&#8220;SEE_MASK_NOZONECHECKS&#8221;) = 1</span></p>
<p><span style="color:#0000ff;">Set WshShell = WScript.CreateObject(&#8220;WScript.Shell&#8221;)<br />
WScript.Echo WshShell.CurrentDirectory<br />
WshShell.CurrentDirectory = &#8220;Y:\folder\adberdr81Silent\Setup Files&#8221; </span></p>
<p><span style="color:#0000ff;">Set WshShell = WScript.CreateObject(&#8220;WScript.Shell&#8221;)<br />
WshShell.Run &#8220;setup.exe&#8221;</span></p>
<p><span style="color:#0000ff;">set objWshShell= CreateObject(&#8220;Wscript.Shell&#8221;)<br />
set objEnviroment = objWshShell.Environment(&#8220;PROCESS&#8221;)<br />
objEnviroment (&#8220;SEE_MASK_NOZONECHECKS&#8221;) = 0</span></p>
<p><span style="color:#0000ff;">WScript.quit</span></p>
<p><span style="color:#0000ff;">end if</span></p>
<p>^ Otherwise, if Adobe reader 8 is found, but does not equal version 8.1.4, then the script updates it to the version required by running the silent setup. From that point the setup.exe is smart enough to just install the patch(es) needed. Adobe made these easy to customize.</p></blockquote>
<p>So there you have it. This script was added to the login process and if the PC didn&#8217;t already have Adobe Reader 8.1.4, it would install it. Otherwise it would not do anything. Either way the end user had no idea it was happening. I&#8217;m sure this script is sloppy, but it did exactly what I needed it to do &#8211; and saved Celeste and I a shitload of tedious work &#8211; , so I was pleased.</p>
<p>-Dave out</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Learn VBScript]]></title>
<link>http://transmitterdown.wordpress.com/2009/11/03/learn-vbscript/</link>
<pubDate>Tue, 03 Nov 2009 12:34:33 +0000</pubDate>
<dc:creator>Michael</dc:creator>
<guid>http://transmitterdown.wordpress.com/2009/11/03/learn-vbscript/</guid>
<description><![CDATA[If you are interested in learning VBScript or Windows Script, it is very easy. It comes with Windows]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If you are interested in learning VBScript or Windows Script, it is very easy. It comes with Windows. And all the learning materials are free online. You can even find free scripts online.  If you don&#8217;t know what VBScript is and you work in IT then you are missing out. VBScript is a powerful scripting language that allows you to automate many boring tasks. You can use VBScripts at logon, in scheduled tasks, interactively, and manually. VBScripts can map drives, install printers, search for and copy files, perform Active Directory queries, access databases, automate Outlook, Excel, and Word, and much more. I&#8217;m sure Dave can fill in more examples.  So if you are interested and you have some free time then check out the links below.</p>
<h3>VBScript Resources</h3>
<ul>
<li><a href="http://technet.microsoft.com/en-us/scriptcenter/default.aspx" target="_blank">Script Center</a> &#8211; A good jumping off point. Be sure to bookmark this one because you will use it often!
<ul>
<li><a href="http://technet.microsoft.com/en-us/scriptcenter/dd940112.aspx" target="_blank">Introduction to Scripting</a></li>
<li><a href="http://technet.microsoft.com/en-us/scriptcenter/dd772284.aspx" target="_blank">Sesame Script</a> &#8211; An extended tutorial broken up into lessons.</li>
<li><a href="http://blogs.technet.com/heyscriptingguy/" target="_blank">Hey, Scripting Guy! Blog</a> &#8211; People send in their questions and the experts post their replies online.
<ul>
<li><a href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/all.mspx" target="_blank">Hey, Scripting Guy! Archive</a> &#8211; Archive from 2004 through July 2009. This is from before they had the blog. Many good examples.</li>
</ul>
</li>
<li><a href="http://gallery.technet.microsoft.com/ScriptCenter/en-us" target="_blank">Script Center Gallery</a> &#8211; Scripts from the experts and people in the community.
<ul>
<li><a href="http://gallery.technet.microsoft.com/ScriptCenter/en-us/site/search?f[0].Type=Affiliation&#38;f[0].Value=Official&#38;f[0].Text=Microsoft&#38;f[1].Type=ScriptLanguage&#38;f[1].Value=VBScript&#38;f[1].Text=VBScript&#38;f[2].Type=SupportedPlatform&#38;f[2].Value=Server2003&#38;f[2].Text=Windows%20Server%202003&#38;f[3].Type=RootCategory&#38;f[3].Value=activedirectory&#38;f[3].Text=Active%20Directory" target="_blank">Expert Scripts</a> &#8211; A search result with just VBScripts from the experts. Click on the links on the left side to browse to other categories with the same filter applied. The filter parameters are at the bottom.</li>
</ul>
</li>
<li><a href="http://social.technet.microsoft.com/Forums/en/ITCG/threads/" target="_blank">The Official Scripting Guys Forum!</a> &#8211; Ask questions and find answers.</li>
</ul>
<ul>
<li><a href="http://technet.microsoft.com/en-us/scriptcenter/dd901154.aspx" target="_blank">Webcasts</a> -  If reading is not your thing then try out these Webcasts from the Scripting Guys.</li>
<li><a href="http://technet.microsoft.com/en-us/scriptcenter/dd823314.aspx" target="_blank">Tools and Utilities</a> &#8211; Programs that help you make powerful scripts faster. Don&#8217;t overlook this! Be sure to check out Log Parser 2.2.</li>
<li><a href="http://technet.microsoft.com/en-us/scriptcenter/dd772285.aspx" target="_blank">Windows PowerShell Cmdlets</a> &#8211; Some information on a powerful successor to VBScript. Requires Windows XP SP2 or later.</li>
</ul>
</li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=75CCA21A-53B9-4949-9B62-A8FC7926E914&#38;displaylang=en" target="_blank">Script Center All-in-One (Downloadable Help File)</a> &#8211; This collection features all of the Tales From the Script, Office Space, and Scripting Clinics columns, plus much, much more. <a href="http://transmitterdown.wordpress.com/2009/11/01/hidden-vbscript-gem/" target="_self">I was recently saying how great Tales From the Script was</a>. Now you can have them all in one place on your desktop!</li>
<li><a href="http://www.microsoft.com/technet/scriptcenter/guide/default.mspx?mfr=true" target="_blank">Microsoft Windows 2000 Scripting Guide</a> &#8211; An extensive in-depth guide to scripting. Very relevant despite the date in the title. Gives many tips to successful scripting.
<ul>
<li><a href="http://www.microsoft.com/technet/scriptcenter/guide/sas_sbp_xmzd.mspx?mfr=true" target="_blank">Hungarian Notation</a> &#8211; A shortcut to the variable naming conventions for VBScript.</li>
<li><a href="http://www.microsoft.com/technet/scriptcenter/guide/sas_vbs_eves.mspx" target="_blank">Type Casting</a> &#8211; How to tell VBScript what data type you mean.</li>
</ul>
</li>
<li><a href="http://msdn.microsoft.com/en-us/library/bstcxhf7%28VS.85%29.aspx" target="_blank">Script Runtime Reference</a> &#8211; Professional documentation on the FileSystemObject and other advanced topics.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/t0aew7h6%28VS.85%29.aspx" target="_blank">VBScript Reference</a> &#8211; A detailed technical breakdown of the VBScript language.
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/3ca8tfek(VS.85).aspx" target="_blank">VBScript Functions</a> &#8211; All the functions built into VBScript such as abs() and len().</li>
<li><a href="http://msdn.microsoft.com/en-us/library/9e7a57cf(VS.85).aspx" target="_blank">VBScript Data Types</a> &#8211; Tells you things like the largest number the double subtype can hold.</li>
</ul>
</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ee725266.aspx" target="_blank">Scripting Clinic</a> &#8211; Random articles on scripting.
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/ms974570.aspx" target="_blank">Regular Expressions</a> &#8211; Regular expressions provide tools for developing complex pattern matching and textual search-and-replace algorithms. Ask any Perl, egrep, awk or sed developer, and they&#8217;ll tell you that regular expressions are one of the most powerful utilities available for manipulating text and data.</li>
</ul>
</li>
<li><a href="http://books.google.com/books?id=PTXhDvhhTVoC&#38;printsec=frontcover#v=onepage&#38;q=&#38;f=false" target="_blank">Learning VBScript</a> &#8211; Google Books</li>
<li><a href="http://groups.google.com/group/microsoft.public.scripting.vbscript/browse_thread/thread/67e46687ab0e4d26?pli=1" target="_blank">Pipe Lesson 1</a> &#8211; If you would like to use <a href="http://en.wikipedia.org/wiki/Pipeline_%28Unix%29" target="_blank">pipes</a> in VBScript, these are the two threads you need to read.
<ul>
<li><a href="http://windowsitpro.com/article/articleid/85855/jsi-tip-10482-how-can-i-pipe-or-redirect-the-output-of-an-executable-when-run-from-a-vbscript.html" target="_blank">Pipe Lesson 2</a></li>
</ul>
</li>
</ul>
<h3>Related Resources</h3>
<ul>
<li><a href="http://www.asciitable.com/" target="_blank">ASCII Table</a></li>
<li><a href="http://support.microsoft.com/kb/299648" target="_blank">Description of NTFS date and time stamps for files and folders</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/0h88fahh(VS.85).aspx" target="_blank">Locale IDs</a> &#8211; The table lists locale IDs Microsoft uses in their products.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx" target="_blank">Naming Files, Paths, and Namespaces</a> &#8211; If you need to know the rules of Microsoft file system namespaces, this is the place to be.</li>
<li><a href="http://unicode.org/charts/" target="_blank">Unicode Charts</a></li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Detecting which .Net Framework Versions are Installed]]></title>
<link>http://networknerd.wordpress.com/2009/11/03/detecting-which-net-framework-versions-are-installed/</link>
<pubDate>Tue, 03 Nov 2009 06:30:44 +0000</pubDate>
<dc:creator>networknerd</dc:creator>
<guid>http://networknerd.wordpress.com/2009/11/03/detecting-which-net-framework-versions-are-installed/</guid>
<description><![CDATA[In the previous post I used some C# code to detect if bootworks was installed prior to installing fu]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>In the previous post I used some C# code to detect if bootworks was installed prior to installing full disk encryption.  That all works well provided the appropriate .Net framework is installed. Unfortunately with a freshly re-imaged computer there is no .Net framework in the base image causing the bootworks detection to bomb out.</p>
<p>After a bit of googling I came up with this small script to gather all the installed .Net versions and a support function to test for a particular release version.  The same thing could be accomplished using a registry key as described by <a id="ctl00___ctl00___bth___BlogTitle" href="http://blogs.msdn.com/astebner/default.aspx">Aaron Stebner&#8217;s </a>blog post. </p>
<p><code></p>
<pre>option explicit
'Detect which versions of DotNet Framework are installed.
'From Microsoft KB Article http://support.microsoft.com/kb/318785/
'By NetworkNerd 3/11/2009

Const WindowsFolder = 0
Const SystemFolder = 1
Const TemporaryFolder = 2
const DOTNET_10 = "v1.0.3705"
const DOTNET_11 = "v1.1.4322"
const DOTNET_20 = "v2.0.50727"
const DOTNET_30 = "v3.0"
const DOTNET_35 = "v3.5"

dim objFrameworkVers

set objFrameworkVers = CreateObject("Scripting.Dictionary")
wscript.echo "Found " &#38; getFrameWorkVersions(objFrameworkVers) &#38; " .NET Frameworks installed."
if HasDotNet(DOTNET_20) then
  wscript.echo "Has .Net Framework 2.0 installed"
end if

function HasDotNet(ver)
  if objFrameworkVers.exists(ver) then
    HasDotNet = True
  else
    HasDotNet = False
  end if
end function

function getFrameWorkVersions(byref objDict)
  dim fso, winfolder, strPath, basefolder, f
  Set fso = CreateObject("Scripting.FileSystemObject")
  set winfolder = fso.GetSpecialFolder(WindowsFolder)
  strPath = winfolder.path &#38; "\Microsoft.NET\Framework"
  set basefolder = fso.getfolder(strPath)
  objDict.removeAll
  for each f in basefolder.subfolders
	objDict.add f.name, f.name
  next
  getFrameWorkVersions = objDict.count
end function</pre>
<p>&#160;</p>
<p></code></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[ArcGIS Jungle of Programming Languages]]></title>
<link>http://mygisblog.wordpress.com/2009/11/02/arcgis-jungle-of-programming-languages/</link>
<pubDate>Mon, 02 Nov 2009 22:29:26 +0000</pubDate>
<dc:creator>Me</dc:creator>
<guid>http://mygisblog.wordpress.com/2009/11/02/arcgis-jungle-of-programming-languages/</guid>
<description><![CDATA[It occurred to me (stroke of genius!) while fiddling with some VB Script code for labeling expressio]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>It occurred to me (stroke of genius!) while fiddling with some VB Script code for labeling expressions in ArcMap last week that ArcGIS asks a lot of you in terms of programming languages. Visual Basic for customizing the software, Python for geoprocessing, VBScript or JavaScript for tweaking like labeling&#8230; wouldn&#8217;t it be nice if you only needed one language ?! I haven&#8217;t spent any time reviewing what&#8217;s <a href="http://www.esri.com/software/arcgis/whats-new/whats-coming.html">under the hood of ArcGIS 9.4</a>. Maybe more potential for Python? I think there was some talk of more functionality working in Python with layers. We&#8217;ll see.</p>
<p>On a related matter, I am faced with the same confusion when it comes to Web GIS. Which platform for web development is the one I should choose? So I enjoyed today&#8217;s email from <a href="http://geochalkboard.wordpress.com/2009/10/29/poll-gis-web-development-platform/">geospatialtraining.com</a> that asked readers to participate in a survey on this matter. Looking at survey results, the three front runners are Google Open Layers, Maps API, and Mapserver. So my recent efforts with Mapserver may not have been in vain. Amazingly, Geodjango garnered an astonishing 5% !</p>
<p>Over all, I want to stick with Python and hope that eventually it will become the tool to do it all. I ordered a book on Iron Python the other day and then actually saw post on <a href="http://www.spatiallyadjusted.com/2009/06/17/ironpython-and-esri-arcgis/">James Fee&#8217;s blog about Iron Python &#38; ArcGIS</a>. I would love to see Python turn into the ultimate super-glue language that connects ArcGIS with the Open Source realm.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Install Driver EXE Package (New Tool)]]></title>
<link>http://deployment.xtremeconsulting.com/2009/11/02/install-driver-exe-package-new-tool/</link>
<pubDate>Mon, 02 Nov 2009 19:30:23 +0000</pubDate>
<dc:creator>keithga</dc:creator>
<guid>http://deployment.xtremeconsulting.com/2009/11/02/install-driver-exe-package-new-tool/</guid>
<description><![CDATA[New Tool! ZTIInstallDriverExePackage.wsf As I described in my earlier post. MDT has a great system f]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>New Tool! ZTIInstallDriverExePackage.wsf</p>
<p>As I described in my earlier post. MDT has a great system for Driver Management. You import a driver via it’s *.INF file, and that driver will be installed on every machine where that PnP ID is found. No need to associate a driver via a Make/Model.</p>
<p>However, there are some cases (very rare), when a driver package can’t be installed by *.inf file alone, or a *.exe installation package may need to be installed along side a specific piece of hardware.</p>
<p>The ZTIInstallDriverExePackage.wsf tool was designed to allow an Driver *.exe installation package to associate with a set of PnPID’s defined in the Workbench.</p>
<h4><strong>Steps</strong></h4>
<ul>
<li>Download the Driver Installation *.exe Package to your MDT Workbench machine. Ensure that you copy the package to its own directory.</li>
<li>Add the Application to the MDT workbench as you would any other Application Installation Package.</li>
<li>You will need to extract out the GUID for the Application added. It may be in the depoyment share under \Control\applications.xml</li>
<li>Extract out as much of the driver *.inf component as you can to a separate directory (not a sub-directory). There are several tools available on the internet for extracting out compressed files from Self extracting Executables. My personal favorite is 7-Zip (see 7-zip.org)</li>
<li>Add the Driver Package to the MDT workbench as you would any other Driver Package.<br />
It is not necessary that it be fully functional. However the PnPID’s should be properly added.</li>
<li>Once the driver has been imported successfully. Open the Properties for the new device
<ul>
<li>You may disable the driver. Uncheck “Enabled”. Disable only if you want the Exe Package to be the only way for the driver to be installed.</li>
<li>Add the following string to the comments section:<br />
“DriverExePackage {GUID}”<br />
Where {GUID} is the Application GUID extracted from the 3<sup>rd</sup> step above.</li>
</ul>
</li>
<li>Copy the ZTIInstallDriverExePackage.wsf file to the Deployment Share under &#8230;\Scripts\</li>
<li>Add a new Step in your Task Sequence calling ZTIInstallDriverExePackage.wsf<br />
cscript.exe “%ScriptRoot%\ZTIInstallDriverExePackage.wsf”</li>
</ul>
<h4><strong>Script Flow</strong></h4>
<p>ZTIInstallDriverExePackage.wsf will operate in a manner similar to ZTIDrivers.wsf.</p>
<ul>
<li>It will enumerate though all hardware devices on the machine, and extract out their PnPID’s. </li>
<li>For each Hardware PnPID found, it will try to match that ID with any driver found in the Deployment Share.</li>
<li>For each Driver package found it will search the comments field, searching for the “DriverExePackage” string followed by the Application GUID.</li>
<li>The script will then call ZTIApplications.wsf with the GUID from the Comments section.</li>
</ul>
<p>ZTIApplications.wsf will do a good job of ensuring that the corresponding application is installed only once.</p>
<h4><strong>Assumptions</strong></h4>
<ul>
<li>In most cases, I personally recommend sticking with the *.inf only method of driver installation. The Exe only method should only be used in rare cases.</li>
<li>This script uses the drivers.xml file from the distribution share to associate the PnPID’s with the Application GUID. It is important that the MDT Workbench Add the driver package to the system. IT is not necessary for the driver package to actually work. The Driver Package can be disabled if it is failing to work, it should not be removed.</li>
<li>To associate a Device with an Application Item, you also need to add the Application GUID of the device prefixed with the string “DriverExePackage” into the comments of the driver in the MDT Workbench.</li>
</ul>
<h4><strong>Links</strong></h4>
<p><a href="http://deploymentlive.com/blog/ZTIInstallDriverExePackage.zip">ZTIInstallDriverExePackage.wsf</a></p>
<p>Keith</p>
<address><a href="http://keithga.com"><span style="color:#993300;">Keith Garner</span></a><span style="color:#993300;"> is a Deployment Specialist with </span><a href="http://deployment.xtremeconsulting.com/"><span style="color:#993300;">Xtreme Consulting Group</span></a></address>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Hidden VBScript Gem]]></title>
<link>http://transmitterdown.wordpress.com/2009/11/01/hidden-vbscript-gem/</link>
<pubDate>Sun, 01 Nov 2009 12:23:36 +0000</pubDate>
<dc:creator>Michael</dc:creator>
<guid>http://transmitterdown.wordpress.com/2009/11/01/hidden-vbscript-gem/</guid>
<description><![CDATA[Hi, I am getting into VBScript more and more. And it always helps to read more about a given subject]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hi,</p>
<p>I am getting into VBScript more and more. And it always helps to read more about a given subject. And that is why I am a little dumbfounded when I think about how <span style="text-decoration:underline;">Tales From The Script</span> is being treated. It seems to be a great resource from the handful of articles I have read. (<a href="http://www.microsoft.com/technet/scriptcenter/resources/tales/sg0105.mspx" target="_blank">Here is one example</a>.) But I can&#8217;t find a list of all the articles anywhere. So below is a Google search that will at least give you access to some of them. Enjoy!</p>
<p><a href="http://www.google.com/search?q=%22Tales+from+the+Script%22+site%3Amicrosoft.com" target="_blank">http://www.google.com/search?q=%22Tales+from+the+Script%22+site%3Amicrosoft.com</a></p>
<p>Mike</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Uninstaller Scripts!]]></title>
<link>http://dadofaayan.wordpress.com/2009/10/29/uninstaller-scripts/</link>
<pubDate>Thu, 29 Oct 2009 14:10:48 +0000</pubDate>
<dc:creator>dadofaayan</dc:creator>
<guid>http://dadofaayan.wordpress.com/2009/10/29/uninstaller-scripts/</guid>
<description><![CDATA[So&#8230; everyone has been there&#8230; There&#8217;s a new version of something out, and your ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>So&#8230; everyone has been there&#8230;</p>
<p>There&#8217;s a new version of something out, and your &#8220;compliance&#8221; folks who always bitch about security and vulnerabilities are screaming at you about the usual problem &#8211; You install a newer version of something, but the old ones remain!  How do you CLEANLY uninstall stuff?  Well&#8230; I have two great scripts for this.  One uses the classic VBScript, great for MS boxes, and the other uses an oldy-but-goody&#8230; KIXtart (KIX32.exe).  Lets&#8217;s see what we&#8217;ve got&#8230;<!--more--></p>
<p>First, let&#8217;s do the VBScript code.</p>
<p>Set WShl = Wscript.CreateObject(&#8220;WScript.Shell&#8221;)</p>
<p>Wshl.Run &#8220;msiexec.exe /qn /x {AC76BA86-7AD7-1033-7B44-A92000000001}&#8221;, 0, True</p>
<p>Notice the part with the product code.  You can use some great tools out there like msiinv.exe, or Resource Explorer through SMS or SCCM to get these codes.  the &#8220;0&#8243; tells it to run this process in a hidden window, and &#8220;true&#8221; makes this almost like a child process, so this line of code doesn&#8217;t technically exit until the command is done.  The great thing about this single line, is if you have MANY older versions existing on your network, you can apply as many of these lines, and they will run back-to-back, untill they&#8217;ve all exited completely!</p>
<p>Now&#8230; for KIX&#8230;</p>
<p>shell &#8220;%comspec% /e:1024 /c&#8221; + &#8220;msiexec.exe /qn /x {F07B861C-72B9-40A4-8B1A-AAED4C06A7E8}&#8221;</p>
<p>Same thing.  Add as many lines of this you need, for each product/product code&#8230; and you&#8217;re cooking with grease!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Falling asleep on the job (task)]]></title>
<link>http://deployment.xtremeconsulting.com/2009/10/26/falling-asleep-on-the-job-task/</link>
<pubDate>Mon, 26 Oct 2009 21:55:55 +0000</pubDate>
<dc:creator>keithga</dc:creator>
<guid>http://deployment.xtremeconsulting.com/2009/10/26/falling-asleep-on-the-job-task/</guid>
<description><![CDATA[ZZzzzzzz&#8230;&#8230; (New for MDT 2010) One of the new features of Windows 7 is a new aggressive p]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>ZZzzzzzz&#8230;&#8230; <em>(New for MDT 2010)</em></p>
<p>One of the new features of Windows 7 is a new aggressive power management policy. For machines that are plugged in, the new “Balanced” default policy will put a machine to sleep in 30 minutes. For Windows Vista, the default was 60 minutes.</p>
<p>For Deployments, that’s a problem if you have application installs that take longer than 30 minutes, like Microsoft Office 2007, with all the service packs. Half way through the deployment, the install pauses because the machine went to sleep.</p>
<p>I first noticed this in early tests of the Microsoft Deployment Toolkit 2010. I had written a utility for a similar problem back when I worked for Microsoft IT. It uses a Win32 API call:  <a href="http://msdn.microsoft.com/en-us/library/aa373233(VS.85).aspx">Win32 SetThreadExecutionState</a>()</p>
<p>It’s a simple C/C++ call:</p>
<pre>SetThreadExecutionState( ES_CONTINUOUS &#124; ES_SYSTEM_REQUIRED );</pre>
<p>This command resets the idle timer of the OS, and forces the machine to stay in a state while the Litetouch Task Sequence is running.</p>
<p><strong>Updated (11/3/09):</strong></p>
<p>KeepAlive was added to MDT 2010 in the Microsoft.BDD.Utility.dll file, you can see it being called in the litetouch.wsf script:</p>
<pre>' Ensure that this machine does *not* go to sleep while running the task sequence steps.
On error resume next
<strong>oUtility.BDDUtility.KeepAlive</strong>
On error goto 0</pre>
<p>Keith</p>
<address><a href="http://keithga.com"><span style="color:#993300;">Keith Garner</span></a><span style="color:#993300;"> is a Deployment Specialist with </span><a href="http://deployment.xtremeconsulting.com/"><span style="color:#993300;">Xtreme Consulting Group</span></a></address>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[GP/QTP Automation: Highlight controls in Dexterity Window]]></title>
<link>http://automationbeyond.wordpress.com/2009/10/26/gp-automation-highlight-controls/</link>
<pubDate>Mon, 26 Oct 2009 13:10:44 +0000</pubDate>
<dc:creator>Albert Gareev</dc:creator>
<guid>http://automationbeyond.wordpress.com/2009/10/26/gp-automation-highlight-controls/</guid>
<description><![CDATA[SanScript, Visual Basic, and VBScript functions implementing the &#8220;Highlight in Application]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>SanScript, Visual Basic, and VBScript functions implementing the &#8220;Highlight in Application&#8221; feature as in QTP Object Repository Manager.</p>
<p>All related posts: <a title="Permanent Link to Reference Page – GP/QTP Automation" rel="bookmark" href="http://automationbeyond.wordpress.com/2009/10/03/reference-page-gp-qtp-automation/">Reference Page – GP/QTP Automation</a> </p>
<p><strong>VBA/SanScript function &#8211; put in your <a href="http://automationbeyond.wordpress.com/2009/09/23/gp-automation-vbscript-limitation/" target="_blank">Excel VBA macro file</a></strong></p>
<p>Note. Ignores sanScript errors</p>
<blockquote><p>Public Function HighlightControl()<br />
    Dim intRC As Integer<br />
    Dim intCount, Iter As Integer<br />
    Dim sCode, sErrMsg As String<br />
    Dim sControlName As String</p>
<p>    sControlName = Workbooks.Item(1).Sheets.Item(1).Cells(2, 1)<br />
   <br />
    Call GPApp.Activate<br />
   <br />
    &#8216;Show/Hide<br />
    intCount = 3<br />
    For Iter = 1 To intCount<br />
        sCode = &#8220;hide field &#8221; &#38; sControlName &#38; &#8220;;&#8221;<br />
        intRC = GPApp.ExecuteSanScript(sCode, sErrMsg)<br />
        Sleep 300<br />
        sCode = &#8220;show field &#8221; &#38; sControlName &#38; &#8220;;&#8221;<br />
        intRC = GPApp.ExecuteSanScript(sCode, sErrMsg)<br />
        Sleep 300<br />
    Next   </p>
<p>End Function</p></blockquote>
<p><strong>VBScript function &#8211; put as</strong><strong> <a href="http://automationbeyond.wordpress.com/2009/09/25/gp-automation-interface-class/" target="_blank">Dexterity Interface Class</a> method</strong></p>
<p>Note. If use as embedded function don&#8217;t forget to call COM initialization procedures first.</p>
<blockquote><p> Public Function HighlightControl(ByVal sName)<br />
  Dim boolRC, intRC<br />
  Dim objUsedRange&#8217;<br />
     Set objUsedRange = XLBook.Worksheets(1).UsedRange()<br />
        objUsedRange.Cells(2,1) = &#8221; &#8221; &#38; sName &#8217;space char is apostrophe workaround</p>
<p>  XLHandle.Run(&#8220;HighlightControl&#8221;)</p>
<p> End Function</p></blockquote>
<p><strong>A function to highlight all window controls one by one</strong></p>
<p>Note.</p>
<p>Uses XML structure created by <a href="http://automationbeyond.wordpress.com/2009/10/12/gp-automation-gui-capture-script/" target="_blank">GUI Capture script</a></p>
<p>Uses <a title="Permanent Link to Service Functions – XML (QTP, VBScript)" rel="bookmark" href="http://automationbeyond.wordpress.com/2009/10/02/service-functions-xml/" target="_blank">Service Functions – XML (QTP, VBScript)</a></p>
<blockquote><p>Public Function GP_HighlightContext(ByRef objXMLContext)<br />
   Dim objColl, objColl2, objControl, objXMLDesc<br />
   Dim objProperty, sName, sDexParent, sDexName, sFullName<br />
   Dim Iter, Jter</p>
<p>   If (objXMLContext is Nothing) Then Exit Function End If</p>
<p>   sDexParent = ChildAttributeValueByName(objXMLContext, &#8220;dexhost&#8221;)<br />
   Set objColl = objXMLContext.ChildElementsByPath(&#8220;./Object&#8221;)</p>
<p>   For Iter = 1 To objColl.Count<br />
    Set objControl = objColl.Item(Iter)</p>
<p>       Set objXMLDesc = ChildElementByName(objControl, &#8220;desc&#8221;)<br />
    Set objColl2 = objXMLDesc.ChildElementsByPath(&#8220;./property&#8221;)<br />
    For Jter = 1 To objColl2.Count<br />
     Set objProperty = objColl2.Item(Jter)<br />
     sName = ChildAttributeValueByName(objProperty, &#8220;name&#8221;)<br />
     If LCase(sName) = &#8220;dexname&#8221; Then<br />
      sDexName = ChildAttributeValueByName(objProperty, &#8220;value&#8221;)<br />
      sFullName = &#8220;&#8216;&#8221; &#38; sDexName &#38; &#8220;&#8216; of &#8220;  &#38; sDexParent<br />
      GPHandle.HighlightControl(sFullName)<br />
      Exit For<br />
     End If<br />
    Next</p>
<p>   Next</p>
<p>End Function</p></blockquote>
</div>]]></content:encoded>
</item>

</channel>
</rss>
