Solved

execute dos commands

Posted on 2001-07-16
3
430 Views
Last Modified: 2010-04-06
how can i execute dos commands under Delphi???


thanks

Charles
0
Comment
Question by:CarlosFCD
  • 3
3 Comments
 
LVL 1

Expert Comment

by:AngelFireMateo
ID: 6287174
WinExec(

    LPCSTR lpCmdLine,     // address of command line
    UINT uCmdShow      // window style for new application
   );    
 

Parameters

lpCmdLine

Points to a null-terminated character string that contains the command line (filename plus optional parameters) for the application to be executed. If the name of the executable file in the lpCmdLine parameter does not contain a directory path, Windows searches for the executable file in this sequence:

1.     The directory from which the application loaded.
     2.     The current directory.
     3.     The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
     4.     The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
     5.     The directories listed in the PATH environment variable.

 

uCmdShow

Specifies how a Windows-based application window is to be shown and is used to supply the wShowWindow member of the STARTUPINFO parameter to the CreateProcess function. For a list of the acceptable values, see the description of the nCmdShow parameter of the ShowWindow function. For a non-Windows - based application, the PIF file, if any, for the application determines the window state.

 

Return Values

If the function succeeds, the return value is greater than 31.
If the function fails, the return value is one of the following error values:


winexec('c:\command.com /c dir',SW_SHOWNORMAL     )


i hope this work

Ricardo
0
 
LVL 1

Accepted Solution

by:
AngelFireMateo earned 75 total points
ID: 6287175
WinExec(

    LPCSTR lpCmdLine,     // address of command line
    UINT uCmdShow      // window style for new application
   );    
 

Parameters

lpCmdLine

Points to a null-terminated character string that contains the command line (filename plus optional parameters) for the application to be executed. If the name of the executable file in the lpCmdLine parameter does not contain a directory path, Windows searches for the executable file in this sequence:

1.     The directory from which the application loaded.
     2.     The current directory.
     3.     The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
     4.     The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
     5.     The directories listed in the PATH environment variable.

 

uCmdShow

Specifies how a Windows-based application window is to be shown and is used to supply the wShowWindow member of the STARTUPINFO parameter to the CreateProcess function. For a list of the acceptable values, see the description of the nCmdShow parameter of the ShowWindow function. For a non-Windows - based application, the PIF file, if any, for the application determines the window state.

 

Return Values

If the function succeeds, the return value is greater than 31.
If the function fails, the return value is one of the following error values:


winexec('c:\command.com /c dir',SW_SHOWNORMAL     )


i hope this work

Ricardo
0
 
LVL 1

Expert Comment

by:AngelFireMateo
ID: 6287197
thanks
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Copy file in dll not working but working on exe ! 18 93
code issue 8 132
update joined tables 2 46
Twebbrowser add css to the header 3 25
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question