Command Line Argument Problem
Hello Everyone-
I am having a problem passing in Command Line Arguments to my VB program.
My program does not seem to recognize any parameters that I pass into it when calling the EXE or when trying to test it passing the parameters in through the IDE.
I am using:
VB Code:
If Command$ <> "" then
'Do stuff here
end if
to determine if any arguments are being passed into my program. But no matter what I pass in as an argument the "Command$" variable always equals "". I have another program that accepts the exact same argument and I do not have any problems.
Has anybody else ever had this problem or have any advice on what is happening?
Thanks
Here is the code that I am using:
VB Code:
If Command$ <> "" Then
'/* Don't allow the GeneratedTitles screen to be */
'/* shown if the menus are running under */
'/* autmation. */
MenuGenerator.chkOptions(0).Value = 0
chkAutomaticPackage.Value = 1
MidnightDate = Format(Date, "MM/DD/YY HH:MM:SS")
'/* "Command$" must be passed in the through the */
'/* Command Line in the following format: */
'/* Headend00Days000 */
CommandString = Command$
Days = Mid(CommandString, 14, 3)
Headend = Mid(CommandString, 8, 2)
If Days = 0 Then
txtBuildDate.Value = Now
ElseIf Days = 1 Then
txtBuildDate.Value = DateAdd("d", 1, MidnightDate)
txtBuildDate.Value = Format(txtBuildDate.Value, "MM/DD/YY 12:00:00") & " AM"
Else
txtBuildDate.Value = DateAdd("d", Days, MidnightDate)
txtBuildDate.Value = Format(txtBuildDate.Value, "MM/DD/YY 12:00:00") & " AM"
End If
Call MenuGenerator.SQLQueries(adoExpirationDate, "", "", 6)
If Headend = 0 Then
MenuGenerator.chkMultiHeadends.Value = 1
Else
MenuGenerator.chkMultiHeadends.Value = 0
HeadendCode = Headend
cboHeadends.BoundText = HeadendCode
End If
'Call RefreshHeadends
SSTVODGenerator.Tab = 0
MenuGenerator.Show
Call cmdGenerateVOD_Click
End If
Which is the same code that I use in another piece of software for a different customer and it doesn't have any problems.