<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://rayharwood.com/Wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://rayharwood.com/Wiki/index.php?action=history&amp;feed=atom&amp;title=Batch_Mode_and_Command-Line_Arguments</id>
		<title>Batch Mode and Command-Line Arguments - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://rayharwood.com/Wiki/index.php?action=history&amp;feed=atom&amp;title=Batch_Mode_and_Command-Line_Arguments"/>
		<link rel="alternate" type="text/html" href="http://rayharwood.com/Wiki/index.php?title=Batch_Mode_and_Command-Line_Arguments&amp;action=history"/>
		<updated>2026-11-06T06:24:18Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.3</generator>

	<entry>
		<id>http://rayharwood.com/Wiki/index.php?title=Batch_Mode_and_Command-Line_Arguments&amp;diff=27&amp;oldid=prev</id>
		<title>Rayharwood: Initial creation</title>
		<link rel="alternate" type="text/html" href="http://rayharwood.com/Wiki/index.php?title=Batch_Mode_and_Command-Line_Arguments&amp;diff=27&amp;oldid=prev"/>
				<updated>2013-04-26T13:54:14Z</updated>
		
		<summary type="html">&lt;p&gt;Initial creation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Basic code to check for presence of command line arguments and NOT open up a window:&lt;br /&gt;
&lt;br /&gt;
        If My.Application.CommandLineArgs.Count &amp;gt; 0 Then&lt;br /&gt;
            CommandLineMain()&lt;br /&gt;
            Me.Close()&lt;br /&gt;
            Exit Sub&lt;br /&gt;
        End If&lt;br /&gt;
&lt;br /&gt;
Then, CommandLineMain is similar to:&lt;br /&gt;
&lt;br /&gt;
    Public Sub CommandLineMain()&lt;br /&gt;
        SetUpLogFile()&lt;br /&gt;
        MakeInitialLogEntries()&lt;br /&gt;
        'MsgBox(&amp;quot;In CommandLineMain&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
        Try&lt;br /&gt;
            ProcessShellRequest(System.Environment.GetCommandLineArgs, &amp;quot;Command Line&amp;quot;)&lt;br /&gt;
            If System.Environment.ExitCode = 0 Then&lt;br /&gt;
                System.Environment.ExitCode = 1&lt;br /&gt;
            End If&lt;br /&gt;
        Catch ex As Exception&lt;br /&gt;
            System.Environment.ExitCode = -1999&lt;br /&gt;
            LogFile.LogEntry(&amp;quot;** Shell Request exited with error code -1999; error message follows:&amp;quot;)&lt;br /&gt;
            LogFile.LogEntry(ex.Message)&lt;br /&gt;
        End Try&lt;br /&gt;
&lt;br /&gt;
        MakeFinalLogEntries()&lt;br /&gt;
    End Sub&lt;br /&gt;
&lt;br /&gt;
See [[ProcessShellRequest]] for one way to process the single command on the command line.&lt;/div&gt;</summary>
		<author><name>Rayharwood</name></author>	</entry>

	</feed>