Dave R. wrote:
> "Joe" <joe@[EMAIL PROTECTED]
> wrote in message
> news:13mnjamps7fpn19@[EMAIL PROTECTED]
>> I keep tring to shell out of my program to run a small utility program.
>> I use Exec. and I keep getting the same error, Unknown Identifier. That
>> I don't under stand. That command or option in listed in the help
>> files.
>>
>>
>> Exec ('CMD.EXE /C ' + myutil.exe);
>
> The declaration for Exec is:
>
> procedure Exec(Path, CmdLine: string);
>
> So the compiler is treating myutil.exe as a variable name / identifier,
> but since it hasn't been declared as one the compiler throws an error.
> You probably need something like:
>
> Exec(GetEnv('COMSPEC'), '/C myutil.exe);
>
> GetEnv('COMSPEC') will return the full path to the command interpreter,
> and the '/C myutil.exe' will complete the command line you need.
>
> Hope this helps!
>
> Dave
>
>
Thanks Dave, But, No. I'm sorry, It doesn't, See I real new to Pascal.
Just over a month, Any way if you have time. This is how I tried to run
it.
Exec('CMD.EXE /C ' + util + ' i' + ParamStr(0) + 'work\addata.dat' +
forsale + ' ' + ParamStr(0) + 'work\userdata.dat');
util:= 'path\filename'; // The utils program it self, In a Variable
addata:= Command line option for Util
userdata:= Command line option for util
Joe


|