<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Things I've Learned</title><subtitle type="html" /><id>http://blogs.technet.com/threekings/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.technet.com/threekings/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.technet.com/threekings/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2005-10-30T22:09:00Z</updated><entry><title>ADO.NET in PowerShell...Update SQL Data Example/Sample</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/threekings/archive/2008/07/18/ado-net-in-powershell-update-sql-data-example-sample.aspx" /><id>http://blogs.technet.com/threekings/archive/2008/07/18/ado-net-in-powershell-update-sql-data-example-sample.aspx</id><published>2008-07-18T17:20:00Z</published><updated>2008-07-18T17:20:00Z</updated><content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;We have a database that stores all our configuration key/value pairs in various tables (1 per component). This code updates the table based on the specifed table, key, and value.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;# Open SQL connection&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlConnection = New-Object System.Data.SqlClient.SqlConnection&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlConnection.ConnectionString = "Server=$computer;Database=ConfigurationStore;Integrated Security=True"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlConnection.Open()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;# Get DataTable to modify&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlDataAdapter = New-Object System.Data.SqlClient.SqlDataAdapter&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$dataTable = New-Object System.Data.DataTable&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlCommandSelect = New-Object System.Data.SqlClient.SqlCommand&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlCommandSelect.CommandText = "SELECT * FROM $table WHERE Name='$key'"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlCommandSelect.Connection = $sqlConnection&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlDataAdapter.SelectCommand = $sqlCommandSelect&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlDataAdapter.Fill($dataTable)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;# Setup UpdateCommand&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlCommandUpdate = New-Object System.Data.SqlClient.SqlCommand&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;#$sqlCommandUpdate.CommandText = "UPDATE dbo.$table SET $table.Value = N'$value' WHERE Name = N'$key'"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlCommandUpdate.CommandText = "UPDATE dbo.$table SET $table.Value = @Value WHERE Name = @Name"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlCommandUpdate.Connection = $sqlConnection&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlDataAdapter.UpdateCommand = $sqlCommandUpdate&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlDataAdapter.UpdateCommand.Parameters.Add("@Value", [System.Data.SqlDbType]::NVarChar, 500, "Value")&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlParameter = New-Object System.Data.SqlClient.SqlParameter&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlParameter = $sqlDataAdapter.UpdateCommand.Parameters.Add("@Name", [System.Data.SqlDbType]::NVarChar)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlParameter.SourceColumn = "Name"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlParameter.SourceVersion = [System.Data.DataRowVersion]::Original&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;# Update DataTable&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$dataTable.Rows[0].Value = $value&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlDataAdapter.Update($dataTable)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;$sqlConnection.Close()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3090787" width="1" height="1"&gt;</content><author><name>threekings</name><uri>http://blogs.technet.com/members/threekings.aspx</uri></author></entry><entry><title>Creating a folder/file name based on a date time stamp in NT Shell Script (Batch)</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/threekings/archive/2006/05/16/428751.aspx" /><id>http://blogs.technet.com/threekings/archive/2006/05/16/428751.aspx</id><published>2006-05-16T23:04:00Z</published><updated>2006-05-16T23:04:00Z</updated><content type="html">&lt;P&gt;for /F "tokens=2,3,4 delims=/ " %%i in ('date /t') do set datetimefolder=%%k%%i%%j&lt;/P&gt;
&lt;P&gt;for /F "tokens=1,2,3 delims=: " %%i in ('time /t') do set datetimefolder=%datetimefolder%_%%i%%j%%k&lt;/P&gt;
&lt;P&gt;echo DateTimeFolder=%datetimefolder%&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;will output something like:&lt;/P&gt;
&lt;P&gt;20060516_1216PM&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=428751" width="1" height="1"&gt;</content><author><name>threekings</name><uri>http://blogs.technet.com/members/threekings.aspx</uri></author></entry><entry><title>errorlevel in for loop returns exit code of iterating statement</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/threekings/archive/2006/02/26/420570.aspx" /><id>http://blogs.technet.com/threekings/archive/2006/02/26/420570.aspx</id><published>2006-02-26T05:08:00Z</published><updated>2006-02-26T05:08:00Z</updated><content type="html">&lt;P class=MsoNormal&gt;&lt;FONT face="Century Gothic" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Century Gothic'"&gt;It turns out that errorlevel is returning the exit code of iterating statement in the for loop instead of the one immediately preceding it.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face="Century Gothic" size=2&gt;&lt;SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: 'Century Gothic'"&gt;for /r \\computer\share\x86 %%x in (*.xml) do (&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face="Century Gothic" size=2&gt;&lt;SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: 'Century Gothic'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;B&gt;&lt;FONT face="Century Gothic" size=2&gt;&lt;SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: 'Century Gothic'"&gt;IsVarMap.exe /file:"%%x"&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face="Century Gothic" size=2&gt;&lt;SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: 'Century Gothic'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo %ERRORLEVEL%&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face="Century Gothic" size=2&gt;&lt;SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: 'Century Gothic'"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Century Gothic" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Century Gothic'"&gt;Echoes 0 always. I expect some iterations to return 2, when xml file isn’t a VarMap.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Century Gothic" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Century Gothic'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face="Century Gothic" size=2&gt;&lt;SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: 'Century Gothic'"&gt;IsVarMap.exe /file:notavarmap.xml&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;B&gt;&lt;FONT face="Century Gothic" size=2&gt;&lt;SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: 'Century Gothic'"&gt;echo %ERRORLEVEL%&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Century Gothic" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Century Gothic'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Century Gothic" size=2&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Century Gothic'"&gt;Echoes 2 as expected&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=420570" width="1" height="1"&gt;</content><author><name>threekings</name><uri>http://blogs.technet.com/members/threekings.aspx</uri></author></entry><entry><title>Notepad</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/threekings/archive/2005/11/14/414437.aspx" /><id>http://blogs.technet.com/threekings/archive/2005/11/14/414437.aspx</id><published>2005-11-14T21:39:00Z</published><updated>2005-11-14T21:39:00Z</updated><content type="html">Sometimes you may click the Edit menu and find that the Go To command is not available. If this is the case, you have probably turned on the 'word wrap' feature. This feature enables you to see all the text on the line, but does not affect the way the text appears when it is printed. If you want to use the Go To command, you need to turn of 'word wrap'. Within Notepad, click the Format menu and remove the check beside Word Wrap.&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=414437" width="1" height="1"&gt;</content><author><name>threekings</name><uri>http://blogs.technet.com/members/threekings.aspx</uri></author></entry><entry><title>Command Prompt Tips and Tricks</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/threekings/archive/2005/10/30/413310.aspx" /><id>http://blogs.technet.com/threekings/archive/2005/10/30/413310.aspx</id><published>2005-10-31T00:09:00Z</published><updated>2005-10-31T00:09:00Z</updated><content type="html">&lt;DIV class=Section1&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;FONT face=Tahoma&gt;&lt;FONT color=#0000ff&gt;&lt;FONT size=2&gt;doskey.exe can be used to create&amp;nbsp;macros for your custom command prompt. Just create a shortcut like this:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;FONT face=Tahoma&gt;&lt;FONT color=#0000ff&gt;&lt;FONT size=2&gt;%SystemRoot%\system32\cmd.exe /k doskey /macrofile="C:\tools\DosKeyMacroFile.txt"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;FONT face=Tahoma&gt;&lt;FONT color=#0000ff&gt;&lt;FONT size=2&gt;DosKeyMacroFile.txt looks like this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;FONT face=Tahoma&gt;&lt;FONT color=#0000ff&gt;&lt;FONT size=2&gt;[cmd.exe]&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; n=notepad.exe $*&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; s=pushd C:\scratch&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; re=regedit.exe&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reboot=shutdown.exe -r -f -c "rebooting"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dk=doskey /macros:all&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; em=notepad "C:\tools\DosKeyMacroFile.txt"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tools=pushd "C:\tools"&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#0000ff size=2&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;As you can see by the first line, you can use $* to specify that this command should receive it's parameters from the command line. For example, if I want to edit test.cmd&amp;nbsp;I just run "n test.cmd"&amp;nbsp;from my command prompt.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=413310" width="1" height="1"&gt;</content><author><name>threekings</name><uri>http://blogs.technet.com/members/threekings.aspx</uri></author></entry></feed>