trying to write a small program
that will change the default printer
at the command line..

eg: c:\dp LaserJet4

dp the name of my program
and LaserJet4 in the list
of my printers...


here is what i have but it
doesn't work...

any suggestions greatly appreciated.

Private Sub Form_Load()
Dim Prntr As Printer
Dim PrinterName As String
Dim CommandLine As String
Dim subc1 As String * 10
Dim subc2 As String * 10

Me.Hide

CommandLine = Command$
subc1 = InStr(1, CommandLine, subc2, vbTextCompare)
If subc1 <> 0 Then
PrinterName = subc1 'new default

For Each Prntr In Printers
If Prntr.DeviceName = PrinterName Then
Set Printer = Prntr
Exit For
End If
Next
Else
End If
Unload Me
End Sub