Computing.Net > Forums > Windows Server 2003 > execute OS calls from a script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

execute OS calls from a script

Reply to Message Icon

Name: Martin Dutton
Date: December 3, 2004 at 01:33:57 Pacific
OS: Windows Server 2003
CPU/Ram: Dual Xeon 3.2 & 2GB RAM
Comment:

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



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Windows Server 2003 Forum Home


Sponsored links

Ads by Google


Results for: execute OS calls from a script

Is that virus or a script! Plz Help www.computing.net/answers/windows-2003/is-that-virus-or-a-script-plz-help/7541.html

cant stream video from a 2K Server www.computing.net/answers/windows-2003/cant-stream-video-from-a-2k-server/1027.html

Booting from A: in Server2003 www.computing.net/answers/windows-2003/booting-from-a-in-server2003/1430.html