CFEXECUTE
I am trying to execute a secure copy scp within a CFEXECUTE:
<CFEXECUTE NAME="D:\test\scp"
ARGUMENTS=" -pw mypass D:\test\myfile
myusrname@remoteIP:remotefilename"
OUTPUTFILE="D:\test\myout.txt">
This is running Windows 2000 professional and CF 5.
I can run the scp program from a COMMAND Window fine. It puts
the authentication in the Windows Registry the first time, and
never asks again. For some reason when I call a CF template with
the above code, it does not look in the Registry, but always tries
to confirm the legitimacy of the remote computer. It hangs as a
result.
I am ultimately trying to push files from the server, that
have been selected by a browser, to trusted remote computers using
a secure protocol.
Any help would sure be appreciated!
Joel
I can run the scp program from a COMMAND Window fine.
The process is then running on your machine, within your
security context.
...when I call a CF template with the above code...
Then the process will start running on a remote computer,
hence the remote computer's need for authentication.
Couldn't you use the cfcontent tag? It's much simpler for a
start.
Similar Messages
-
Using cfexecute to execute dos command in windows.
Hi!
Well i have a requirement where i need to check status of
particular service in windows from time to time.
I inferred that we can use cfexecute for this. Well i tried
to use the same but i was not successful in achieving the desired
result.
The following is the code i have written for the above
purpose.
<cfexecute name="sc query Internet Information Services"
arguments="y"
outputfile="d:\Temp\Output.txt"
timeout="90" />
I get the following message:
oldfusion.tagext.lang.ExecuteTag$TimeoutException: Timeout
period expired without completion of sc query Internet Information
Services
at
coldfusion.tagext.lang.ExecuteTag.doStartTag(ExecuteTag.java:170)
at
cfserverchecking2ecfm748178803.runPage(D:\Test\serverchecking.cfm:3)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:147)
at
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:357)
well i have tried using different timeout periods but it dint
work for me.i have gone crazy with it.
Please advice on this.
Many thanks.In addition to Mr Black's suggestions, take a look at these
two entries about using cfexecute on Ben Forta's blog
http://www.forta.com/blog/index.cfm/2006/7/31/Using-CFEXECUTE-To-Execute-Command-Line-Util ities
http://www.forta.com/blog/index.cfm/2006/9/11/A-Couple-Of-CFEXECUTE-Gotchas -
Filename with Umlaut in cfexecute outputFile attribute
Hi,
I'm running CF10 on SLES11 (Linux) and am experiencing a problem when using Filenames with German umlaut characters (ä,ü,ü etc.) for the outputFile attribute. These filenames are mangled in the Linux filesystem, e.g. "Anästhesie" becomes "An?sthesie".
Same thing happens when umlaut characters are used with "cffile action='write'" in the file attribute, so it is not an option to write the output of cfexecute into a variable and then write the content of that variable to a file using the cffile tag.
I'm pretty sure this is a character set encoding problem, but don't know how to solve it. AFAIK, CF10 uses UTF-8 encoding by default, the filesystem uses ISO-8859-15. How can I make CF store the correct filename in the filesystem?
The filenames are the result of a database query and should remain unchanged so the database reference isn't broken. I'd prefer not having to resort to converting the filenames to pure ASCII (e.g. ä -> ae)
before passing them as outputFile attribute.
Regards, Richardhi dany,
actually i escaped the url-string already, not by abap but by the javascript function escape(). but this seems not to work correctly (on ie6), so i changed it to a call of encodeURIComponent(), now it works.
thanks,
norbert -
Cfexecute / ant script not returning results in CF
I've got a batch script that runs an ant script that executes
"cvs log -h application.cfm" on the cvs server.
When I execute the batch script manually on the command line,
everything works fine.
When I execute the batch script via CFEXECUTE, the batch
works fine, the ant script works fine, but the cvs command doesn't
appear to do anything. The results from the tag are:
[echo] before
[echo] after
As you'll see from the attached ant script (unchanged except
for the cvsroot attribute), those echos are either side of the cvs
command.
When running via the command line, I get the results from the
cvs log command in between those lines, but with CF I get nothing.
Any ideas at all on how to get this working will be greatly
appreciated.I'm using 7.01, but I fixed the CFEXECUTE tag by restarting
the CF service twice.
I've also managed to
finally get the CVS bit to work - by changing
:ext: to
:ssh: - which I'm sure I tried before and it wouldn't work,
but it's working now so I'm delighted. -
Using cfexecute to start FMLEcmd.exe
Hi!
I'm trying to use <cfexecute> to start the command line utility to start a fmle session.
Coldfusion is running locally of course not on a remote server :-)
I am trying to use Coldfusion to make a sort of an easy start stop interface for the FMLE.
I could just run it in the command window (cmd.exe), but I'm trying to make it look a bit more "sexy".
So far it is not working out too good I'm affraid :-(
I was wondering if anyone could help.
Here is the code:
<cfexecute name="C:\Program Files (x86)\Adobe\Flash Media Live Encoder 3.2\FMLECmd.exe"
arguments="/p C:\Coldfusion10\cfusion\wwwroot\simpleovp\test.xml"
variable="data"
timeout="10" />
<cfoutput>#data#</cfoutput>
Here is the typical output:
Adobe(R) Flash(R) Media Live Encoder Command Line Utility v 3.2.0.9932 Copyright(C) 2009-10 Adobe Systems Incorporated. All rights reserved. Thu Dec 06 2012 19:12:38 : Audio Settings :- Device : Microphone (USB Audio Device) Format : Mp3 Mono Sample Rate : 22050 Hz Bit rate : 48 Kbps Volume : 75 % Stream to Flash Media Server :- FMS URL : rtmp://flhub0.c07147.cdn.qbrick.com/07147 Backup URL : Stream Name: norstat1,0lfasaud Thu Dec 06 2012 19:12:38 : Selected audio input device: Microphone (USB Audio Device) Thu Dec 06 2012 19:12:38 : FMLE with UID "rtmp://flhub0.c07147.cdn.qbrick.com/07147+norstat1,0lfasaud" is already registered in Shared memory. Please try changing your first output streamname or filename(if not streaming to FMS). Stopping encoding session. Thu Dec 06 2012 19:12:38 : Closing Application.
I thought it might be that cf did not have sufficient user righs to run this properly because the profile is running just fine in a command line window (cmd.exe).
I went in and changed the Log on as in the Coldfusion Application Server service to an account with admin rights, rebboted, but are getting the same result.
Any ideas?
Thanx.
JLet me know If you find a solution.
-
I'm using CF 8 and have a simple script that uses cfexecute to invoke a FoxPro executable that resides on the server. The server is a Windows 7 machine, and when I call the script from the browser I can see the process running in Task Manager but it is hung and doesn't do anything. I have to manually kill it. No errors are being generated that I am aware of - no errors reported in the Event Viewer or in Process Monitor. Coldfusion is running the process under the System account, so I think it should have plenty of privileges. The cfexecute statement is:
<cfexecute name = "C:\Temp\Simple.exe"
arguments = ""
outputfile="c:\temp\Simple.log"
timeout = "30">
</cfexecute>
Any help will be appreciated.You say "System Account" which account is that? I have found that most of the time these issues have to do with permissions, try running the CF Process in an Administrator account and see if that works. Also double check that the running simple.exe from command line works.
I have also found that if it is a program that is designed to run from command line you need to cfexecute cmd rather than the program directly.
<cfexecute name="C:\WINDOWS\system32\cmd.exe" arguments="/c C:\Temp\Simple.exe" variable="return" timeout=30></cfexecute>
<cfoutput>
<pre>
--- Message from Simple.exe----
#return#
--- End Message from Simple.exe----
</pre>
</cfoutput> -
Cfexecute, batch file, and a ftp script
I have a batch file which works fine when entered in at the
command prompt;
C:/temp/mybat.bat
but when I use cfexecute it fails.
Now this may be more of a case of what I am calling than CF
itself.
here is the output:
C:\CFusionMX7\runtime\bin>"C:\Program
Files\Ipswitch\WS_FTP Professional\ftpscrpt" -f
C:\temp\poolsite.scp Processing Line 1 [CONNECT pacmed -p] Finding
Host poolsite... Address lookup of "poolsite" failed. It may be
misspelled, or your computer may not be connected to the network or
Internet. Also check that your DNS and local name servers are
properly configured and responding. Failure in command [CONNECT
poolsite-p] Processing Line 2 [ONSUCCESS SHELL C:/temp/remove.bat]
Set [ONSUCCESS] action to [SHELL C:/temp/remove.bat] Processing
Line 3 [MPUT c:/temp/apptTxfr/*.*] Not Connected Failure in command
[MPUT c:/temp/apptTxfr/*.*] C:\CFusionMX7\runtime\bin>ECHO OFF
the very odd thing, is again, when I call this from a command
line, it works fine.
are there any wrappers or special ways I need to encapsulate
this when using cfexecute?Thank you for the suggestions. The odd thing though, is it
looks like it calling the batch file just fine. It's just that for
whatever reason, the ftp client isn't getting fed the paramters
correctly. Ie
Processing Line 1 [CONNECT poolsite-p] Finding Host
poolsite...
passing -p tells the ftp client to use a prefdefined site
profile (poolsite), instead of using the hostname poolsite.
Basically it is if for whatever reason the ftp program is not
reading it''s scp file correctly when invoked from CF.
I'll check out the permissions and report back.
thanks for the suggestion. -
i am having a little trouble trying to get cfexecute to
create a symbolic link on linux.
i am using the below cfexecute tag to try and mimic what i am
doing from the command line, but no link is made and no output is
received from the cfexecute tag.
i have also tried /bin/ln
am i missing something?
<cfexecute name="ln" arguments="-s /home/.../filename.txt
/home/.../files/test.txt"></cfexecute>
thanks.blst02 wrote:
> i am having a little trouble trying to get cfexecute to
create a symbolic link
> on linux.
>
> i am using the below cfexecute tag to try and mimic what
i am doing from the
> command line, but no link is made and no output is
received from the cfexecute
> tag.
>
> i have also tried /bin/ln
>
> am i missing something?
>
> <cfexecute name="ln" arguments="-s
/home/.../filename.txt
> /home/.../files/test.txt"></cfexecute>
Make sure that the user CF is running as has enough rights on
the
destination directory (su to that user and try ln from that
account).
Mack -
I am trying to incorporate a cfexecute before running a
cfquery. We do not have MS Access loaded on our web server but the
cmd file basically opens MS Access, runs a macro and then closes MS
Access but it is working.
Following is the cmd file - "C:\Program Files\Microsoft
Office\Office10\msaccess.exe"
d:\inetpub\wwwroot\\departments\NBProdReports.mdb /x mDoTimeRecords
It does not run the .cmd file so that the macro runs. Any
suggestions?In addition to Mr Black's suggestions, take a look at these
two entries about using cfexecute on Ben Forta's blog
http://www.forta.com/blog/index.cfm/2006/7/31/Using-CFEXECUTE-To-Execute-Command-Line-Util ities
http://www.forta.com/blog/index.cfm/2006/9/11/A-Couple-Of-CFEXECUTE-Gotchas -
CF10 enterprise - how to disable cfexecute for all sites (sandbox)
Hello,
I have a new CF10 server which I will be using as shared hosting for my clients.
I would like to disable the following tags and functions globally:
TAGS
CFCONTENT
CFFILE
CFDIRECTORY
CFEXECUTE
CFOBJECT
CFREGISTRY
FUNCTIONS
GetProfileString
SetProfileString
CreateObject
I know in CF10 Standard I can block these for all sites using 'resource security', this will stop these tags from running at all.
In CF10 Enterprise I have the option to create multiple sandboxes, but is it possible to create one global sandbox for all sites?
My directory structure looks like:
D:\sites\site1
D:\sites\site2
D:\sites\site3
Can I create a sandbox disabling the above tags and functions just for D:\sites and all subfolders?
I have tried but it does not seem to work - I have a sandbox setup for D:\sites with the above tags and functions disabled, but using a test script I can still use cfexecute in site1 to execute netstat.
I do not wish to create a sandbox for each site as when new sites are added I would need to manually add a sandbox each time.
If anyone has any ideas it would be most appreciated.
Cheers
Luke
( I have asked this in a different place on the CF forums as got no response, i think because I placed it in the wrong place. Sorry if this double post upsets anyone but I need some help!)D:\sites\site1
D:\sites\site2
D:\sites\site3
If you define the sandbox to sites folder, then the settings also apply to sub-directories (as the sub directories will inherit the property from parent).
It is working at my end perfectly fine.
HTH
Thanks
VJ -
Execute bat file with cfexecute
Hello,
this is a newbie question but I'm stuck. I have a .bat that
runs fine through the command prompt but won't run with
<cfexecute>, it merely seems to read the .bat but not execute
it. The .bat reads:
java -classpath
".;C:\CFusionMX7\wwwroot\i-recall\javaClasses\GATE-3.1\bin\gate.jar"
AnnieAPI
When I run <cfexecute
name="C:\CFusionMX7\wwwroot\i-recall\javaClasses\GateClasspathRun.bat"
variable="myVar" timeout="100">
</cfexecute>
The output looks like this:
C:\CFusionMX7\runtime\bin>java -classpath
"C:\CFusionMX7\wwwroot\i-recall\javaClasses\GATE-3.1\bin\gate.jar"
AnnieAPI
It simply reads it and doesn't execute the java AnnieAPI
command. I didn't write this .bat file so maybe I need to add
something to make it run. Any help is appreciated.
-Kalen GSame thing, just without the classpath in the output:
C:\CFusionMX7\runtime\bin>java AnnieAPI
Even if I remove the class path and simply leave java
AnnieAPI it doesn't run. It should get an error message without the
classpath or something but I don't And the page loads so quickly
it's obvious that Coldfusion is just reading the code and not
executing it.
Thanks -
CFexecute, cfx_consolecommand dos/bat file error
Good day all. i have a really confussing problem... Let me
break it down
I have written an application that requires barcodes. My
Printer is a PPLB printer (not really important). So i create a
file on the server (This is about all that works fine).....
The printer is a network printer. so on the server i set up
the capture " net use LPT2
\\<machinename>\\<printersharename> /persistent:yes
(What the above does for those that do not know is set up a
vitual printer port so if you print to lpt2 it goes to the network
printer)
The command works perfectly..... Now the only thing i have to
do is send the file to the printer....
If im on the server and type "COPY /B c:\filetosend LPT2: "
note the Colon after LPT2 must be there it works perfectly.
But from anything else it doesnt..
What i have tried:
1) I tried running the command via cfexecute and
CFX_consolecommand which is available at
www.intrafoundation.com
that however does not work
2) Thinking i was smart i decided to write a bat file....
Easy. I wrote the file then used cfexecute and consolecommand to
run the file. With output enabled The error says "File Not Found"
This i have checked the file is there and LPT port is setup.
As i said if i type the command in command prompt it works
perfectly.
Now just to through another spanner in the works. if i run
the bat file from double clicking in windows or in command propt
type print.bat. (the name of the bat file i created) it works
perfectly..... Can someone explain this
So what i have determined is that:
1) When i type the command or run the bat file from command
prompt it works.
2) It does not work via cfexecute or commandconsole.
With some more testing If i leave the colon out after LPT2 it
says "0 Files Copied" so i think the colon is giving the problem...
Any help would be appreciated with this regard....
Another program maybe etc
RegardsShapeShift,
Are you running the batch file or the dos command while
logged in as the
same user ColdFusion service is configured to run under? If
ColdFusion
is running under the default "Local System" account, try
turning on the
"Allow service to interact with the desktop" checkbox on the
"Log On"
tab for the ColdFusion service, or set the service to log in
with an
account you know has permissions to the remote printer.
HTH,
Carl
ShapeShift wrote:
> Good day all. i have a really confussing problem... Let
me break it down
>
> I have written an application that requires barcodes. My
Printer is a PPLB
> printer (not really important). So i create a file on
the server (This is about
> all that works fine).....
>
> The printer is a network printer. so on the server i set
up the capture " net
> use LPT2 \\<machinename>\\<printersharename>
/persistent:yes
>
> (What the above does for those that do not know is set
up a vitual printer
> port so if you print to lpt2 it goes to the network
printer)
> The command works perfectly..... Now the only thing i
have to do is send the
> file to the printer....
>
> If im on the server and type "COPY /B c:\filetosend
LPT2: " note the Colon
> after LPT2 must be there it works perfectly.
> But from anything else it doesnt..
>
> What i have tried:
> 1) I tried running the command via cfexecute and
CFX_consolecommand which is
> available at
http://www.intrafoundation.com
that however does not work
>
> 2) Thinking i was smart i decided to write a bat
file.... Easy. I wrote the
> file then used cfexecute and consolecommand to run the
file. With output
> enabled The error says "File Not Found" This i have
checked the file is there
> and LPT port is setup.
>
> As i said if i type the command in command prompt it
works perfectly.
>
> Now just to through another spanner in the works. if i
run the bat file from
> double clicking in windows or in command propt type
print.bat. (the name of the
> bat file i created) it works perfectly..... Can someone
explain this
>
> So what i have determined is that:
> 1) When i type the command or run the bat file from
command prompt it works.
> 2) It does not work via cfexecute or commandconsole.
>
> With some more testing If i leave the colon out after
LPT2 it says "0 Files
> Copied" so i think the colon is giving the problem...
>
> Any help would be appreciated with this regard....
> Another program maybe etc
>
> Regards
>
>
> -
First let me say that I am a novice when it comes to Powershell and cfcexecute, though I've been using CF on and off since version 4.
I have a PowerShell/Migration shell console file script that updates email passwords on our MSOnline instance. It works fine if I run it from the run or command line in Windows, but from cfexecute in Coldfusion 9.0.1 it times out. If I set the timeout to 0 the timeout is ignored, but I'll have no idea if it ran. The odd thing is that the code actually does its job, but it leaves both the cmd.exe and powershell.exe processes running and I never get a return code regardless of how long I set the timeout. I have tried all of the /c, 2>$1, exit code, etc., I could find, but none of them seem to work.
I have also tried running the console script from a bat file and directly running Powershell command, but I get the same result when using cfexecute. Besides being over 87MB per instance Powershell, I really don't want to leave a bunch of orphaned processes running.
I'm sure there are better ways of doing this. Any thoughts would be appreciated.
Thanks,
ByronTry the tip from James in the comments of this Ben Forta entry. ie Add the "-inputformat none" paramater.
ie
<cfexecute name="c:\path\to\powershell.exe"
arguments="-inputformat none c:\path\tosomeFile.ps1"
/> -
Execute .bat file using cfexecute tag...
Hello,
I am trying to execute a batch file using cfexecute tag. This
batch file needs 1 command line arguement, which I am passing using
arguments
Text attribute.
When I run my batch file directly from command prompt, it
works perfectly. but while using cfexecute, it doesn't seem to do
anything.
Note:- I am trying to encrypt a txt file using GPG algorithm
in the batch file.
Thanks in advance!
ManjuHello,
you have probally worked this out but if any of this helps :)
I run an application that needs to print via dos command, so
my cfm page makes a batch file writes some arguments to it then
calls it with a cmd. the code is below if any of it helps im glad.
(creates name for my bat file)
<cfset BFname = '#namevariable#' & '.bat'>
(sets up the text I need in the bat file)
<cfset content = 'copy
"c:\inetpub\wwwroot\mct\picklist.txt"
\\MyPrintServer\ThePrinter'>
(writes the bat file with the text in the content var)
<cffile action="write"
file="c:\inetpub\wwwroot\mct\#BFname#" output="#content#">
(calls cmd to run the bat file)
<cfexecute name="c:\windows\system32\cmd.exe"
arguments="/c c:\inetpub\wwwroot\mct\#BFname#"
outputfile="c:\inetpub\wwwroot\mct\log_output.txt"
timeout="1"></cfexecute>
Regards Guy -
Cfexecute a Perl script.
What would I be looking at to run a Perl script at
d:/path/to/my/perl/loader.pl %year% with a
<cfexecute...> tag?
I've tried to do it directly:
<cfexecute
name="d:\path\to\my\perl\loader.pl"
arguments="#year#"
variable="goodbar"
errorvariable="foobar"/>
I've tried to do it through cmd.exe:
<cfexecute
name="c:\windows\system32\cmd.exe"
arguments="d:\path\to\my\perl\loader.pl #year#"
variable="goodbar"
errorvariable="foobar"/>
I've tried calling perl.exe:
<cfexecute
name="e:\Perl\bin\perl.exe"
arguments="d:\path\to\my\perl\loader.pl"
variable="goodbar"
errorvariable="foobar"/>
I am not having much luck with this. The weird thing is that
I am not
getting any results OR errors. Just nothing.
This is a Windows 2003/CF 8.0.1 server.Azadi wrote:
> see if this may be of help in your case:
>
http://www.indigostar.com/perl2exe.htm
>
> otherwise, isn;t there a perl.exe in a win installation?
>
I'll take a look at that if I get desperate enough. But yes
there is a
perl.exe on my windows installation. I can easily run the
script from
the command line. I am trying to run it from ColdFusion since
I have
added a process that runs before the Perl script and I just
want to fire
off the Perl code when the ColdFusion code is completed.
Maybe you are looking for
-
Error Message For BISystemUser: User not authenticated
We have migrated from DEV to PROD env.(11.1.1.1 -> 11.1.1.3). Along problems with bipublisher - there are some strange thingths: we successfully loging using weblogic account into AdminConsole и Enterprise Manager, but in Answers we get an error: inv
-
Hello, I have one query on Scheduling agreement. Let say i have created a scheduling agreement for material 1234 and vendor xyz and other deatils like quantity etc. After some time i changed the quantity from 100 to 200 and also changed the purchasin
-
LMS 4.2, Duplicate event in DFM
Hi all !! Recently we have migrated to LMS 4.2.3 before 1 month. In 4.2 I observed for any operationally down interface, duplicate events are appearing with new time stamp periodically. As per my knowledge an "Operationally down" event reap
-
Enable CMSS-3D with 5.1 Surround Sound Headphon
Hey everyone I heared of a post or something on another site that a creative rep or soemthing said that you should have CMSS-3D off when you have the X-FI configured for 5. speakers. Is this true? I did a search of the forums and didnt find an answer
-
How to fix 11.2.2 spinning ball crashing issue when connecting a device
Hope this helps as it did for me, delete the sync services folder and bingo, the ball went away and my device connected instantly !! This fix of deleting the SyncServices folder is for Mac systems. From your desktop / finder, click the "Go" menu at t