Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DOS style Commands?

Posted on 2001-09-07
3
Medium Priority
?
134 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
Motaz earned 600 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

722 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