<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>A little work blog &#187; parameter</title>
	<atom:link href="http://leereid.wordpress.com/tag/parameter/feed/" rel="self" type="application/rss+xml" />
	<link>http://leereid.wordpress.com</link>
	<description>Windows software installation, packaging &#38; distribution</description>
	<lastBuildDate>Sun, 06 Dec 2009 22:19:32 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='leereid.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/73d3af8ccae7dc4fa1fc97e139659fd7?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>A little work blog &#187; parameter</title>
		<link>http://leereid.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://leereid.wordpress.com/osd.xml" title="A little work blog" />
		<item>
		<title>Sweet VBScript &#8211; command line parameters</title>
		<link>http://leereid.wordpress.com/2008/01/10/sweet-vbscript-command-line-parameters/</link>
		<comments>http://leereid.wordpress.com/2008/01/10/sweet-vbscript-command-line-parameters/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 06:10:58 +0000</pubDate>
		<dc:creator>leereid</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[parameter]]></category>
		<category><![CDATA[switch]]></category>

		<guid isPermaLink="false">http://leereid.wordpress.com/2008/01/10/sweet-vbscript-command-line-parameters/</guid>
		<description><![CDATA[Something neat I did was working with command line parameters in VBScript. You can access the command line arguments array through
Wscript.Arguments(i)
where i goes from 0 upwards. So, if you&#8217;ve got one argument option you could handle it like this
If Wscript.Arguments.Count = 0 Then
    &#8216; Do Proceed as Normal
Else
    If Wscript.Arguments(0) = &#8220;/something&#8221; Then
         RunFunctionA
  End If
End If
If [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leereid.wordpress.com&blog=1848353&post=17&subd=leereid&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Something neat I did was working with command line parameters in VBScript. You can access the command line arguments array through</p>
<p>Wscript.Arguments(i)</p>
<p>where i goes from 0 upwards. So, if you&#8217;ve got one argument option you could handle it like this</p>
<p>If Wscript.Arguments.Count = 0 Then<br />
    &#8216; Do Proceed as Normal<br />
Else<br />
    If Wscript.Arguments(0) = &#8220;/something&#8221; Then<br />
         RunFunctionA<br />
  End If<br />
End If</p>
<p>If you want to have multiple parameters (the script I did had /nolog &amp; /reset), then you&#8217;ll want to process all the arguments before you proceed. So, I went through the array and turned on flags so I could act afterwards. If you don&#8217;t do this, you might end running something you don&#8217;t want or in a way you don&#8217;t want. You could process your arguments like this:</p>
<p>If Wscript.Arguments.Count = 0 Then<br />
    &#8216; Do Proceed as Normal<br />
Else<br />
    For i = 0 to Wscript.Arguments.Count &#8211; 1<br />
        If Wscript.Arguments(i) = &#8220;/reset&#8221; Then<br />
         resetflag=1 &#8217;Turn on the reset flag <br />
       ElseIf Wscript.Arguments(i) = &#8220;/nolog&#8221; Then<br />
         loggingflag = 0 &#8216;Turn off the logging flag <br />
  End If<br />
    Next<br />
End If</p>
<p>If loggingFlag =0 Then<br />
  &#8216;Don&#8217;t log<br />
Else<br />
 LogMyStuff &#8216; Call the function you want<br />
End If</p>
<p>&#8216;==========================================================================<br />
&#8216;If reset command line parameter is detected, run the reset function only, then quit<br />
&#8216;==========================================================================<br />
If resetFlag Then<br />
 Reset<br />
 WScript.Quit<br />
End If</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/leereid.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/leereid.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leereid.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leereid.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leereid.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leereid.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leereid.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leereid.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leereid.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leereid.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leereid.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leereid.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leereid.wordpress.com&blog=1848353&post=17&subd=leereid&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://leereid.wordpress.com/2008/01/10/sweet-vbscript-command-line-parameters/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/362111eaca8f527dda1e4bea90f2e162?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">leereid</media:title>
		</media:content>
	</item>
	</channel>
</rss>