: : : : : I'm getting a run-time error stating :
: : : : :
: : : : : Input Error : There is no script engine for file extension ".EXE"
: : : : :
: : : : : I am making and external call to run a program with the following line :
: : : : :
: : : : : exec('CSCRIPT','SNAPIN.EXE');
: : : : :
: : : : :
: : : : : SNAPIN is the file I'm calling, and it is located in the correct location. I have "Uses DOS" in the declaration section. ...is there another module that I must include? By the way...SNAPIN was written with VB 6.0, but it makes no "crazy" object calls.
: : : : :
: : : : : I'm using FreePascal. Your assistance is appreciated in advance.
: : : :
: : : : CSCRIPT is one of the two Windows Scripting Host interpreters. You can only pass it VBScript or JScript scripts for it to interpret, not pre-compiled executables.
: : : :
: : :
: : : WOW....worked like a charm!!!

First compile and it worked perfectly. I guess the "C" in CSCRIPT stands for "Command." Would have worked for com files, but I needed the Windows components. VBSCRIPT worked the first time. Thanks for the solution.

: :
: : That's cool it works, but it sounds like you may still be doing it the wrong way. If you have compiled a program (which you must have if you have SNAPIN.EXE), then you don't need to run it through an interpreter like CSCRIPT. And VBSCRIPT isn't a recognized command on my machine, so I don't even know what that is, or why running it through that works.
: :
: : Depending on what compiler you are using, one of these should be the proper method:
: :
: : Exec('C:\PATH\TO\SNAPIN.EXE', '');
: :
: : or
: :
: : Exec(GetEnv('COMSPEC'), '/C C:\PATH\TO\SNAPIN.EXE');
: :
: :
: :
: I just reset it to omit the VBSCRIPT, but the compiler choked....are you sure of the syntax on the EXEC() command?
:
: Exec('C:\CSP\SNAPIN.EXE', '');
:
:
:
:
:
:
I found the problem....I has a quote mark that has two dashes in it ratheer than 2 single dash marks.....it just compiled....let me see how that works....