PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 2024 → Executing a Dos-Command from within a Windev Application (WD8)
Executing a Dos-Command from within a Windev Application (WD8)
Iniciado por Lieven De Nys, set., 27 2004 11:26 AM - 2 respostas
Publicado em setembro, 27 2004 - 11:26 AM
I have to execute DOS-commands from within a Windev-program.
This works (fine) since a longer while using an earlier filled-in
(MS-)Batch-file and then asking Windev to execute that Batch-file
via the statement ExeRun.
Ex: ExeRun("My_BatchFile.bat",,exeActif,exeBloquant)
Within the My_Batch-file.bat there is most of the time just one command:
copy c:\labels\out.asc LPT1:
Sometimes a few more lines like (when printing to a Serial-printer):
mode com2: 9600,n,8,1
mode lpt1=com2
copy c:\vblabels\out.asc LPT1:
As said before, this solution via the Batch-file "works fine",
but is a bit ugly, as, each time, it executes,
it shows for a split-second the "black" MS-Dos-screen.
I tried several ways already to write a "straight" ExeRun-statement like:
lbPrintRes = ExeRun(lsDOSCmmnds + "copy c:\vblabels\out.asc LPT1:",...
exeActif,exeBloquant)
Where lsDOSCmmnds = "C:\WINNT\SYSTEM32\cmd.exe "
But lbPrintRes always returns False!
For the Serial example I manage to execute the "mode"-commands
(still with a black-screen,) stating:
lbPrintRes = ExeRun(WinNTSysMap+"mode.com com1: 9600,n,8,1" ,...
exeActif,exeBloquant)
lbPrintRes = ExeRun(WinNTSysMap+"mode.com lpt1=com1" ,...
exeActif,exeBloquant)
Where WinNTSysMap = "C:\WINNT\SYSTEM32"
But then again I cannot send the following "copy"-command
from within Windev via an ExeRun(...)
Anybody knowa more about this?
Thanks foor Your attention, help.
Lieven De Nys.
Member of the Benelux (Dutch speaking) Windev-Developpersgroup.
Publicado em setembro, 23 2004 - 7:49 PM
Hello Lieven,
your Mode.com settings are only valid in the command box, after returning they are lost.
Just cursios, why not use WinDev's sOpen/sWrite etc, command?
Best regards
Raimund

I have to execute DOS-commands from within a Windev-program.
This works (fine) since a longer while using an earlier filled-in
(MS-)Batch-file and then asking Windev to execute that Batch-file
via the statement ExeRun.
Ex: ExeRun("My_BatchFile.bat",,exeActif,exeBloquant)
Within the My_Batch-file.bat there is most of the time just one command:
copy c:\labels\out.asc LPT1:
Sometimes a few more lines like (when printing to a Serial-printer):
mode com2: 9600,n,8,1
mode lpt1=com2
copy c:\vblabels\out.asc LPT1:
As said before, this solution via the Batch-file "works fine",
but is a bit ugly, as, each time, it executes,
it shows for a split-second the "black" MS-Dos-screen.
I tried several ways already to write a "straight" ExeRun-statement like:
lbPrintRes = ExeRun(lsDOSCmmnds + "copy c:\vblabels\out.asc LPT1:",...
exeActif,exeBloquant)
Where lsDOSCmmnds = "C:\WINNT\SYSTEM32\cmd.exe "
But lbPrintRes always returns False!
For the Serial example I manage to execute the "mode"-commands
(still with a black-screen,) stating:
lbPrintRes = ExeRun(WinNTSysMap+"mode.com com1: 9600,n,8,1" ,...
exeActif,exeBloquant)
lbPrintRes = ExeRun(WinNTSysMap+"mode.com lpt1=com1" ,...
exeActif,exeBloquant)
Where WinNTSysMap = "C:\WINNT\SYSTEM32"
But then again I cannot send the following "copy"-command
from within Windev via an ExeRun(...)
Anybody knowa more about this?
Thanks foor Your attention, help.
Lieven De Nys.
Member of the Benelux (Dutch speaking) Windev-Developpersgroup.



http://www.invitec.com
Publicado em setembro, 30 2004 - 11:42 PM
Hello Lieven,

For a long time we used Kyocera printers.
Kyocera had Prescribe commando's to select fonts etc etc

for example:

!R! map 10,10; (moves to cursor)
!R! font 15;
!R! say Have a nice day

I wrote all the commands to a file with fwrite etc and then simply copy the file to lpt1 or to the printerqueue.

Something like: fcopy(file,lpt1) or fcopy(File,Queuename)


See you in Meer.