Home > Back-end >  I am a rookie to shellexecute some of the problems
I am a rookie to shellexecute some of the problems

Time:09-28

Colleagues write an exe in CMD, I want to open it and write some commands,
ShellExecute (handle, the 'open', 'C: \ Documents and Settings \ \ Administrator \ \ desktop the ADB, ADB. Exe', 'the ADB push D: \ \ METERS meter reading DBF D: \ meter 2', ' ', SW_SHOWNORMAL);
I finished writing his program can open, but the one that the adb push command I write, want to ask next is how to return a responsibility

CodePudding user response:

ShellExecute function is to run an external program (or open a registered file, open a directory, print a document, etc.), and external application has certain control,

CodePudding user response:

Paths:='D: \ delphi_pas \ db \ Win32 \ Debug \ XXX. Exe';
Is used in delphi7 Pchar
WinExec (PAnsiChar (AnsiString (paths), SW_NORMAL);

//here is in Delphi xe, below is the key parameter of type conversion problem;

/ShellExecute (0, the 'open', PWideChar (WideString (paths), nil, nil, SW_NORMAL);

CodePudding user response:

Try this
 if WinExec (' "C: \ Documents and Settings \ \ Administrator \ \ desktop the ADB, ADB. Exe" ADB push D: \ \ METERS meter reading DBF D: \ '2 meter reading, SW_SHOW) & lt; 31 then=
ShowMessage (SysErrorMessage GetLastError ());
  • Related