IIS 7 and Above
not able to execute cmd.exe
Last post Feb 17, 2010 09:35 AM by Harikrishna Nair
Feb 16, 2010 06:05 AM|Harikrishna Nair|LINK
We are using ImageMagick with PHP on Windows 7. None of the ImageMagick commands executed thru PHP scripts are successfully executed (these command inturn use cmd.exe for execution).
We think this might be a permission issue and tried giving IUSR - execute rights to ImageMagick commands (there is one .exe for each command and we are executing all the commands thru shell scripts); but this is failing. We are getting "permission denied"
error whenever we set IUSR - execute rights.
Any help on this will be appreciated.
Feb 16, 2010 09:12 AMfirstname.lastname@example.org|LINK
What user account is attempting to execute the command? Hint: It's not the IUSR account... :)
Filemon will helop you track this.
Feb 16, 2010 09:23 AM|Harikrishna Nair|LINK
Thanks for the reply.
It would be much helpful if you can tell me the exact user. :O
Feb 16, 2010 12:26 PM|don.raman|LINK
You will need to give appropriate permission to CMD.EXE too. This is however not a good practice and is not recommended too. Follow the article at
Feb 16, 2010 12:34 PM|kehand|LINK
By default, processes will be launched under the AppPoolIdentity. You can give this special user privileges needed by going to properties for your content folder and giving privileges to the "IIS AppPool\<Application Pool Name>".
More info here:
Feb 17, 2010 12:28 AM|Harikrishna Nair|LINK
We tried to give both IUSR and DefaultAppPool execute rights to cmd.exe... but it fails (saying that: access denied)
Feb 17, 2010 12:34 AM|Harikrishna Nair|LINK
Are you referring to DefaultAppPool ? If so, we tried giving execute rights to DefaultAppPool on cmd.exe (which fails: access denied) , my php page and to whole ImageMagick folder. But none of these worked.
Feb 17, 2010 01:24 AM|Harikrishna Nair|LINK
We tried giving execute rights to DefaultAppPool on cmd.exe (which fails: access denied) , my php page and to whole ImageMagick folder. But none of these worked. (The rights were given, but the php page still failed to execute the ImageMagick command. The
same page works on Windows XP with IIS 6.
Feb 17, 2010 09:35 AM|Harikrishna Nair|LINK
Thanks for all the help. It was indeed problem of not having assigned DefaultAppPool to the folders and files concerned. Once it was done, the problem was solved.
The later problem was due to my stupidity of wrong file path.