Board index » delphi » Execute external program?

Execute external program?

Hi!

I want to create a Delphi program that changes my password on a NT-Server.
There is an DOS Application to do it (net.exe) but then I don't know how to
catch the errorlevels and their meaning.
Is there anybody who knows a solution for it?

Thanks in advance.

Bart

 

Re:Execute external program?


Use ShellExecute to execute external programs (from the ShellAPI unit)

Good luck

Re:Execute external program?


I know that I have to use ShellExecute.. but when I run an DOS application
like Net.Exe I want to know if the execution was succesfull or not.. so I
have to catch the errorlevels or something..
My question is HOW?

Daniel <Daniel.Kinn...@AdValvas.be> schreef in berichtnieuws
37dd28dd.7179...@news.skynet.be...

Quote
> Use ShellExecute to execute external programs (from the ShellAPI unit)

> Good luck

Re:Execute external program?


On Tue, 14 Sep 1999 09:50:07 +0200, "Bart Engels" <b...@bureau.owg.nl>
wrote:

Quote
>I know that I have to use ShellExecute.. but when I run an DOS application
>like Net.Exe I want to know if the execution was succesfull or not.. so I
>have to catch the errorlevels or something..
>My question is HOW?

>Daniel <Daniel.Kinn...@AdValvas.be> schreef in berichtnieuws
>37dd28dd.7179...@news.skynet.be...
>> Use ShellExecute to execute external programs (from the ShellAPI unit)

>> Good luck

Check the Win32.hlp file (from D3).  ShellExecute returns a value :

Return Value

If the function succeeds, the return value is the instance handle of
the application that was run, or the handle of a dynamic data exchange
(DDE) server application.
If the function fails, the return value is an error value that is less
than or equal to 32. The following table lists these error values:

Value   Meaning
0       The operating system is out of memory or resources.
ERROR_FILE_NOT_FOUND    The specified file was not found.
ERROR_PATH_NOT_FOUND    The specified path was not found.
ERROR_BAD_FORMAT        The .EXE file is invalid (non-Win32 .EXE or
error in .EXE image).
SE_ERR_ACCESSDENIED     Windows 95 only: The operating system denied
access to the specified file.
SE_ERR_ASSOCINCOMPLETE  The filename association is incomplete or
invalid.
SE_ERR_DDEBUSY  The DDE transaction could not be completed because
other DDE transactions were being processed.
SE_ERR_DDEFAIL  The DDE transaction failed.
SE_ERR_DDETIMEOUT       The DDE transaction could not be completed
because the request timed out.
SE_ERR_DLLNOTFOUND      Windows 95 only: The specified dynamic-link
library was not found.
SE_ERR_FNF      Windows 95 only: The specified file was not found.
SE_ERR_NOASSOC  There is no application associated with the given
filename extension.
SE_ERR_OOM      Windows 95 only: There was not enough memory to
complete the operation.
SE_ERR_PNF      Windows 95 only: The specified path was not found.
SE_ERR_SHARE    A sharing violation occurred.

Hope this will shed some light on your problem.   Good luck!

Daniel

Other Threads