SIMPLE QUESTION : SIMPLE ANSWER? 
Author Message
 SIMPLE QUESTION : SIMPLE ANSWER?

I am trying to copy a binary file to a printer port using simple OS
commands.  In gqbasic or QBasic, I could simply do the following :

SHELL "COPY /B FILE.PRN LPT1" or even
SHELL "COPY /B FILE.PRN \\SERVER\SHARED_PRINTER"

In VB, I want something like:

  FileCopy Source, Target

but keep getting errors.

The files I am copying are quite large ( 50mb ) and I do not want to
have to do a
 DO : READ byte_block : WRITE byte_block : UNTIL EOF(infile)

Anyone know of an elegant solution?

Thanks in advance

Do, or Do Not.There is no Try.



Fri, 14 Sep 2001 03:00:00 GMT  
 SIMPLE QUESTION : SIMPLE ANSWER?

Quote:
>Subject: SIMPLE QUESTION : SIMPLE ANSWER?

>Date: 3/29/99 2:21 PM Central Standard Time

>I am trying to copy a binary file to a printer port using simple OS
>commands.  In gqbasic or QBasic, I could simply do the following :

>SHELL "COPY /B FILE.PRN LPT1" or even
>SHELL "COPY /B FILE.PRN \\SERVER\SHARED_PRINTER"

>In VB, I want something like:

>  FileCopy Source, Target

>but keep getting errors.

>The files I am copying are quite large ( 50mb ) and I do not want to
>have to do a
> DO : READ byte_block : WRITE byte_block : UNTIL EOF(infile)

>Anyone know of an elegant solution?

>Thanks in advance

>Do, or Do Not.There is no Try.

I don't think you can copy to a printer that way in VB, if that is what you are
trying to do.

If so, you can call the DOS commands by:

x% = Shell("Command /c COPY /B FILE.PRN LPT1",1)
or
x% = Shell("Command /c COPY /B FILE.PRN PRN",1)

If you system recognizes LPT1 or  PRN this should work.



Sat, 15 Sep 2001 03:00:00 GMT  
 SIMPLE QUESTION : SIMPLE ANSWER?
Why dont you use same technique if that works for you, but from VB you have
to
call copy from command.com
syntax:
command /Ccommand

Shell  "Command.com /Ccopy /B c:\autoexec.bat LPT1", vbMinimizedNoFocus

Im not sure if that works, but if it does, you dont have to rewrite your
code much

Hope that helps,
Aikka

Quote:
> I am trying to copy a binary file to a printer port using simple OS
> commands.  In gqbasic or QBasic, I could simply do the following :

> SHELL "COPY /B FILE.PRN LPT1" or even
> SHELL "COPY /B FILE.PRN \\SERVER\SHARED_PRINTER"

> In VB, I want something like:

>   FileCopy Source, Target

> but keep getting errors.

> The files I am copying are quite large ( 50mb ) and I do not want to
> have to do a
>  DO : READ byte_block : WRITE byte_block : UNTIL EOF(infile)

> Anyone know of an elegant solution?

> Thanks in advance

> Do, or Do Not.There is no Try.



Sat, 15 Sep 2001 03:00:00 GMT  
 SIMPLE QUESTION : SIMPLE ANSWER?

Thankyou for the reply.  Writing the code now...


Do, or Do Not.There is no Try.



Sat, 15 Sep 2001 03:00:00 GMT  
 SIMPLE QUESTION : SIMPLE ANSWER?
Thanks for the reply!



Quote:
>Why dont you use same technique if that works for you, but from VB you have
>to
>call copy from command.com
>syntax:
>command /Ccommand

>Shell  "Command.com /Ccopy /B c:\autoexec.bat LPT1", vbMinimizedNoFocus

>Im not sure if that works, but if it does, you dont have to rewrite your
>code much

>Hope that helps,
>Aikka


>> I am trying to copy a binary file to a printer port using simple OS
>> commands.  In gqbasic or QBasic, I could simply do the following :

>> SHELL "COPY /B FILE.PRN LPT1" or even
>> SHELL "COPY /B FILE.PRN \\SERVER\SHARED_PRINTER"

>> In VB, I want something like:

>>   FileCopy Source, Target

>> but keep getting errors.

>> The files I am copying are quite large ( 50mb ) and I do not want to
>> have to do a
>>  DO : READ byte_block : WRITE byte_block : UNTIL EOF(infile)

>> Anyone know of an elegant solution?

>> Thanks in advance

>> Do, or Do Not.There is no Try.

Do, or Do Not.There is no Try.


Sat, 15 Sep 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. SIMPLE QUESTION : SIMPLE ANSWER?

2. Simple Question...simple answer???

3. SIMPLE QUESTION, please SIMPLE ANSWER

4. HELP! simple question need simple answer

5. HELP! simple question need simple answer

6. HELP! simple question need simple answer

7. A simple Mail problem in search for a equally simple answer

8. Simple Question: Assigning Icon to an App : Simple Question

9. Anyone want answer a simple question???

10. simple SQL question... please answer

11. Simple Question, how about the answer?

12. Simple question...can't find answer....

 

 
Powered by phpBB® Forum Software