|
-
May 31st, 2000, 10:25 AM
#1
Pleez, Read This!!! Matter Important! "Printing in "DOS mode" using "Shell" -not happening, I wonder
Hi
[I had to repost it since I have not received any replies for my earlier post]
I have a problem.
Following is the code :
Shell("c:\windows\command.com /c type " & App.path & "\matrix.txt >prn")
where App.path is C:\XYZ
when the above line is executed, the contents of "matrix.txt" is not printed on the printer. Instead, control just passes on to the next line.
So, to find out why, I modified the line thus.
Shell("c:\windows\command.com /K")
The above command takes me to the "command prompt". Here, when I give the command "type c:\xyz\matrix.txt >prn", which is what the vbcode does, I get the message "file creation error".
So, I have identified the problem. Can anyone tell me why this "File creation error" occurs, And how to solve the problem?
Thanks for reading through.
-
June 1st, 2000, 08:47 AM
#2
Re: Pleez, Read This!!! Matter Important! "Printing in "DOS mode" using "Shell" -not happening, I wo
As no one replied, I'll have a guess....
Try two ">" instead of one, or try
> LPT1
and make sure theres a space either side of the >
Scott.
---
Freeware VB programs at http://net23uk.freeservers.com
-
June 6th, 2000, 11:24 AM
#3
Re: Pleez, Read This!!! Matter Important! "Printing in "DOS mode" using "Shell" -not happening, I wo
First I send report output to the text file - TextFile.txt. Then I print from the text file
Call PrintTextFile(TextFile.txt) - procedure call
Public Sub PrintTextFile(ByVal sTextFile As String)
'this sub shells to DOS and call nprint command to print the text file
Dim sCommandString As String
Dim sServerString As String
'DOS command line -> nprint TextFile.txt q=OutqueueName s=ServerName nt nb ff
sServerString = ServerName & " nt nb ff"
sCommandString = nprint & " " & sTextFile & " q=" & OutQueueName & " s=" & Servername
r = Shell("start.exe " & sCommandString, vbHide)
End Sub
Iouri Boutchkine
[email protected]
-
June 21st, 2000, 09:47 AM
#4
Re: Pleez, Read This!!! Matter Important! "Printing in "DOS mode" using "Shell" -not happening, I wo
Make sure you can print from command prompt without using any VB program.
if using are Windows NT/98 on a network make sure you capture the printer in dos mode, like net use lpt1: \\servername\printername something like this. make sure your printer name is not more than 8 character. hope it helps.
-
June 3rd, 2003, 07:37 AM
#5
Very Urgent printing Problem in Shell, Port
Hi, Guyes
First I use Shell command to send text print, but i got too problems, so i start send files copy to PRN ot LPT1.
Case 1.
Printer is installed on Windows 98,
My program is running from Win 2000, I have shared the printer from 98 Pc, and Also set the Lpt port using net use command, it works fine.
Problem 1:
Printer is Installed on Windows 2000
I am sending Print using above method to Win 98
( I have shared the printer, also Net Use for LPT1), Now in Program gives error File Not Found (I find which file, it says PRN is not found") and at the same time from DOS prompt If I used Copy FileName PRN or LPT1 then It works,
But It not work through my Program.
I also Tryed using OPEN Printer Port for Output it also gives the same Problem
-------------------------
Please Help in this case very fastly,
Satish
-
June 3rd, 2003, 08:39 AM
#6
You do not need to use Shell. Try this undocumented function:
Code:
Open "LPT1:" For Output Access Write As #1
Print #1, "hello"
Close #1
You can also send printer escape codes.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|