title: Configuring a printer's redirect port via prompt
body: <p>I've been trying to create an installer for a program I wrote in Java, implementing GhostScript, that creates a virtual printer where the file is sent to. My program then reads the files and manages it accordingly. However, I had to manually configure the RedMon Redirect Port (RPT1:) and manually created a new printer, using that port, taking as arguments the .jar file:</p>
  
  <p>Arguments configured on the printer's port:</p>
  
  <p><a href="https://i.stack.imgur.com/0Op0U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0Op0U.png" alt="Arguments configured on the printer&#39;s port"></a></p>
  
  <p>I was able to create a new printer via NSIS (the program I'm using to create the installer) like so:</p>
  
  <pre><code>Exec 'cscript "C:\Windows\System32\Printing_Admin_Scripts\pt-BR\prnport.vbs" ^ -a -r RPT1:'
  ExecWait 'rundll32 printui.dll,PrintUIEntry /if /f "$INSTDIR\ghostpdf.inf"^ /r "RPT1:" /m "Ghostscript PDF" /b "Impressora SPE" /u /Y'
  </code></pre>
  
  <p>Is there a way to do the same, via commands, for configuring ports? If possible, I'd like to create a separate port for my program (currently I'm using the default RedMon port), but also pass the Java arguments to it on installation, so the end user doesn't have to manually include these arguments. I've looked everywhere, but every guide and article I found had it done manually.</p>
  
  <p>Thanks for any help!</p>