Samson
Guest
|
Post by Samson on Aug 28, 2018 17:32:26 GMT 1
I want to start an exe file with the autoexec.txt but it doesn't work. When I cut out this line with the exe file, vdos starts and I can insert the exe file name and the application starts.
But what did I wrong that the exe file doesn't start with the autoexec.txt?
Thanks for help!
|
|
|
Post by Jos on Aug 28, 2018 19:54:08 GMT 1
What if you remove all lines from the autoexec.txt file, and only add these two lines:
your_program.exe pause
Jos
|
|
Samson
Guest
|
Post by Samson on Aug 29, 2018 12:35:03 GMT 1
Firstly, thank for your response.
I can't remove the lines obove because I have to change the directory. But when i add the pause command before the exe file name vdos starts and the application too after pressing a button.
Here is the code of the autoexec file: use C: C:\vdos\ use D: C:\vdos\ cd KHK_71A\T001 pause pw.exe
|
|
|
Post by Jos on Aug 29, 2018 13:26:16 GMT 1
If you change “pause” to “REM pause” your program doesn’t start?
BTW, “use C: C:\vdos\” doesn’t do anything since DOS C: is already assigned to that directory. While “use D: C:\vdos\” could be “USE D: .\” since you seem to need DOS D: assigned to the same directory.
Jos
|
|
Samson
Guest
|
Post by Samson on Aug 29, 2018 14:01:57 GMT 1
Thank you for the hint!
I'm afraid but nothing happend even with REM pause. But I can live with the pause command.
Simon
|
|
|
Post by Jos on Aug 29, 2018 16:59:15 GMT 1
I guess your program runs in graphics, not text mode. To avoid an initial silly empty DOS black window before a DOS program has actually started, vDos postpones any video output for 2.5 seconds, or until the program awaits user input, whatever comes first. Your program would switch from text (the vDos default) to graphics mode within this period, so the video routines don’t handle that switch. The pause command simply forces vDos to create its window, so it's ready to switch to graphics mode.
Jos
|
|
|
Post by Jos on Aug 29, 2018 21:38:53 GMT 1
Note: This behavior is no bug, it’s by design from the early start of vDos to block games being started in vDos. vDos isn’t suited to run games, while ‘serious’ DOS programs are considered not to start in graphic mode.
Jos
|
|
Samson
Guest
|
Post by Samson on Aug 30, 2018 17:51:44 GMT 1
Thanks for your explanation. But my programm is a DOS order processing software. As I said it isn't a problem for me to start the program with the pause command.
I have another question concerning printing in vdos. I couldn't print the bills or the delivery notes directly. Because the fonts and position of the text are not printed correctly. So I set the option for LPT1 in the config.txt file to RAW. The print is correct now. Though the PDF printer wont work, because it cant read PCL. After this I installed the pcl6.exe an it works fine for PDF export.
So my question is: Is it possible, when I print a file in Vdos that a window opened and I can chose if I want a PDF file or print over a real printer? Thank you very much for your help Jos!
|
|
|
Post by Jos on Aug 30, 2018 22:16:05 GMT 1
This behavior was only reported once: A (Dutch) accounting program that displayed its graphical logo, then waited for a key press to continue in text mode. Deleting the logo PCX file was then the simple solution.
For your printing, the options would be: 1. Once created, print the PDF. If PCL6.exe is present, vDos will call that to handle PCL output. 2. If your application supports more than one printer port, setup one in config.txt to copy the #LPT1.asc file to the printer. The second to handle #LPT2.asc by PCL6.exe (moved outside the vDos directory). 3. Spent some time to adjust HORZ:, VERT:, and eventually FONT: settings, so the output satisfies you. If the output isn’t too complex (colors, different fonts), that should be doable. Without a specific SEL: setting, the Window printer selection dialog will popup, so you could print to any (virtual PDF) printer.
Jos
|
|
Samson
Guest
|
Post by Samson on Sept 4, 2018 18:45:19 GMT 1
Thank you very much for the different options!
1. Will be the best way for me because... 2. The software does supply another port, but the time you need to change it is very long. 3. The output have arround 3 different fonts so its very complex.
|
|
|
Post by Jos on Sept 4, 2018 19:16:36 GMT 1
You could eventually in time streamline the printing process:
1. Rename PCL6.exe to something else, so vDos won’t detect it. 2. Create a Windows batch file (or program) that asks for a PDF file name/path. If given, start <something else> with the parameters to generate the specified PDF file, if not, copy #lpt1.asc to lpt1 (so print). 3. Set LPT1 in config.txt to start the batch file.
Jos
|
|
Samson
Guest
|
Post by Samson on Sept 11, 2018 17:11:19 GMT 1
I'm afraid but I have several troubles to write such a batch file.
How can I set LPT1 in the config.txt to start the .batch file? I get every time an error message when I set this "LPT1=C:\vDos\print.bat" for LPT1.
My batch file looks like this:
@echo OFF SET /P _wahl= genrate PDF file? (Y/N): IF "%_wahl%"=="n" GOTO :print IF "%_wahl%"=="Y" GOTO :PDF :PDF SET /P _name= file name: SET /P _wahl2= print? (Y/N): IF "%_wahl2%"=="n" GOTO :end IF "%_wahl2%"=="y" GOTO :print :print
:end
Could you help me to complete the batch file please? Thank you very much for your help Jos!
Simon
|
|
|
Post by Jos on Sept 11, 2018 17:54:44 GMT 1
First, use print.cmd to make clear it’s a batch file intended to run under Windows. The basics would be something like:
@echo off SET /P _wahl= generate PDF file? (Y/N): IF "%_wahl%"=="n" GOTO :print IF "%_wahl%"=="y" GOTO :PDF exit :PDF pcl6.exe -sDEVICE=pdfwrite -o pdffile.pdf #lpt1.asc pdffile.pdf exit :print copy /b #lpt1.asc lpt1
Eventually add some PAUSEs, and a CD to check the Windows current directory. The setting in config.txt would then be: LPT1 = "print.cmd"
When printing to (vDos/DOS) LPT1, that should open a seperate Windows command line window w/o messing up the vDos window.
Jos
|
|
Samson
Guest
|
Post by Samson on Sept 12, 2018 15:39:21 GMT 1
Jos you are great, thank you very much for the help!
The PDF printing works perfectly but nothing happend when the batch file should print the #lpt1.asc file to a printer. What could be went wrong?
Is it possible to add a background (PDF file) in the PDF printing process?
Simon
|
|
|
Post by Jos on Sept 12, 2018 15:58:58 GMT 1
The LPT1 in the batch file is that of Windows. So you first have to redirect LPT1 to the shared printer (NET USE LPT1: xxxxxxx /persistent:yes). You can also use the (external) PRINT command of Windows, though that is known to add a last blank page sometimes.
PDFtk (https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/) can combine/merge PDF’s.
Jos
|
|