Editing Batch Mode and Command-Line Arguments
Jump to:
navigation
,
search
Basic code to check for presence of command line arguments and NOT open up a window: If My.Application.CommandLineArgs.Count > 0 Then CommandLineMain() Me.Close() Exit Sub End If Then, CommandLineMain is similar to: Public Sub CommandLineMain() SetUpLogFile() MakeInitialLogEntries() 'MsgBox("In CommandLineMain") Try ProcessShellRequest(System.Environment.GetCommandLineArgs, "Command Line") If System.Environment.ExitCode = 0 Then System.Environment.ExitCode = 1 End If Catch ex As Exception System.Environment.ExitCode = -1999 LogFile.LogEntry("** Shell Request exited with error code -1999; error message follows:") LogFile.LogEntry(ex.Message) End Try MakeFinalLogEntries() End Sub See [[ProcessShellRequest]] for one way to process the single command on the command line.
|
Editing help
Personal tools
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
Edit
View history
Actions
Search
Navigation
Main page
Community portal
Current events
Recent changes
Random page
Help
Toolbox
What links here
Related changes
Special pages