Solved

DOS style Commands?

Posted on 2001-09-07
3
125 Views
Last Modified: 2010-04-06
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!
0
Comment
Question by:Darkkobold
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
Motaz earned 150 total points
ID: 6466292
1.

- Add ShellApi to uses clause
- Write ShellExecute(0, 'open', 'C:\program files\winamp\winamp.exe', 'exe /ADD Some.Mp3', nil, sw_Normal);
0
 
LVL 7

Expert Comment

by:Motaz
ID: 6466300
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
0
 

Author Comment

by:Darkkobold
ID: 6466778
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);
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now