Welcome! Log In Create A New Profile

Advanced

Problem with DOS Batch file

Posted by erich45 
Problem with DOS Batch file
March 30, 2021 04:51PM
Hello

My solution will not work:
For a exotic Labelprinter I have to send Binary data direct to the printer.
I do this creating a File with the data.
Then I create a DOS Batch file as follow:
Cmd is string = "c:\windows\system32\LPR.exe -S " + Computername + " -P " + Printername + " " + Filename + " -ol"
an write it to my disk: fSaveText("C:\Temp\Batch.bat", Cmd)

This Batch can I start manualy without any problems, it works.
But unfortunately I am not able to start the batch by WinDev
I tryed 'exerun', 'DDEstart' (DDEStart("C:\Temp\Batch.bat"))
whatever i try, it does'nt work

Anybody can help me ?

Thanks in advance
Erich
Argus
Re: Problem with DOS Batch file
March 30, 2021 05:27PM
why use a batch file when you can do an exerun direct of LPR.exe?

Anyway, your problem is most probably a rights problem... Try running your exe as administrator, that may solve it
pao
Re: Problem with DOS Batch file
March 30, 2021 07:15PM
Try with EXERUN or SHELLEXECUTE instead of DDESTART

Regards

Paulo Oliveira



Edited 1 time(s). Last edit at 03/30/2021 07:16PM by pao.
Re: Problem with DOS Batch file
March 31, 2021 12:11PM
Hi Erich,
run the "LPR.exe" directly.

The following works for me with a spool printer ...
j=ExeRun("c:\temp\spool.exe Rep8.txt",exeActive, exeDontWait, "C:\temp\")

Regards
Steven Sitas
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: