July 14th, 2011, 10:08 AM
Script.Shell - Access is denied
I have an asp (jscript) page which will access an ftp site and later process the file. Here is the snippet I'm having issues with:
When running the error message I get is: 'Access is denied'
var objShell = Server.CreateObject("WScript.Shell");
WSX = objShell.Exec("ftp.exe -i -s:C:\path_to_FTP_command_file\ftp_command_file.ftp subdomain.ftpaccount.com");
ReturnCode = WSX.StdErr.ReadAll();
The contents of my FTP command file looks like:
If I run the executed line from the command prompt it works, just not via my asp page This makes me think its a permission problem for my web user to either wscript or ftp.exe, I've tried giving full read/write/execute permissions to the following executable:
dir <-- Not my intended command but I want to siplify it for now
cscript.exe, wscript.exe, ftp.exe
for the following accounts: IUSR_<Machine Name>, IWAM_<Machine Name>, Users
I tried this on our test server and the above fixed sorted it out, but now trying to get it to work on our live system it typically doesn't work. Any suggestions would be appreciated.
Oh and its IIS6 on Windows 2003