Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
We are having difficulties executing an OS call from an asp script. We have this working fine in 2000 Server but 2003 is giving me some greif.
We have an .asp script that uses SA_FileManager to temporarily switch users to a user account with permissions (administrators permissions for testing purposes) - this seems to be working fine, what we are then trying to do is use the command line to run a GNUPG encyption, but this isnt firing.
On the server in the processes panel we can see that an instance of cmd.exe has been created but that is all that happens.
If we run the GNUPG script from the command line whilst actually on the 2003 Server itself then everything works as expected.
If we change the .asp scrpit to open notepad then in the process panel we can see an instance of cmd.exe and one of notepad.exe (although notepad does not physically open).
Here is the code;
<%
Dim strMachineId, strUserName, strPassword
strMachineId = "Server_Address"
strUserName = "Account_Username"
strPassword = "Account_Password"
set wshell = server.createobject("wscript.shell")
Set objFM = Server.CreateObject("SoftArtisans.FileManager")
'### LOGON TO RUN SCRIPT
objFM.LogonUser strMachineId, strUserName, strPassword, 3
response.write("LOGGED IN
")
response.flush
'strCmd = "%comspec% /c notepad"
strCmd = "%comspec% /c gpg --recipient ""GNUPG_KEY"" --output """&Server.MapPath("../exports/order_200000030.gpg")&""" --encrypt """&Server.MapPath("../exports/order_200000030.txt")&""""
response.write(strCmd)
intReturn = wshell.Run(strCmd,1,true)
Response.Write("
"& intReturn )
'### REVERT BACK TO IUSR
objFM.RevertToSelf
set wshell = nothing
set objFM = nothing
%>note - the /c closes the cmd once everything is done, this happens quickly so when i say that we can see an instance of cmd.exe this is because we have removed '/c' for testing purposes.
We have tried many things (some not very secure) in order to get things going;
Write permissions are set on the 'output' directory (proven by another process that writes files to the same dir).
In IIS we have set all permissions for the site (Script source access, read, write) and have set Execute permissions are set to Scripts and Executables.
In Web Service Extensions i have allowed All Unknown CGI Extensions.
Full permissions have been set on the GNUPG directory.
As i have stated above - we are aware that some of the steps above are unsecure, we have just opened things up to help us troubleshoot this issue, we are logging in using our administrators account which has full privilages (for testing) and we have been at this for over a week now.
And finally just to reiterate - this process works fine on windows 2000 server out of the box with no special permissions/users set or created.
Any help on this will be greatfully received.
Thank you
Martin

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |