3

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>
James A Mohler
  • 11,060
  • 15
  • 46
  • 72
illvm
  • 1,336
  • 13
  • 28

2 Answers2

3

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.

illvm
  • 1,336
  • 13
  • 28
2

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

Peter Boughton
  • 110,170
  • 32
  • 120
  • 176
  • Both the IUSR and SYSTEM have read and execute permissions to the file. I am assuming JRun.exe is the web server and it is being run under SYSTEM. I checked in the website settings and the application has execute permissions set to "Scripts and Executables." – illvm Jul 16 '09 at 23:50
  • 1
    Goto Control Panel > Admin > Services, find ColdFusion, right-click>Properties, goto Log on tab. - **that** is the user it's running as and which needs *Windows* level execute permissions, not IIS level permissions. – Peter Boughton Jul 17 '09 at 00:06
  • It's set to Local System account. – illvm Jul 17 '09 at 00:17