🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: ShellExecute Error

#12687
From: Remy Lebeau (TeamB)
Date: Thu, 20 Nov 2003 23:50
26 lines
1826 bytes
"George" <george@nospam.org> wrote in message
news:3fbd4eec$1@newsgroups.borland.com...

>    ExecInfo.lpParameters = "--user=root --password=pass --database=data1 >
c:\output.txt";

You're missing a backslash in the filename:

    ExecInfo.lpParameters = "--user=root --password=pass --database=data1 >
c:\\output.txt";

> Everything works fine but that "> output.txt" seems to make it fail.

By fail, are you referring to ShellExecute() itself returning FALSE, or just
that it does succeed but does not produce the file?

> If I put all the command as it is inside a bat file and I execute
> with the above way, everything looks fine.

An alternative would be to use CreateProcess() instead so that you can
provide your own STDOUT and STDERR handles and pipe the output to the
desired file yourself manually.


Gambit
Technical Details
Message-ID: <3fbd525b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!news.webusenet.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!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:10:00 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3fbd4eec$1@newsgroups.borland.com>
Subject: Re: ShellExecute Error
Date: Thu, 20 Nov 2003 15:50:25 -0800
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 67.22.137.149
Message-ID: <3fbd525b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1069371995 67.22.137.149 (20 Nov 2003 15:46:35 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!news.webusenet.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail