Printer Port - Assigning

Dear All

I am using Ax2009 in remote connection (terminal server), i need to print some of my labels through DOS mode, so i can create a text file and using DOS commands for printing (Local computer its working fine). So i need how to capture the remote printing port. (Local Printer LPT1,LPT2 or USB Printer ports) in Remote Printing it will automaticully assigned the pre-determined ports(TS-206). Any idea about this pl help me.

Thanks

Saravanan.R

I foundout the solution, details follows

PrintJobSettings = SysPrintOptions::newPrintJobSettingsOnServer();
devicename = printJobSettings.printerPortName();

Its Working Fine