Do it the way I showed you in that other thread. Basically the way to get the CF compiler to not compile CFML instructions which are actually part of a string, rather than code, is to "escape" the tags.
Relevant snippet from other thread:
<cfset sCfO = "<" & "cf">
<cfset sCfC = "</" & "cf">
<cfquery name="qMenus" dbType="query">
#sCfO#menuitem display="#label#" href="#CGI.script_name#?id=#id#" name="sub_#parentId#_#id#">
Where sCfO and sCfC ("CF open" and "CF close") are variables holding "<cf" and "</cf" respectively. So when creating your string, you have "#sCfO#menu" which will contain "<cfmenu".
Ah, I see. Very clever. Thanks. Don't take it personally if I don't copy/paste your code. I like to recode stuff people give me so that I can understand it better and also so it is my own creation.
I am trying to create a CFC that will write a file with CFML in it using code like the following example...
<cffile action="write" file="C:\ColdFusion8\wwwroot\T\test.cfm" output="<cfmenu name=""test"">">
but ColdFusion keeps trying to read what is in the output="". Is there any way to make it so that ColdFusion doesn't try to read the output text as CFML?
There is nothing wrong with the code. Coldfusion will read what is in the output attribute as text, and wont try to execute it.
However, you're copying CFML code to the file, test.cfm, which you save as CFM. Hence, when you open the file in the browser, Coldfusion will run it like it would any other CFM file. Nothing special about that. One solution is to escape the tags, as follows
<cffile action="write" file="C:\ColdFusion8\wwwroot\T\test.cfm" output="#htmleditformat('<cfmenu name=""test"">')"#>