I don't think that will work either.

I've found that cmd.exe doesn't play well with CFMX. I'm not quite sure why,
but it could have something to do with it being a shell for other commands.

What exactly was it that you wanted to do with cfexecute?

The example you gave doesn't look like it does anything useful, so I'm
assuming you were using it to try to get the command line working.

If you really do need to use echo, you can use cfexecute to run a batch file
and pass the arguments to that.

For some reason that seems to work, but directly accessing cmd.exe doesn't.

I've also found that passing arguments as an array usually works better than
passing them as a string, so you would have something like this:

<cfset args = arrayNew(1)>

<cfset arrayAppend(args,'1234')>

<cfset arrayAppend(args,'jonyay.txt')>

<cfexecute name="c:\echo.bat" arguments="#args#" timeout="10" />

And put this in echo.bat

echo %1 > %2

You'll probably want to put a full path to the output file, because
otherwise it will end up somewhere inside the ColdFusion directories
JRun\bin on my machine

HTH

Spike

--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk

Do you cfeclipse? http://cfeclipse.tigris.org


>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of Dave Watts
>Sent: Friday, July 02, 2004 7:42 AM
>To: CF-Talk
>Subject: RE: I'm so frustrated - Can somebody make my day? (cfexecute)
>
>> This is on a machine with windows 2003 server ... we're
>> currently running CF in command line mode... here's what's
>> ruining my day... please help...
>>  
>>  <cfexecute name="echo 1234 > jonyay.txt" timeout="10" />
>
>The program you want to run is cmd.exe. The "echo" command is
>part of the
>command processor itself.
>
>So, you might try something like this:
>
><cfexecute name="c:\windows\system32\cmd.exe" arguments="echo 1234 >
>jonyay.txt" ...>
>
>Personally, I usually screw CFEXECUTE commands up the first
>time I try them,
>so I may have done the same above as well.
>
>Dave Watts, CTO, Fig Leaf Software
>http://www.figleaf.com/
>phone: 202-797-5496
>fax: 202-797-5444
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to