Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Execute programs

Posted on 2000-04-11
6
Medium Priority
?
260 Views
Last Modified: 2010-04-04
how to execute programs(like notepad, wordpad, paint...)?
0
Comment
Question by:Jurica2505
[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
  • 5
6 Comments
 
LVL 13

Expert Comment

by:Epsylon
ID: 2705425
Try this:

ShellExecute(Handle, 'open', 'notepad', '', '', SW_NORMAL);

ShellExecute(Handle, 'open', 'somefile.txt', '', '', SW_NORMAL);

ShellExecute(Handle, 'open', 'somefile.doc', '', '', SW_NORMAL);


Regards,

Epsylon.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2705456
Forgot to tell to put ShellAPI in the uses clause.

And here's another example:

ShellExecute(Handle, 'open', 'wordpad', 'c:\autoexec.bat', '', SW_NORMAL);


Cheers,

Epsylon.
0
 
LVL 2

Expert Comment

by:saar071697
ID: 2707373
you can try this the other way:

WinExec('notepad.exe',2);

You can replace the 2 at 1 or 0:
0 mean invisible
1 mean minimize
2 mean maximize
0
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.

 
LVL 13

Expert Comment

by:Epsylon
ID: 2885145
Epsylon changed the proposed answer to a comment
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2885146
Uses ShellAPI;

ShellExecute(Handle, 'open', 'notepad', '', '', SW_NORMAL);

ShellExecute(Handle, 'open', 'somefile.txt', '', '', SW_NORMAL);

ShellExecute(Handle, 'open', 'somefile.doc', '', '', SW_NORMAL);

ShellExecute(Handle, 'open', 'wordpad', '', '', SW_NORMAL);

ShellExecute(Handle, 'open', 'paint', '', '', SW_NORMAL);
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 30 total points
ID: 2885147
Uses ShellAPI;

ShellExecute(Handle, 'open', 'notepad', '', '', SW_NORMAL);

ShellExecute(Handle, 'open', 'somefile.txt', '', '', SW_NORMAL);

ShellExecute(Handle, 'open', 'somefile.doc', '', '', SW_NORMAL);

ShellExecute(Handle, 'open', 'wordpad', '', '', SW_NORMAL);

ShellExecute(Handle, 'open', 'paint', '', '', SW_NORMAL);
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Loops Section Overview
Suggested Courses

610 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