permissions error when calling WScript.Shell and ftp.exe

I'm trying to do some FTP transfers within an ASP page. I'm getting an "access is denied" error on this statement:

set WSX=objShell.Exec("ftp.exe -i -s:D:\folder\tempN5L17ZO1LT.ftp ftp://ftp.domain.com")

I'm rather unfamiliar with WScript.Shell. I'm not sure where the permission problem is. Is it when trying to run ftp.exe itself? I'm not sure how this statement works, for example how does it know where to find ftp.exe?
Brad BansnerWeb DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kevp75Commented:
it's because essentially you are logging into the servers shell as the IUSR_machinename account (which is the anon, IIS user), and by defautl this user has barely any permissions.  In order for this to work for you, you would have to give that user Execute permissions on the ftp.exe file (which generally is not a very good idea to do...)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Brad BansnerWeb DeveloperAuthor Commented:
OK, so if I need to do FTP transactions within ASP, it may be a better idea to install an FTP component program instead of trying to give permissions to FTP.EXE to the anon. user account? I thought it would be nice if I didn't have to install a component to accomplish what I'm trying to do, but I don't want to screw up security either. Thanks!
0
Ted BouskillSenior Software DeveloperCommented:
The Windows FTP service (or any FTP service) is the least secure service available.  Generally when a Windows server is hacked, FTP is the weak link.  If you search there are articles for doing uploads/downloads directly in ASP code without FTP.
0
Brad BansnerWeb DeveloperAuthor Commented:
OK, here is what I'm trying to do, and maybe this isn't the best way, but its all I could figure out for now. I would love to hear any better suggestions.

Files sit in a wwwroot directory and do not have write permissions. There is an FTP account with access to the site, however.

Client logs in to an admin interface, I want them to be able to edit the text files in a browser.

I created a folder outside the wwwroot directory that does have write permissions, but is otherwise inaccessible from browsers (for security).

My idea was to FTP a temporary version of the file into the write permissions folder, do all editing there, then when a "publish" button is clicked, FTP the file back into the wwwroot directory.

I'm basically trying to get around the fact that there are no write permissions on the files, and use the FTP permissions that already exist, instead.
0
Brad BansnerWeb DeveloperAuthor Commented:
Sorry this took so long, thanks for the advice. I decided to install an FTP component instead of using the Windows FTP.exe, so I abandoned the Shell idea altogether. Seems to be working well now.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
OS Security

From novice to tech pro — start learning today.