🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: ShellExecute Error

#12690
From: Bob Gonder
Date: Thu, 20 Nov 2003 00:31
22 lines
1873 bytes
George wrote:

>Hi I want to execute the following command
>
>mysqldump.exe --user=root --password=pass --database=data1 > c:\output.txt
>
>Everything works fine but that "> output.txt" seems to make it fail. If I

The ">" is a redirection command.
Redirection is detected/started by the command proccessor.
You are not executing the command processor.

You could use
system( "mysqldump.exe --user=root --password=pass "
			" --database=data1>c:\\output.txt");

Or you could find the "COMSPEC" value in the environment, and execute
that with  "\\C mysqldump.exe --user=root --password=pass
--database=data1 > c:\\output.txt"

Or, you could set up your own redirection file/handle, and use
CreateProcess() which allows redirection.
Technical Details
Message-ID: <k42orvgo0cuq8t40gna3l1u57oklbuk107@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!ptdnetS!newsgate.ptd.net!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3fbd4eec$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,9b656969a1fc70df
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-11-20 16:40:56 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: ShellExecute Error
Date: Wed, 19 Nov 2003 16:31:25 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <k42orvgo0cuq8t40gna3l1u57oklbuk107@4ax.com>
References: <3fbd4eec$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.31.164.75
X-Trace: newsgroups.borland.com 1069374714 67.31.164.75 (20 Nov 2003 16:31:54 -0700)
Lines: 23
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news-out1.nntp.be!propagator2-sterling!news-in-sterling.newsfeed.com!ptdnetS!newsgate.ptd.net!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail