Topic: How to pass command In command line

what I want to do is Pass commands directly to command line(cmd). There is "shellexecute" in delphi could not find any similar things here so far i tried openfile('cmd.exe')

What I want is to execute cmd few commands

example (just guessing)

executing "dir" command in cmd

something like => OpenFile('dir','cmd.exe'); so it will execute "dir" command in command-line(cmd) I don't know help me here smile

Re: How to pass command In command line

OpenFile('/K dir','cmd.exe');

/C     Run Command and then terminate

   /K     Run Command and then return to the CMD prompt.
          This is useful for testing, to examine variables

Dmitry.

Re: How to pass command In command line

how can I execute multiple command in single cmd.exe instance

each time when I execute command using open file it used different instance of cmd.

example something like (is it possible?)

OpenFile('/K dir, /k cd..','cmd.exe'); just guessing not sure what to use

Re: How to pass command In command line

Multiple commands separated by the command separator '&' or '&&' are accepted if surrounded by quotes.


OpenFile('/K dir&help','cmd.exe');
Dmitry.