CFExecute of jsmin fails

1.3k views Asked by At

I am trying to minify some files in a roll-up script using jsmin. This works just fine on my local machine but when pushed to production it doesn't work at all. I am running the built-in CF development server locally and IIS on production. Not really sure how I should go about debugging this. Here is a relevant code snippet:

    <cfset LOCAL.args = '/c "C:\Inetpub\wwwroot\jsmin.exe < #LOCAL.jsfile#"'>
    <cfexecute name="c:\windows\system32\cmd.exe"
               arguments="#LOCAL.args#"
               timeout=10
               variable="LOCAL.jsmin">              
    </cfexecute>
2

There are 2 answers

0
illvm On BEST ANSWER

I think the issue was with trying to run a 32-bit executable under a 64-bit OS, but I am not entirely sure. I couldn't get a good C compiler on my machine so I ended up getting the Java source for JSMin and running it using ColdFusion's JRE. That made it work.

3
Peter Boughton On

As Henry says, first thing to check is permissions.

What user is the CF service running as? Does that user have permission to access both cmd.exe and jsmin.exe ?

etc