title: VB.Net command line (console) program with parameters for SharePoint
body: <p>I would like to create a console program in VB.net that would allow parameters. What i would like to do is in the code below add parameters so the webpart page can be created from the Run menu. e.g. C:.......\MyProgram.exe "Design" --This would then create the Design webpart page.</p>
  
  <p>I tried looking at the internet but was not very successfull. any help would be greatly appreciated. </p>
  
  <pre><code>      Module Main
  
                  Public Sub Main(ByVal args As String())
            Dim prj As String
  
                      Dim site As New SPSite("http://site/")
                      Dim web As SPWeb = site.AllWebs(0)
  
                      Dim list As SPList = web.Lists("ListName")
  
  Dim postInformation As String = "&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;Method&gt;&lt;SetList Scope=""Request""&gt;" + list.ID.ToString + "&lt;/SetList&gt;&lt;SetVar 
      Name=""ID""&gt;New&lt;/SetVar&gt;&lt;SetVar Name=""Cmd""&gt;NewWebPage&lt;/SetVar&gt;&lt;SetVar 
      Name=""Type""&gt;WebPartPage&lt;/SetVar&gt;&lt;SetVar Name=""WebPartPageTemplate""&gt;2&lt;/SetVar&gt;&lt;SetVar 
      Name=""Title""&gt;" + prj.ToString + "&lt;/SetVar&gt;&lt;SetVar 
      Name=""Overwrite""&gt;true&lt;/SetVar&gt;&lt;/Method&gt;"
  
                      Dim processBatch As String = web.ProcessBatchData(postInformation)
                   'Display the results...
                  Console.WriteLine(processBatch)
                      Console.WriteLine("New Web part page added successfully")
                      Console.ReadLine()
  
  
  
                  End Sub
  
          End Module
  </code></pre>
  
  <p>Thanks in advance!</p>