Link to home
Start Free TrialLog in
Avatar of Darkkobold
Darkkobold

asked on

DOS style Commands?

This is somewhat of a 2 part question:
First, I want to run a shell command, like
"C:\program files\winamp\winamp.exe /ADD Some.Mp3"
Is there a simple 1 - 2 step to do that?
Also, when I do find first, find next, the list comes up in non-alphabetical order. Can I fix that with out making an array sort func?
Thanx for the help all!
ASKER CERTIFIED SOLUTION
Avatar of Motaz
Motaz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Motaz
Motaz

2.

This is an example of how to sort the list:

procedure TForm1.Button1Click(Sender: TObject);
var
  Rec: TSearchRec;
begin
  FindFirst('c:\*.*', faAnyFile, Rec);
  repeat
    ListBox1.Items.Add(Rec.Name);
  until FindNext(Rec) <> 0;
  FindClose(Rec);
  ListBox1.Sorted:= True;
end;

You can use TStringList instead of ListBox

Motaz
Avatar of Darkkobold

ASKER

Motaz - About to give you more points- Thank you for the help - If you could tho, what are all those params you pass to
ShellExecute(0, 'open', 'C:\program files\winamp\winamp.exe', 'exe /ADD Some.Mp3', nil, sw_Normal);