Solved

DOS style Commands?

Posted on 2001-09-07
3
124 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

12 Experts available now in Live!

Get 1:1 Help Now