<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Confessions of a Microsoft Consultant : Scripting</title><link>http://blogs.technet.com/doxley/archive/tags/Scripting/default.aspx</link><description>Tags: Scripting</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>PowerShell Script ExecutionPolicy</title><link>http://blogs.technet.com/doxley/archive/2009/08/05/powershell-script-executionpolicy.aspx</link><pubDate>Wed, 05 Aug 2009 09:59:34 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3270752</guid><dc:creator>Daniel Oxley</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/doxley/comments/3270752.aspx</comments><wfw:commentRss>http://blogs.technet.com/doxley/commentrss.aspx?PostID=3270752</wfw:commentRss><description>&lt;p&gt;Seeing as PowerShell is included by default in Windows 7, and also because you get the PowerShell icon on your quick launch bar by default, I try to use that over the de rigueur &lt;strong&gt;cmd.exe&lt;/strong&gt; command interpreter that we have all had since the dawn of time.&amp;#160; Although, without thinking, I still often run cmd.exe just through habit :-S.&amp;#160; I am only just starting out with PowerShell and I doubt I will ever achieve any success with the scripting, but you have to try!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/powershell_1125A/PS_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="PS" border="0" alt="PS" src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/powershell_1125A/PS_thumb.jpg" width="460" height="44" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;h5 align="center"&gt;The PowerShell icon on the quick launch bar&lt;/h5&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Right from the start, I had problems running a script I had written.&amp;#160; Upon launching it I would get the below error returned:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="System"&gt;&lt;font face="Simplified Arabic Fixed"&gt;File C:\Users\daniel\Desktop\copy.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see &amp;quot;get-help about_signing&amp;quot; for more details.         &lt;br /&gt;At line:1 char:19          &lt;br /&gt;+ C:\Users\daniel\Desktop\copy.ps1 &amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/font&gt;        &lt;br /&gt;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;No matter what I tried, I just could not override the security settings that PowerShell had by default.&amp;#160; Frustration prevailed with me cursing the point of making a scripting environment and the blocking the execution of scripts for security reasons.&amp;#160; After hunting around, it turns out that this is simply a configurable option, and the default setting out of the box is the most secure one (as it should be).&amp;#160; Simply running the following commands will change the setting and thus allow you to execute your scripts.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To view your existing setting, run the command: &lt;em&gt;&lt;strong&gt;Get-ExecutionPolicy&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;To allow the execution of your scripts, run the command: &lt;em&gt;&lt;strong&gt;Set-ExecutionPolicy RemoteSigned&lt;/strong&gt;&lt;/em&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Setting it to &lt;em&gt;RemoteSigned &lt;/em&gt;means that you can run all of the scripts you write yourself, but not those downloaded from the Internet.&amp;#160; Alternatively, if you set the execution policy to &lt;em&gt;AllSigned&lt;/em&gt; then all scripts, including those you write yourself, have to be signed by a trusted publisher if you want to execute them.&amp;#160; Otherwise, you can set it to &lt;em&gt;Unrestricted&lt;/em&gt; and then all scripts will run, regardless of where they come from and whether or not they’ve been signed.&amp;#160; This last setting is not the recommended one as you can open yourself up to “a world of pain” (a great film).&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And if you need help understanding the script signing, you can run the command: &lt;em&gt;&lt;strong&gt;Get-Help About_Signing&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3270752" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/doxley/archive/tags/Scripting/default.aspx">Scripting</category><category domain="http://blogs.technet.com/doxley/archive/tags/Tips/default.aspx">Tips</category><category domain="http://blogs.technet.com/doxley/archive/tags/PowerShell/default.aspx">PowerShell</category></item><item><title>VBS Functions</title><link>http://blogs.technet.com/doxley/archive/2009/04/13/vbs-functions.aspx</link><pubDate>Mon, 13 Apr 2009 13:45:29 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3225728</guid><dc:creator>Daniel Oxley</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.technet.com/doxley/comments/3225728.aspx</comments><wfw:commentRss>http://blogs.technet.com/doxley/commentrss.aspx?PostID=3225728</wfw:commentRss><description>&lt;p&gt;The lack of a decent GUI for VBS development has always been a problem for most people.&amp;#160; The advantages of using VBS are great, but writing the scripts can be labourious, especially if you don’t have a lot of experience and know all the commands/functions etc.&amp;#160; Nowadays, there are plenty of 3rd-party development environments available now, in fact, I use the excellent &lt;a href="http://www.vbsedit.com"&gt;VBSEdit&lt;/a&gt; as it has code completion and comes with a whole load of code snippets covering all sorts of areas.&amp;#160; The code completion feature is super helpful, especially when trying to remember the syntax of a particular function.&lt;/p&gt;  &lt;p&gt;For reference purposes, I have included below a list of all the VBS functions as I am always looking up this information, so I thought I’d post it here so that it is more accessible to everyone (including me).&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Abs&lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the absolute value of a number.            &lt;br /&gt;Wscript.Echo(Abs(-5)). returns: 5&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Asc&lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the ASCII character code for the first character of a string.            &lt;br /&gt;Wscript.Echo(ASC (&amp;quot;ABC&amp;quot;)). returns: 65&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Chr &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the corresponding character of passed ASCII code number.            &lt;br /&gt;Wscript.Echo(Chr(65)). returns: A&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Cos &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns cosine value of a number.            &lt;br /&gt;Wscript.Echo(Cos(1)). returns: 0.54030230586814&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Date &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the current system date in month, day, year format.            &lt;br /&gt;Wscript.Echo(date()). returns: 8/2/02 -&amp;gt;with current date&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;DateAdd &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Adds the specified date or time value to specified date.            &lt;br /&gt;Wscript.Echo(DateAdd(&amp;quot;d&amp;quot;,&amp;quot;10&amp;quot;,&amp;quot;6-7-02&amp;quot;)). returns: 6/17/02 -&amp;gt; Adds 10 days to specified date. d=day, m=month, y=year, h=hour, n=minute&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Day &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the day of the month.            &lt;br /&gt;Wscript.Echo(Day(date)). returns: 9 -&amp;gt;with current day number.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Fix &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the integer part of a number.            &lt;br /&gt;Wscript.Echo(fix(5.567)). returns: 5&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;FormatCurrency &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns an expression formatted as a currency value.            &lt;br /&gt;Wscript.Echo(FormatCurrency(10.888)). returns: $10.89&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;FormatDateTime &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns a formatted date or time.            &lt;br /&gt;Wscript.Echo(FormatDateTime(date)). returns: 8/2/02-&amp;gt; with current date.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;FormatNumber &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns an expression formatted as a number value.            &lt;br /&gt;Wscript.Echo(FormatNumber(1000.1111,2)). returns: 1,000.11 &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;FormatPercent &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns an expression formatted as a percent            &lt;br /&gt;Wscript.Echo(FormatPercent(.22)). returns: 22.00%&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Hex &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the hexadecimal value of a number.            &lt;br /&gt;Wscript.Echo(Hex(10)). returns: A &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Hour, Minute, Second&lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the number representing hour, minute, second of the day, hour, or minute.            &lt;br /&gt;Wscript.Echo(Hour()). returns: 11 -&amp;gt; Assuming it's the hour is 11.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Int &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the integer part of a number.            &lt;br /&gt;Wscript.Echo(Int(5.567)). returns: 5&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;IsNumeric &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns Boolean value [true or false] indicates whether is number or not.            &lt;br /&gt;Wscript.Echo(IsNumeric(10.888)). returns: True &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;LCase &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Converts all the characters to lowercase.            &lt;br /&gt;Wscript.Echo(LCase(&amp;quot;CASE&amp;quot;)). returns: case&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Left &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns specified number of characters starting from left.            &lt;br /&gt;Wscript.Echo(left(&amp;quot;language&amp;quot;,3)). returns: lan&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;LTrim &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Removes all the leading spaces from the string.            &lt;br /&gt;Wscript.Echo(LTrim(&amp;quot;far &amp;quot;)). returns: far, with no spaces&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Month &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the month of the year.            &lt;br /&gt;Wscript.Echo(Month(date)). returns: 9 -&amp;gt;with current month number.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;MonthName &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the name of the specified month.            &lt;br /&gt;Wscript.Echo(MonthName(9)). returns: September&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;MsgBox&lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns dialog box with specified expression or arguments.            &lt;br /&gt;msgbox&amp;quot;Hello World&amp;quot; returns: Hello World -&amp;gt; On dialog box.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Now()&lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns current system date and time.            &lt;br /&gt;Wscript.Echo(now()). returns: 8/2/02 10:46:33 AM -&amp;gt;with current date &amp;amp; time&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Right &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns specified number of characters staring from right.            &lt;br /&gt;Wscript.Echo(Right(&amp;quot;language&amp;quot;)). returns: age&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Rnd &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns random number.            &lt;br /&gt;Wscript.Echo(Rnd). returns: 0.7055475 -&amp;gt;Needs some code to randomize.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Round &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns rounded number.            &lt;br /&gt;Wscript.Echo(Round(10.888)). returns: 11 &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;RTrim &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Removes all the trailing spaces from the string.            &lt;br /&gt;Wscript.Echo(RTrim(&amp;quot; far&amp;quot;)). returns: far, with no spaces&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Sgn &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns 1, 0, or -1 for positive, zero or negative number            &lt;br /&gt;Wscript.Echo(Sgn(-22)). returns: -1&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Sin &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns sine value of a number.            &lt;br /&gt;Wscript.Echo(sin(1)). returns: 0.841470984807897 &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Sqr &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns square root of a number.            &lt;br /&gt;Wscript.Echo(sqr(25)). returns: 5&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;String &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Takes a number and character code argument and returns the character, repeated a number of times:            &lt;br /&gt;Wscript.Echo(String(3,80)). returns: BBB&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Tan &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns tangent value of a number.            &lt;br /&gt;Wscript.Echo(tan(1)). returns: 1.5574077246549 &lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Time &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the current system time.            &lt;br /&gt;Wscript.Echo(Time()). returns: 10:11:36 AM -&amp;gt;with current time.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Timer &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the number of seconds since 12:00 AM.            &lt;br /&gt;Wscript.Echo(Timer). returns: 40055.84 -&amp;gt; at 11:07 AM&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;TimeSerial &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the time for a specific hour, minute, and second converted from military clock.            &lt;br /&gt;Wscript.Echo(TimeSerial(17,30,05)). returns: 5:30:05 PM.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;TimeValue(time)&lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the current system time.            &lt;br /&gt;Wscript.Echo(Time(time))returns: 11:18:00 AM -&amp;gt; with current time.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Trim &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the string argument, with leading and trailing spaced removed.            &lt;br /&gt;Wscript.Echo(Trim(&amp;quot; mid &amp;quot;)). returns: mid, with no spaces.&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;UCase &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Converts all the characters to upper case.            &lt;br /&gt;Wscript.Echo(UCase(&amp;quot;Case&amp;quot;)). returns: CASE&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;Val &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns number value of a string. Stops as soon it hits string char.            &lt;br /&gt;Wscript.Echo(Val(&amp;quot;22 Maple st.&amp;quot;)). returns: 22&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;WeekDay &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns number representing the day of the week.            &lt;br /&gt;Wscript.Echo(WeekDay(date)). returns: 6 -&amp;gt; Assuming today is Friday&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="150"&gt;         &lt;p&gt;WeekdayName &lt;/p&gt;       &lt;/td&gt;        &lt;td width="862"&gt;         &lt;p&gt;Returns the name of the specified week day.            &lt;br /&gt;Wscript.Echo(WeekdayName(6)). returns: Friday&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;These functions are built-in to VBS so all you need to do is pass the correct values!&amp;#160; I can’t remember where I sourced all of this information from, so if you want to be credited, just let me know!&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3225728" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/doxley/archive/tags/Scripting/default.aspx">Scripting</category></item><item><title>Faster Creation of Virtual Machines</title><link>http://blogs.technet.com/doxley/archive/2009/04/08/faster-creation-of-virtual-machines.aspx</link><pubDate>Wed, 08 Apr 2009 09:55:49 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3223845</guid><dc:creator>Daniel Oxley</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/doxley/comments/3223845.aspx</comments><wfw:commentRss>http://blogs.technet.com/doxley/commentrss.aspx?PostID=3223845</wfw:commentRss><description>&lt;p align="justify"&gt;I recently noticed a blog post on TechNet about a new tool that was released on CodePlex.&amp;#160; WIM2VHD is a command-line tool allows you to create &lt;u&gt;sysprepped&lt;/u&gt; VHD images from any Windows 7 installation source (and I suspect Windows Server 2008 R2 as well) that work with Virtual PC, Virtual Server, Microsoft Hyper-V, and Windows 7's new Native VHD-Boot functionality.&amp;#160; Basically, you can create an entire virtual machine VHD file in minutes without have to go through the whole setup process of Windows.&amp;#160; It is nice and simple to use, and after a brief moment of confusion I had it working fine :-)&lt;/p&gt;  &lt;p align="justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="justify"&gt;To create my first VHD file, I ran the command: &lt;strong&gt;cscript.exe C:\Users\Administrator\Desktop\WIM2VHD.wsf /wim:e:\sources\install.wim /sku:Ultimate /vhd:U:\Hyper-V\Win7.vhd /size:12000 /disktype:Dynamic&lt;/strong&gt;&lt;/p&gt;  &lt;p align="justify"&gt;However, this failed (as shown below) with the error “&lt;strong&gt;Error: 0: No filePath was specified&lt;/strong&gt;”.&amp;#160; After fiddling around with the command line to make sure that I was specifying the relevant paths, I realised that WIM2VHD was failing because it was unable to mount the WIM file from the Windows 7 DVD.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/FasterCreationofVirtualMachines_CB06/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/FasterCreationofVirtualMachines_CB06/image_thumb.png" width="670" height="498" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="justify"&gt;In order to mount WIM files, you first need to have installed the Windows Automated Installation Kit (WAIK), which you can get here: &lt;a title="http://www.microsoft.com/downloads/details.aspx?familyid=4AD85860-D1F4-42A1-A46C-E039E3D0DB5D&amp;amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?familyid=4AD85860-D1F4-42A1-A46C-E039E3D0DB5D&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=4AD85860-D1F4-42A1-A46C-E039E3D0DB5D&amp;amp;displaylang=en&lt;/a&gt;.&amp;#160; One thing to note is that I installed the beta version that was released for Windows 7.&amp;#160; I do not actually know if the current 1.1 version will work with WIM2VHD, I imagine so.&amp;#160; The 1.1 version can be found here: &lt;a title="http://www.microsoft.com/downloads/details.aspx?familyid=94BB6E34-D890-4932-81A5-5B50C657DE08&amp;amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?familyid=94BB6E34-D890-4932-81A5-5B50C657DE08&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=94BB6E34-D890-4932-81A5-5B50C657DE08&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&amp;#160;&lt;/p&gt;  &lt;p align="justify"&gt;Once that was installed, I simply re-ran the previous command and, as you can see, had much more success!&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/FasterCreationofVirtualMachines_CB06/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/FasterCreationofVirtualMachines_CB06/image_thumb_1.png" width="672" height="739" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p align="justify"&gt;&lt;a href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/FasterCreationofVirtualMachines_CB06/image_6.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/FasterCreationofVirtualMachines_CB06/image_thumb_2.png" width="671" height="786" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p align="justify"&gt;This really is a great tool, as you can create virtual machines extremely quickly.&amp;#160; And, the possibilities are endless because you could incorporate WIM2VHD into existing processes so that you could provision new computers easily and quickly on-the-fly using scripts.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3223845" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/doxley/archive/tags/Scripting/default.aspx">Scripting</category><category domain="http://blogs.technet.com/doxley/archive/tags/Hyper-V/default.aspx">Hyper-V</category><category domain="http://blogs.technet.com/doxley/archive/tags/Server+2008/default.aspx">Server 2008</category><category domain="http://blogs.technet.com/doxley/archive/tags/Tips/default.aspx">Tips</category><category domain="http://blogs.technet.com/doxley/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://blogs.technet.com/doxley/archive/tags/Server+2008+R2/default.aspx">Server 2008 R2</category></item><item><title>Self-writing code</title><link>http://blogs.technet.com/doxley/archive/2008/11/18/self-writing-code.aspx</link><pubDate>Tue, 18 Nov 2008 14:30:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3155753</guid><dc:creator>Daniel Oxley</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/doxley/comments/3155753.aspx</comments><wfw:commentRss>http://blogs.technet.com/doxley/commentrss.aspx?PostID=3155753</wfw:commentRss><description>&lt;P align=justify mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P align=justify&gt;If you do a lot of scripting for Windows, then you probably use VBScript (VBS) to do it.&amp;nbsp; With VBScript you can easily retrieve information about pretty much anything that is in your computer, or connected to the network, which is what makes it a good choice as a scripting language.&lt;/P&gt;
&lt;P align=justify&gt;When working on a project I often need to create a script that will take an action based upon certain criteria.&amp;nbsp; For example, I recently created a script that renamed the assigned drive letter in Windows Explorer for the CD-ROM drive, only if the existing assigned letter was “E:\”; the best, and surest, way to do this is by including a WMI query in your script and then reading the output.&amp;nbsp; Most people however get rather lost in the seemingly overcomplicated commands/syntax required to include WMI queries in a VBS script, which although rather daunting to look at, is not actually too difficult to do, especially if you have a tool that does the whole job for you!&lt;/P&gt;
&lt;P align=justify&gt;The WMI Code Creator from Microsoft is an invaluable tool that you can use to instantly generate sample VBS script that uses WMI.&amp;nbsp; Simply choose the Namespace you want to use, select the class and then click on one of the properties; in the right-hand pane will appear the example VBS code that you can use.&lt;/P&gt;
&lt;P align=center&gt;&lt;A href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/wmicodecreator_AAEE/image_2.png" mce_href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/wmicodecreator_AAEE/image_2.png"&gt;&lt;IMG title=image style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=384 alt=image src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/wmicodecreator_AAEE/image_thumb.png" width=645 border=0 mce_src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/wmicodecreator_AAEE/image_thumb.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P align=left&gt;So why try to work it out by yourself when you can use this free tool to generate all the code you need!&amp;nbsp; See this page for a full review of the tool and the links to download it: &lt;A title=http://technet.microsoft.com/en-us/magazine/cc161034.aspx href="http://technet.microsoft.com/en-us/magazine/cc161034.aspx" mce_href="http://technet.microsoft.com/en-us/magazine/cc161034.aspx"&gt;http://technet.microsoft.com/en-us/magazine/cc161034.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P align=justify&gt;Also, I thought I’d include links to some other invaluable scripting tools that are often overlooked but are equally as useful:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/technet/scriptcenter/tools/scripto2.mspx" mce_href="http://www.microsoft.com/technet/scriptcenter/tools/scripto2.mspx"&gt;Scriptomatic&lt;/A&gt; – Another code generating tool that can help you write your WMI code. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=75cca21a-53b9-4949-9b62-a8fc7926e914&amp;amp;DisplayLang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=75cca21a-53b9-4949-9b62-a8fc7926e914&amp;amp;DisplayLang=en"&gt;Script Center All-in-one&lt;/A&gt; – A single .chm file that includes over 160 example scripts. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/technet/scriptcenter/tools/twkmatic.mspx" mce_href="http://www.microsoft.com/technet/scriptcenter/tools/twkmatic.mspx"&gt;Tweakomatic&lt;/A&gt; – Creates the code that will allow you to tweak all those system settings that are not exposed in the Windows default user interface. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=39044E17-2490-487D-9A92-CE5DCD311228&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=39044E17-2490-487D-9A92-CE5DCD311228&amp;amp;displaylang=en"&gt;EZADScriptomatic&lt;/A&gt; – Auto-magically creates ADSI VBS scripts that allow you to interact with Active Directory. &lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3155753" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/doxley/archive/tags/Windows/default.aspx">Windows</category><category domain="http://blogs.technet.com/doxley/archive/tags/Scripting/default.aspx">Scripting</category></item><item><title>Job/Life/Reputation protector 2.0</title><link>http://blogs.technet.com/doxley/archive/2008/11/10/job-life-reputation-protector-2-0.aspx</link><pubDate>Mon, 10 Nov 2008 14:58:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3150390</guid><dc:creator>Daniel Oxley</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.technet.com/doxley/comments/3150390.aspx</comments><wfw:commentRss>http://blogs.technet.com/doxley/commentrss.aspx?PostID=3150390</wfw:commentRss><description>&lt;P&gt;Back in January I &lt;A href="http://blogs.technet.com/doxley/archive/2008/01/23/gulp-did-i-really-just-send-that-to-the-entire-company.aspx" mce_href="http://blogs.technet.com/doxley/archive/2008/01/23/gulp-did-i-really-just-send-that-to-the-entire-company.aspx"&gt;posted&lt;/A&gt; some simple VBA code for adding an “are you sure?” type question to the Reply To All button in Outlook.&amp;nbsp; Since then I have received a few suggestions for improving the code, one of the most common of which was to add to the question box the list of names that the mail will be sent to.&amp;nbsp; So, as requested, you can find below the updated code!&amp;nbsp; &lt;/P&gt;
&lt;P align=center&gt;&lt;A href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/Jobsaver2_B12E/image_6.png" mce_href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/Jobsaver2_B12E/image_6.png"&gt;&lt;IMG title=image style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=236 alt=image src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/Jobsaver2_B12E/image_thumb_2.png" width=484 border=0 mce_src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/Jobsaver2_B12E/image_thumb_2.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just place this code in a module in Outlook (you can get to the VBA editor by pressing ALT+F11) and then assign it a button on the toolbar:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR&gt;Sub ReplyToAllGuard()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; On Error GoTo ReplyAllErr&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim myOlApp As Outlook.Application&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim myFolder As Outlook.MAPIFolder&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim myItem As Outlook.MailItem&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ReplyMail&amp;nbsp; As Outlook.MailItem&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim i As Integer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set myOlApp = Application&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set myFolder = myOlApp.ActiveExplorer.CurrentFolder&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; iCount = myOlApp.ActiveExplorer.Selection.Count&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 1 To iCount&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set myItem = myOlApp.ActiveExplorer.Selection.Item(1)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set ReplyMail = myItem.ReplyAll&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next i&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim mymsg As String&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim strRecipients As String&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ReplyQ As Integer&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each strRec In ReplyMail.Recipients&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strRecipients = strRecipients &amp;amp; strRec &amp;amp; Chr(13)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mymsg = "You just clicked Reply to All.&amp;nbsp; Are you sure that this is what you want to do?&amp;nbsp; The following recipients will receive this mail:" &amp;amp; _&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chr(13) &amp;amp; Chr(13) &amp;amp; strRecipients&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReplyQ = MsgBox(mymsg, vbYesNo, "Job/Life/Reputation protector")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ReplyQ = vbNo Then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set ReplyMail = Nothing&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myItem.UnRead = False&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReplyMail.Display&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;
&lt;P&gt;ReplyAllErr:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Err.Number = -2147467259 Then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "The sender has prevented you from being able to reply to all recipients.", vbOKOnly, "Job/Life/Reputation protector"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub&lt;/P&gt;
&lt;P&gt;End Sub&lt;BR&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I also made one another change to the code in order to prevent receiving the error “A program is trying to access e-mail address information stored in Outlook”.&amp;nbsp; This error is generated because Outlook has detected a possible security risk because some ‘unknown’ VBA code is trying to harvest the e-mail addresses from an e-mail; in this case though, we actually want it to!&lt;/P&gt;
&lt;P align=center&gt;&amp;nbsp;&lt;A href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/Jobsaver2_B12E/image_4.png" mce_href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/Jobsaver2_B12E/image_4.png"&gt;&lt;IMG title=image style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=184 alt=image src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/Jobsaver2_B12E/image_thumb_1.png" width=365 border=0 mce_src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/Jobsaver2_B12E/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Basically, instead of initiating a new Outlook session in memory, the code now reuses the existing instance of Outlook, thereby not generating a security problem as the message box is suggesting.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: I amended the code to fix an oversight by me where the code did not clean up after itself!&amp;nbsp; Also, the mail now marks itself as read after&amp;nbsp;you reply&amp;nbsp;- Thanks JP for pointing it out.&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3150390" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/doxley/archive/tags/Scripting/default.aspx">Scripting</category><category domain="http://blogs.technet.com/doxley/archive/tags/Office/default.aspx">Office</category><category domain="http://blogs.technet.com/doxley/archive/tags/VBA/default.aspx">VBA</category><category domain="http://blogs.technet.com/doxley/archive/tags/Security/default.aspx">Security</category><category domain="http://blogs.technet.com/doxley/archive/tags/Misc/default.aspx">Misc</category><category domain="http://blogs.technet.com/doxley/archive/tags/Tips/default.aspx">Tips</category></item><item><title>HTAMount – Simplifying the mounting of Hyper-V VHD files to your computer</title><link>http://blogs.technet.com/doxley/archive/2008/09/24/htamount-simplifying-the-mounting-of-hyper-v-vhd-files-to-your-computer.aspx</link><pubDate>Wed, 24 Sep 2008 12:38:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3127648</guid><dc:creator>Daniel Oxley</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/doxley/comments/3127648.aspx</comments><wfw:commentRss>http://blogs.technet.com/doxley/commentrss.aspx?PostID=3127648</wfw:commentRss><description>&lt;P mce_keep="true"&gt;HTAMount is a HTML application that I wrote a while ago that provides a no-nonsense interface allowing you to mount/unmount offline Hyper-V virtual disk images (VHD) to your local file system, in read-only mode.&amp;nbsp; It consists of a HTML Application (HTA) front-end with some VBS script doing the mount/unmounting of the images via a WMI interface.&amp;nbsp; Attached to this post is a zip file that contains the application, hopefully you'll find it useful.&lt;/P&gt;
&lt;P align=center&gt;&lt;A href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/HTAMountMountingHyperVVHDfilestoyourcomp_9665/image_4.png" mce_href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/HTAMountMountingHyperVVHDfilestoyourcomp_9665/image_4.png"&gt;&lt;IMG title=image style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=295 alt=image src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/HTAMountMountingHyperVVHDfilestoyourcomp_9665/image_thumb_3.png" width=435 border=0 mce_src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/HTAMountMountingHyperVVHDfilestoyourcomp_9665/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;It should be pretty self-explanatory regarding how to use it.&amp;nbsp; To mount a VHD file,&amp;nbsp; just click the ‘Browse…’ button to select the VHD file you wish to mount, select the ‘Mount’ radio option, then press the ‘Mount / Unmount’ button.&amp;nbsp; To unmount a VHD file, just select it from the list of currently mounted VHD files (you might need to refresh this list using the button), choose the ‘Unmount’ radio option and then press the ‘Mount / Unmount’ button.&amp;nbsp; I can’t guarantee that the code is bug-free, although I have been using it for a while and I think I have solved any issues with it.&amp;nbsp; If you do find anything that needs fixing, please comment on this post to let me know!&lt;/P&gt;
&lt;P&gt;I got the inspiration for developing this tool from a &lt;A href="http://blogs.msdn.com/virtual_pc_guy/archive/2008/02/01/mounting-a-virtual-hard-disk-with-hyper-v.aspx" mce_href="http://blogs.msdn.com/virtual_pc_guy/archive/2008/02/01/mounting-a-virtual-hard-disk-with-hyper-v.aspx"&gt;script&lt;/A&gt; that the ‘Virtual PC Guy’ posted back in February 2008.&amp;nbsp; Whilst the script is correct and works great, it had a couple of things that I didn’t like.&amp;nbsp; Namely, the fact that you need to hard-code the path to the VHD file you want to mount, and that you need to extend the script a bit (or create a 2nd separate one) in order to be able to unmount a VHD file.&amp;nbsp; So, HTAMount was born.&lt;/P&gt;
&lt;P&gt;One thing that is important is that you run the application &lt;U&gt;elevated&lt;/U&gt; (if you have UAC enabled) as it makes use of the Windows executable diskpart.exe which requires the highest security level to run.&amp;nbsp; By default, Windows 2008 does not provide the “Run as Administrator” option when you right-click on a HTA file; however, with a simple change in the registry, you can add this option to the menu for these files.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/HTAMountMountingHyperVVHDfilestoyourcomp_9665/image_8.png" mce_href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/HTAMountMountingHyperVVHDfilestoyourcomp_9665/image_8.png"&gt;&lt;IMG title=image style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=29 alt=image src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/HTAMountMountingHyperVVHDfilestoyourcomp_9665/image_thumb_5.png" width=226 border=0 mce_src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/HTAMountMountingHyperVVHDfilestoyourcomp_9665/image_thumb_5.png"&gt;&lt;/A&gt;&lt;FONT size=1&gt; The option in the context-menu for HTA files that is lacking by default&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Included in the attached zip file is a text file that you can rename to a .reg file after extracting it from the zip archive.&amp;nbsp; Double-clicking on this file will import its contents into your registry, instantly adding the item to the context menu.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The VBS code is commented, so feel free to open it up with Notepad to see how it all works.&amp;nbsp; I have also added to the code some comments regarding certain routines, and why I have used them;&amp;nbsp;If you can see any improvements that could be made in the code, I would be interested to know!&lt;/P&gt;
&lt;P&gt;This is not an ‘in-development’ tool.&amp;nbsp; I don’t spend time revising the code, unless I experience an error while using it.&amp;nbsp; So don’t expect any updates to it unless either I find a bug, or someone else comments on this page with an error that I then fix.&amp;nbsp; Of course, feel free to suggest new features although I cannot promise anything.&amp;nbsp; Finally, please don’t distribute this code on a different website., link back to my blog post instead.&amp;nbsp; This is important so that people will always have the latest version, and know that the source of the download is from the author.&lt;/P&gt;
&lt;P&gt;Bugfix: fixed a bug where the interface remained locked&amp;nbsp;when pressing "Unmount" while no disks were mounted.&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3127648" width="1" height="1"&gt;</description><enclosure url="http://blogs.technet.com/doxley/attachment/3127648.ashx" length="3372" type="application/x-zip-compressed" /><category domain="http://blogs.technet.com/doxley/archive/tags/Windows/default.aspx">Windows</category><category domain="http://blogs.technet.com/doxley/archive/tags/Scripting/default.aspx">Scripting</category><category domain="http://blogs.technet.com/doxley/archive/tags/Hyper-V/default.aspx">Hyper-V</category><category domain="http://blogs.technet.com/doxley/archive/tags/Server+2008/default.aspx">Server 2008</category></item><item><title>Doesn't this thing go any faster?</title><link>http://blogs.technet.com/doxley/archive/2008/08/05/doesn-t-this-thing-go-any-faster.aspx</link><pubDate>Tue, 05 Aug 2008 10:41:16 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3098707</guid><dc:creator>Daniel Oxley</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/doxley/comments/3098707.aspx</comments><wfw:commentRss>http://blogs.technet.com/doxley/commentrss.aspx?PostID=3098707</wfw:commentRss><description>&lt;p&gt;A Knowledge Base (KB) article and related software update was released on the May 20th 2008 that seems to have gone fairly unnoticed by quite a few people.&amp;#160; The article (&lt;a title="http://support.microsoft.com/kb/952830" href="http://support.microsoft.com/kb/952830"&gt;http://support.microsoft.com/kb/952830&lt;/a&gt;) is rather vaguely titled &amp;quot;Description of Windows Script 5.7 for Windows XP&amp;quot; and it details the updated version of the Windows Scripting Host for Windows XP, along with a brief summary of the files that it contains.&amp;#160; The reason I think that it has gone fairly unnoticed is because all the useful information for this update is contained in the release notes (which you have to download manually and extract from the compressed file) rather than on the KB page where it should be.&amp;#160; This makes it pretty unlikely that anyone will know what changes have been made and what improvements the update offers.&lt;/p&gt;  &lt;p&gt;The update contains a lot of fixes but there is one fix in particular that is probably going to be useful to many people.&amp;#160; It is the following:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Fixed attempting to load nonexistent wshenu.dll which created performance problem in login scripts&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;What this means is that, if you have a logon script that has been developed in Visual Basic Script (VBS) that seems to execute slower than it should, then by applying this update you &lt;em&gt;could&lt;/em&gt; gain performance benefits during the scripts execution.&amp;#160; Quite often I have seen VBS logon scripts that seem to take too long to execute with no obvious reason why, well this may be the reason!&lt;/p&gt;  &lt;p&gt;Of course, it could be that the reason your script runs slow is because of programming errors or other factors not related to the scripting host, but if you are sure that your script is designed well and contains no errors then perhaps this update can solve your performance problems.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Thanks to a buddy of mine, Mauricio Tamayo, for pointing this out to me!&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3098707" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/doxley/archive/tags/Windows/default.aspx">Windows</category><category domain="http://blogs.technet.com/doxley/archive/tags/XP/default.aspx">XP</category><category domain="http://blogs.technet.com/doxley/archive/tags/Scripting/default.aspx">Scripting</category></item><item><title>Gulp! Did I really just send that to the entire company...?</title><link>http://blogs.technet.com/doxley/archive/2008/01/23/gulp-did-i-really-just-send-that-to-the-entire-company.aspx</link><pubDate>Wed, 23 Jan 2008 13:47:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:2772215</guid><dc:creator>Daniel Oxley</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/doxley/comments/2772215.aspx</comments><wfw:commentRss>http://blogs.technet.com/doxley/commentrss.aspx?PostID=2772215</wfw:commentRss><description>&lt;P&gt;I am sure that it has happened to everyone in some way or another.&amp;nbsp; You receive an e-mail from a colleague and decide to reply with some harmless comment/joke/snide remark/insult/opinion* but without realising that you pressed the 'Reply To All' button, nor realising that HR and/or your boss were copied on the e-mail as well.&amp;nbsp; Now you are thinking 'Oh dear' and a way to explain it all away as harmless and inconsequential; sound familiar?&amp;nbsp; Well look no further as you can prevent it from ever happening again with just a few lines of code!&lt;/P&gt;
&lt;P&gt;You can use the following VBA code in a module in Outlook (only tested in Outlook 2007) to request confirmation from you before using the 'Reply To All' button.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Sub ReplyToAllGuard() &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim mymsg As String &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ReplyQ As Integer &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mymsg = "You just clicked Reply to All.&amp;nbsp; Are you sure that this is what you want to do?" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReplyQ = MsgBox(mymsg, vbYesNo, "Job/Life/Reputation protector") &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ReplyQ = vbNo Then &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim myOlApp As Outlook.Application &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim myFolder As Outlook.MAPIFolder &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim myItem As Outlook.MailItem &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim ReplyMail&amp;nbsp; As Outlook.MailItem &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim i As Integer &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set myOlApp = CreateObject("Outlook.Application") &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set myFolder = myOlApp.ActiveExplorer.CurrentFolder &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iCount = myOlApp.ActiveExplorer.Selection.Count &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 1 To iCount &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set myItem = myOlApp.ActiveExplorer.Selection.item(1) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set ReplyMail = myItem.ReplyAll &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ReplyMail.Display &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next i &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If &lt;/P&gt;
&lt;P&gt;End Sub&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;Just create a new button on your toolbar (see the snapshot of my toolbar below) and link it to the code that you have added to your module.&amp;nbsp; IIRC, there is also some code somewhere in the help files of Office that does a similar thing, but I could not find it quickly and the above code only took 2 minutes to write.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/GulpDidIreallyjustsendthattotheentireco_8D29/image_2.png" mce_href="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/GulpDidIreallyjustsendthattotheentireco_8D29/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=30 alt=image src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/GulpDidIreallyjustsendthattotheentireco_8D29/image_thumb.png" width=264 border=0 mce_src="http://blogs.technet.com/blogfiles/doxley/WindowsLiveWriter/GulpDidIreallyjustsendthattotheentireco_8D29/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;* delete as applicable&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2772215" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/doxley/archive/tags/Scripting/default.aspx">Scripting</category><category domain="http://blogs.technet.com/doxley/archive/tags/Office/default.aspx">Office</category><category domain="http://blogs.technet.com/doxley/archive/tags/VBA/default.aspx">VBA</category></item><item><title>Updating your deployment point programmatically</title><link>http://blogs.technet.com/doxley/archive/2008/01/08/updating-your-deployment-point-programmatically.aspx</link><pubDate>Tue, 08 Jan 2008 16:17:57 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:2723317</guid><dc:creator>Daniel Oxley</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/doxley/comments/2723317.aspx</comments><wfw:commentRss>http://blogs.technet.com/doxley/commentrss.aspx?PostID=2723317</wfw:commentRss><description>&lt;p&gt;I was asked recently if it was possible to launch an &amp;quot;Update&amp;quot; and/or an &amp;quot;Update (files only)&amp;quot; in MDT via a script as my client did not want to open the MMC console just to update their Distribution Point.&amp;#160; Well, yes it is possible and here you have a PowerShell script that does it!&lt;/p&gt;  &lt;p&gt;You'll need to have the .NET Framework, WAIK and PowerShell installed on the computer you plan to run these scripts.&amp;#160; Also, you'll need to modify the scripts to add the correct path of the loaded assemblies.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#0000ff"&gt;[System.Reflection.Assembly]::LoadFrom(&amp;quot;C:\Program Files\Microsoft Deployment Toolkit\Bin\Microsoft.BDD.ConfigManager.dll&amp;quot;)        &lt;br /&gt;[System.Reflection.Assembly]::LoadFrom(&amp;quot;C:\Program Files\Windows AIK\Tools\Image Manager\Microsoft.ComponentStudio.Common.dll&amp;quot;)         &lt;br /&gt;[System.Reflection.Assembly]::LoadFrom(&amp;quot;C:\Program Files\Windows AIK\Tools\Image Manager\Microsoft.ComponentStudio.ComponentPlatformImplementation.dll&amp;quot;)         &lt;br /&gt;[System.Reflection.Assembly]::LoadFrom(&amp;quot;C:\Program Files\Windows AIK\Tools\Image Manager\Microsoft.ComponentStudio.ComponentPlatformInterface.dll&amp;quot;)         &lt;br /&gt;[System.Reflection.Assembly]::LoadFrom(&amp;quot;C:\Program Files\Windows AIK\Tools\Image Manager\Microsoft.ComponentStudio.Serializer.dll&amp;quot;) &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#0000ff"&gt;$manager = [Microsoft.BDD.ConfigManager.Manager]        &lt;br /&gt;$Deploymanager = $manager::Deploymanager         &lt;br /&gt;$newItem = $Deploymanager[&amp;quot;&lt;strong&gt;&amp;lt;Place your DP GUID Here&amp;gt;&lt;/strong&gt;&amp;quot;]         &lt;br /&gt;$newItem.Generate(&amp;quot;x86&amp;quot;, &amp;quot;c:\temp\logupdate.log&amp;#8221;, $false)&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;In order to retrieve the GUID of your Deployment Point you can use the following script, and then add the GUID returned to the script above.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#0000ff"&gt;[System.Reflection.Assembly]::LoadFile(&amp;quot;C:\Program Files\Microsoft Deployment Toolkit\Bin\Microsoft.BDD.ConfigManager.dll&amp;quot;)        &lt;br /&gt;$manager = [Microsoft.BDD.ConfigManager.Manager] &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#0000ff"&gt;$manager::InstallPath        &lt;br /&gt;$manager::WaikPath         &lt;br /&gt;$manager::TempPath &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font color="#0000ff"&gt;write-host &amp;quot;Deploy:&amp;quot;        &lt;br /&gt;$manager::DeployManager.GetDataTable()&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If you want to update only the configuration files, make sure to change the following line to:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#0000ff"&gt;$newItem.Generate(&amp;quot;x86&amp;quot;, &amp;quot;c:\temp\logupdate.log&amp;#8221;, &lt;strong&gt;$true&lt;/strong&gt;)&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;When the last parameter is set to &lt;strong&gt;$false&lt;/strong&gt; the script will update all files, whereas if it is set to &lt;strong&gt;$true&lt;/strong&gt; the script will update only the configuration files.&amp;#160; It goes without saying that this is not an official script of MDT, nor Microsoft, so use it at your own risk!&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2723317" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/doxley/archive/tags/Microsoft+Deployment+Toolkit/default.aspx">Microsoft Deployment Toolkit</category><category domain="http://blogs.technet.com/doxley/archive/tags/Scripting/default.aspx">Scripting</category></item><item><title>Creating a WIM the quick way...</title><link>http://blogs.technet.com/doxley/archive/2007/11/27/creating-a-wim-the-quick-way.aspx</link><pubDate>Wed, 28 Nov 2007 00:28:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:2575817</guid><dc:creator>Daniel Oxley</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.technet.com/doxley/comments/2575817.aspx</comments><wfw:commentRss>http://blogs.technet.com/doxley/commentrss.aspx?PostID=2575817</wfw:commentRss><description>&lt;P&gt;IMAGEX is a fantastic tool, but it has a command line that can, at times, be way too complicated.&amp;nbsp; As of yet, there is no official, nice, easy-to-use interface or GUI to simplify the whole thing although a couple of people have posted DIY ones on the web with various levels of success.&lt;/P&gt;
&lt;P&gt;My current client needed a simplified way of creating a WIM file for use during the BDD project I am working on; they are using WIM files as a means of applying files to a computer, similar to just creating a ZIP file and extracting the contents.&amp;nbsp; Anyway, I was asked if Microsoft had something (or could create something) that he could give to a junior member of staff so that s/he could create these WIM files without making mistakes or getting confused with the command line.&amp;nbsp; So, I created a very simple HTA file which will do exactly what he asked for.&amp;nbsp; Seeing as he liked it so much I thought that I would share it here so that others can take advantage of it.&lt;/P&gt;
&lt;P&gt;Feel free to use/abuse/butcher/amend/correct/revise/recycle any or all of the code for your own use.&amp;nbsp; Of course, I must mention the usual disclaimer: USE AT YOUR OWN RISK!&amp;nbsp; THIS IS NOT 100% TESTED CODE.&lt;/P&gt;
&lt;P&gt;Unfortunately, it does come with 3 requirements.&amp;nbsp; The first is that it is run with administrative permissions.&amp;nbsp; This is not a problem with Windows XP if you are an admin on the box but with Windows Vista you'll need to run it elevated (Windows Vista does not give you the "Run as Administrator" option for HTA files so you'll need to elevate a cmd prompt first, then run the HTA.&amp;nbsp; The second is that you have the file imagex.exe in the same folder as the HTA file, and the third is that you have already installed the imagex filter driver.&amp;nbsp; Installing the filter driver is easy to do, either install the WAIK on your computer or just right click on the .inf file which you will find in the same folder as imagex.exe on a computer that has the WAIK installed and choose "install".&lt;/P&gt;
&lt;P&gt;To use: simply copy the code below and paste it (careful with the wordwrap)into notepad.&amp;nbsp; Save the file with the .hta extension and then you are ready to run it, a simple double-click and you are away!&amp;nbsp; Enjoy.&lt;/P&gt;
&lt;P&gt;&amp;lt;head&amp;gt; &lt;BR&gt;&amp;lt;title&amp;gt;WIMCreator&amp;lt;/title&amp;gt; &lt;BR&gt;&amp;lt;HTA:APPLICATION &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; APPLICATIONNAME="IMAGEX - CAPTURE HTA" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MAXIMIZEBUTTON="NO" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MINIMIZEBUTTON="NO" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCROLL="NO" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SHOWINTASKBAR="YES" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SINGLEINSTANCE="YES" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WINDOWSTATE="NORMAL" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SYSMENU="YES" &lt;BR&gt;&amp;gt; &lt;BR&gt;&amp;lt;/head&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;lt;script language="VBScript"&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sub Window_onLoad &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim path &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set fso = CreateObject("scripting.filesystemobject") &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = fso.getabsolutepathname(".") &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CurrFolder.InnerHTML = CurrFolder.InnerHTML &amp;amp; " " &amp;amp; path &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if fso.FileExists(path &amp;amp; "\imagex.exe") = false then &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Msgbox "IMAGEX.exe does not exist in the same folder as this HTA program." &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageXExists.checked = false &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; savefolderbox.disabled = true &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; savefolderbutton.disabled = true &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; driversbox.disabled = true &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; driversbutton.disabled = true &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clearvalues.disabled = true &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; createwim.disabled = true&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; commentbox.disabled = true &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageXExists.checked = true &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end if &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Function BrowseForSaveLocation &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; On Error Resume Next &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oShell, oFolder, intColonPos, oWshShell &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oShell = CreateObject("Shell.Application") &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oWshShell = CreateObject("WScript.Shell") &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oFolder = oShell.BrowseForFolder(0, "Choose WIM destination folder", &amp;amp;h17, OPTIONS) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BrowseForFolder = oFolder.ParentFolder.ParseName(oFolder.Title).Path &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Err.Number &amp;gt; 0 Then BrowseForFolder = Null &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If oFolder.Title = "Desktop" Then BrowseForFolder = owshshell.SpecialFolders("Desktop") &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; intColonPos = InStr(oFolder.Title, ":") &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If intColonPos &amp;gt; 0 Then BrowseForFolder = Mid(oFolder.Title, intColonPos - 1, 2) &amp;amp; "\" &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; savefolderbox.value = BrowseForFolder &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Function BrowseForDrivers &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; On Error Resume Next &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oShell, oFolder, intColonPos, oWshShell &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oShell = CreateObject("Shell.Application") &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oWshShell = CreateObject("WScript.Shell") &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oFolder = oShell.BrowseForFolder(0, "Choose source folder", &amp;amp;h17, OPTIONS) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BrowseForFolder = oFolder.ParentFolder.ParseName(oFolder.Title).Path &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Err.Number &amp;gt; 0 Then BrowseForFolder = Null &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If oFolder.Title = "Desktop" Then BrowseForFolder = owshshell.SpecialFolders("Desktop") &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; intColonPos = InStr(oFolder.Title, ":") &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If intColonPos &amp;gt; 0 Then BrowseForFolder = Mid(oFolder.Title, intColonPos - 1, 2) &amp;amp; "\" &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DriversBox.value = BrowseForFolder &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Function &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sub ClearVals &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; savefolderbox.value = "" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; driversbox.value = "" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; commentbox.value = "" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sub CloseHTA &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.close &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sub CaptureWIM &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim path &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set fso = CreateObject("scripting.filesystemobject") &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = fso.getabsolutepathname(".") &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oWshShell = CreateObject("WScript.Shell") &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim imgCMD &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; imgCMD = path &amp;amp; "\imagex.exe /capture " &amp;amp; chr(34) &amp;amp; driversbox.value &amp;amp; chr(34) &amp;amp; " " &amp;amp; chr(34) &amp;amp; &lt;/P&gt;
&lt;P&gt;savefolderbox.value &amp;amp; "\mywim.WIM" &amp;amp; chr(34) &amp;amp; " " &amp;amp; chr(34) &amp;amp; commentbox.value &amp;amp; chr(34) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWshShell.Run imgCMD, , True &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub &lt;BR&gt;&amp;lt;/script&amp;gt; &lt;/P&gt;
&lt;P&gt;&amp;lt;body&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;span&amp;gt;&amp;lt;span&amp;gt;&amp;lt;span style='font-family: Arial'&amp;gt;&amp;lt;span style='font-size: 10pt'&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;span id = "DataArea"&amp;gt;Welcome to the WIM creation tool!&amp;nbsp; This tool Is NOT an official Microsoft product and &lt;/P&gt;
&lt;P&gt;this therefore totally unsupported.&amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You must execute this program with admin rights!&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;hr /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;span id = "CurrFolder"&amp;gt;Current directory:&amp;lt;/span&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMAGEX.exe found?&amp;amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="ImageXExists" type="checkbox" name="imagexexists" checked="CHECKED" disabled="disabled" /&amp;gt;&amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;hr /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;span style='font-size: 10pt; font-family: Arial'&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Path to source folder&amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/span&amp;gt;&amp;lt;input id="DriversBox" name="DriversBox" style='width: 617px; font-size: 10pt; font-family: Arial;' &lt;/P&gt;
&lt;P&gt;type="text" readonly="readOnly" /&amp;gt;&amp;lt;span &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style='font-size: 10pt; font-family: Arial'&amp;gt; &amp;lt;/span&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="DriversButton" type="button" value="Browse..." name="DriversButton" onclick="BrowseForDrivers" &lt;/P&gt;
&lt;P&gt;style='font-size: 10pt; font-family: Arial' /&amp;gt;&amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;span style='font-size: 10pt; font-family: Arial'&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Location for WIM file to be saved&amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/span&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="saveFolderBox" name="saveFolderBox" style='width: 617px; font-size: 10pt; font-family: Arial;' &lt;/P&gt;
&lt;P&gt;type="text" readonly="readOnly" /&amp;gt;&amp;lt;span &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style='font-size: 10pt; font-family: Arial'&amp;gt; &amp;lt;/span&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="saveFolderButton" type="button" value="Browse..." name="saveFolderButton" &lt;/P&gt;
&lt;P&gt;onclick="BrowseForSaveLocation" style='font-size: 10pt; font-family: Arial' /&amp;gt;&amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;span style='font-size: 10pt; font-family: Arial'&amp;gt;Comment to be included in WIM file&amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/span&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="CommentBox" name="CommentBox" style='width: 617px; font-size: 10pt; font-family: Arial;' type='text' &lt;/P&gt;
&lt;P&gt;value="my wim file" /&amp;gt;&amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;hr style='font-size: 10pt; font-family: Arial' /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="CreateWIM" type="button" value="Create WIM" onclick="CaptureWIM" style='font-size: 10pt; font- &lt;/P&gt;
&lt;P&gt;family: Arial" /&amp;gt;&amp;lt;span &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style='font-size: 10pt; font-family: Arial'&amp;gt; &amp;lt;/span&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="ClearValues" type="button" value="Clear Values" onclick="ClearVals" style='font-size: 10pt; font- &lt;/P&gt;
&lt;P&gt;family: Arial" /&amp;gt;&amp;lt;span &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style='font-size: 10pt; font-family: Arial'&amp;gt; &amp;lt;/span&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input id="Exit" type="button" value="Exit" onclick="CloseHTA" style='font-size: 10pt; font-family: Arial' &lt;/P&gt;
&lt;P&gt;/&amp;gt;&amp;lt;span &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style='font-size: 10pt; font-family: Arial'&amp;gt; &amp;lt;/span&amp;gt; &lt;BR&gt;&amp;lt;/body&amp;gt;&lt;/P&gt;
&lt;P&gt;P.S.&amp;nbsp; I should mention that this was made for the creation of a WIM file based on a folder on your local filesystem.&amp;nbsp; I have no idea, and it was not developed with this in mind, if you could capture an actual Operating System install with it; although I suspect you could...&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2575817" width="1" height="1"&gt;</description><enclosure url="http://blogs.technet.com/doxley/attachment/2575817.ashx" length="6064" type="application/hta" /><category domain="http://blogs.technet.com/doxley/archive/tags/Business+Desktop+Deployment/default.aspx">Business Desktop Deployment</category><category domain="http://blogs.technet.com/doxley/archive/tags/Microsoft+Deployment+Toolkit/default.aspx">Microsoft Deployment Toolkit</category><category domain="http://blogs.technet.com/doxley/archive/tags/Scripting/default.aspx">Scripting</category></item><item><title>Junction points with network drives</title><link>http://blogs.technet.com/doxley/archive/2007/11/26/junction-points-with-network-drives.aspx</link><pubDate>Mon, 26 Nov 2007 11:01:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:2563378</guid><dc:creator>Daniel Oxley</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.technet.com/doxley/comments/2563378.aspx</comments><wfw:commentRss>http://blogs.technet.com/doxley/commentrss.aspx?PostID=2563378</wfw:commentRss><description>&lt;P&gt;Ever wanted to create a 'junction point' style pointer but using a network drive as the source?&amp;nbsp; Now you can!&lt;/P&gt;
&lt;P&gt;With Windows XP you can create junction points on your disks but the prerequisite is that the source point is on your local disk.&amp;nbsp; This is no good if you need to create the junction point that refers the user from a point that is anywhere else, for example a network drive.&amp;nbsp; This is actually very simple to do and has existed in Windows since Windows 98 (I think, but don't quote me on that...).&amp;nbsp; All you need to do is to create a desktop.ini file and a target.lnk file and you are all done.&amp;nbsp; The contents of the desktop.ini file should be:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;[.ShellClassInfo]")&lt;BR&gt;CLSID2={0AFACED1-E828-11D1-9187-B532F1E9575D}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;The target.lnk file you can either create manually or use the following VBS script:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;Set oWS = WScript.CreateObject("WScript.Shell")&lt;BR&gt;&amp;nbsp;sLinkFile = MYPATHFORFILE&amp;nbsp;&amp;amp; "\target.lnk"&lt;BR&gt;&amp;nbsp;Set oLink = oWS.CreateShortcut(sLinkFile)&lt;BR&gt;&amp;nbsp;oLink.TargetPath = SOURCEPATHTOBEREDIRECTED&lt;BR&gt;&amp;nbsp;oLink.WorkingDirectory =&amp;nbsp;DESTINATION&lt;BR&gt;&amp;nbsp;oLink.Save&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The only downside is that this solution also has a prerequisite.&amp;nbsp; The application that you want to follow the redirection must use Shell32.dll for it's file handling.&amp;nbsp; Seeing as most applications now do this should not be too great a problem for you.&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2563378" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/doxley/archive/tags/Windows/default.aspx">Windows</category><category domain="http://blogs.technet.com/doxley/archive/tags/XP/default.aspx">XP</category><category domain="http://blogs.technet.com/doxley/archive/tags/Scripting/default.aspx">Scripting</category></item></channel></rss>