Sending a string to printer device

Results 1 to 2 of 2

Thread: Sending a string to printer device

  1. #1
    Join Date
    Dec 1969

    Default Sending a string to printer device

    Hello,<BR>I am trying to send a String to the printer. Here&#039;s the code that I have:<BR><BR>**** code starts from here ******<BR><BR>Set objFS = Server.CreateObject("Scripting.FileSystemObject")< BR>Set objWSHNet = Server.CreateObject("WScript.Network")<BR> <BR>&#039; Connect to Network Printer from Windows Script Host<BR>&#039;objWSHNet.AddPrinterConnection "LPT1", strPrinterPath, false, strUserName, strPassword<BR> <BR>If Err Then<BR> Response.Write "Error 2 <BR>" & vbCrLf<BR> Response.Write err.Description <BR> Response.End()<BR>End If<BR><BR>**** code ends here ****<BR>I am setting the strPrinterpath, strUsername and strPassword parameters just before this. But I get an "Error 2" with description as "A specified logon session does not exist. It may already have been terminated". I checked the server side and it is running. So, not sure why this is happening.<BR><BR>Would appreciate any help.<BR><BR>If this is not the right forum, can you please suggest one?<BR><BR>Thanks<BR>Vivek

  2. #2
    Join Date
    Dec 1969

    Default RE: Sending a string to printer device

    On which printer do you want to print? The printer on the server?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts