🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3119

Re: Open cmd.exe from shortcut, execute command

#3119
From: Jonathan Benedicto
Date: Sat, 14 Oct 2006 22:53
21 lines
1602 bytes
vortic wrote:
>I have a VCL form application, and on a button onClick Event, I want to 
>open a shortcut (CmdShortcut) pointing to cmd.exe, and run some command 
>window application (SomeApp.exe) within the command window. I have no idea 
>how to do this because I can't seem to use the online help very 
>effectively. I can't even figure out how to execute any app or get a 
>command line.

You can either use ShellExecute or CreateProcess.

Eg:

ShellExecute( NULL, "open", "myapp.exe", "", NULL, SW_SHOWDEFAULT );

> p.s. Should have I posted this to cppbuilder.language.cpp ??

No, this is the correct group.

HTH

Jonathan 
Technical Details
Message-ID: <45316a45$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4531423c$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c75cbeeeafb4b920
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Jonathan Benedicto" <invalid@nobody.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4531423c$1@newsgroups.borland.com>
Subject: Re: Open cmd.exe from shortcut, execute command
Date: Sat, 14 Oct 2006 18:53:00 -0400
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 69.192.226.107
Message-ID: <45316a45$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1160866373 69.192.226.107 (14 Oct 2006 15:52:53 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail