ASP - Shell Object - Permissions - Arg!

Associate
Joined
28 Nov 2004
Posts
1,237
Location
Birmingham
Hi everyone,
I've searched high and low on Google and I cannot get to the bottom of this.
It's a permissions problem but I don't know exactly where my permissions issue is!
It's driving me bonkers!

The Problem:
I'm trying to open an instance of Wscript.Shell in ASP. It will then run nslookup.exe so i can validate mx records on email addresses.

Code:
FUNCTION MXLookup(host)
SET objShell = CreateObject("Wscript.Shell")
DIM objExec, strResult
SET objExec = objShell.Exec("%comspec% /c nslookup -type=MX "&host)
WHILE objExec.Status <> WshFinished
	 'Wait for the command to be run completely 
WEND 
strResult = objExec.StdOut.ReadAll
Set objExec = Nothing
Set objShell = Nothing
MXLookup = Reflect(strResult)
END FUNCTION

I then get the following error on this line:
Code:
SET objExec = objShell.Exec("%comspec% /c nslookup -type=MX "&host)

WshShell.Execerror '80070005'Access is denied.

I know the error is permissions related (perhaps on the IUSR_<machinename> account) but I don't know what permissions i need to set. I've tried everything and got nowhere :( :(
 
Back
Top Bottom