Printing txt file

irade92

Registered User.
Local time
Today, 07:25
Joined
Dec 26, 2010
Messages
229
Hi
I have created txt file pf500.in which should be printed by fiscal32.exe...Both files are in the same folder
I use this code:

Dim RetVal
RetVal = Shell("fiscal32.EXE", 1)
but I get the message 'File not found'

In Dos prompt if I invoke FISCAL32.EXE it automatically take pf500.in to print (by default)
Where I make mistake?
 
Hi

A quick look at the help file would sugest that you need to include the path to the file. For example

Dim RetVal
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1) ' Run Calculator.
 
Hi

A quick look at the help file would sugest that you need to include the path to the file. For example

Dim RetVal
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1) ' Run Calculator.

Thanks, but instead of fiscal32.exe in my code if I put Notepad.exe it works....(Notepad.exe is in the same folder) ..have any comment?
 
Launching a program from a DOS prompt assumes relative path, so if you open a command prompt to C:\Windows and that's where fiscal32.exe is, it will run if you type just the name. When you use the shell command the relative path is now where your database is executing from, unless fiscal32.exe is in the same path as your database you will probably have to use the full path.

If I had to guess why notepad.exe works without a path is because it is an installed program and native to windows. You could likely get fiscal32.exe to work the same way...but isn't it easier to just use the full path?
 

Users who are viewing this thread

Back
Top Bottom