Did you try the batch file method I suggested?

For what you're trying to do I think the syntax would be:

C:\encrypt.bat would look like this:

"C:\pgp\pgp.exe -e %1 %2"

test.cfm
<cfset args = arrayNew(1)>
<cfset arrayAppend(args,'O:\temp\abc.txt')>
<cfset arrayAppend(args,'MYTESTKEY')>

<cfexecute name="C:\encrypt.bat" arguments="#args#" timeout="3" />

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 Jon Block
>Sent: Friday, July 02, 2004 9:27 AM
>To: CF-Talk
>Subject: RE: I'm so frustrated - Can somebody make my day? (cfexecute)
>
>What I'm really trying to do is encrypt a file like this:
>
>C:\>C:\pgp\pgp.exe -e O:\temp\abc.txt MYTESTKEY
>
>This command works on the command line... but now matter what
>I've tried, I
>just won't work. I've tried about 25 variations of <cfexecute>
>calls ...
>calling the tag in various ways. I've also tried
><cfx_execute>, but still,
>it doesn't work.
>
>I think that this has to do with the fact that I'm running
>CFMX in command
>line mode... not as a service.
>
>What should I do?
>
>Jon
>
>  _____  
>
>From: Stephen Milligan [mailto:[EMAIL PROTECTED]
>Sent: Friday, July 02, 2004 12:02 PM
>To: CF-Talk
>Subject: RE: I'm so frustrated - Can somebody make my day? (cfexecute)
>
>
>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