I'm getting the following error when trying to use cfcompile: "Webroot specified does not exist"
This is the command I've used:
cfcompile –deploy D:\website D:\website\cfcompilein D:\website\cfcompileout
My default website which I would think would be my webroot is defined in IIS as D:\website. I've defined the same path as "\" in CF mappings.
ColdFusion is installed in C:\coldFusion2016
I'm getting the same result on our CF9 installation.
Any idea what I'm doing wrong?
Copy the directory containing the files to be compiled, cfcompilein, to the root, C:\coldFusion2016\cfusion\wwwroot. The cfcompile tool is located in C:\coldFusion2016\cfusion\bin. So open MS DOS and change directories till you get to C:\coldFusion2016\cfusion\bin.
cfcompile -deploy C:\ColdFusion2016\cfusion\wwwroot C:\ColdFusion2016\cfusion\wwwroot\cfcompilein D:\website\cfcompileout
I tried that suggestion and I still get the same error: “Webroot specified does not exist”
I would have thought that the "webroot" would be the path to the default website as defined in IIS, i.e., D:\website, but it doesn't like that either.
Maybe it needs to be defined somehow to Java, e.g. in server.xml, just not sure how. I'm hesitant to touch anything though because CF is working fine and using the default website.
Strange. I wouldn't go looking into server.xml. Instead, I would look at C:\coldFusion2016\cfusion\bin\cfcompile.bat. There is a possible workaround.
Open the cfcompile.bat file in a text editor. Copy all its contents into a new file, which you then save, as MYcfcompile.bat, in the same directory.
Now, locate in MYcfcompile.bat the code the following code excerpt:
Modify this excerpt to
Then run (in DOS):
MYcfcompile -deploy C:\ColdFusion2016\cfusion\wwwroot C:\ColdFusion2016\cfusion\wwwroot\cfcompilein D:\website\cfcompileout
Found the problem. It turns out that the dash in front of -deploy was a long dash not a normal dash. I think I picked up when copying the command line from a web page. So of course the test for "%arg1%"=="-deploy" would always fail. Your suggestion to edit the batch file put me on the right track.
Many thanks for your help.
Aha! What a cracker! Incidentally, if only you had just cut and pasted my first suggestion.
You may wish to report what you have observed as a bug. The error message is itself a ColdFusion bug.
Using the long dash ( –deploy) should produce an error message about the deploy option or about flags in general. Not "Webroot specified does not exist".