Problem using cmd.exe from asp

D

Derek Timothy

Hi folks I have strange problem using cmd.exe from asp code

I am trying to save the results of an FTP command into a text file. When I
run this command from the command line of the web server it creates the text
file OK and it contains the results of the FTP commands.

ftp.exe -s:test.ftp > c:\tempfile.txt

However when I run it from asp using cmd.exe, it creates the file
c:\tempfile.txt but there is nothing in it.

set oScript=Server.CreateObject("WSCRIPT.SHELL")
oScript.run("cmd.exe /c ftp.exe -s:test.ftp > c:\tempfile.txt")

Any ideas why?

Thanks a lot,

Derek
 
C

Curt_C [MVP]

Derek said:
Hi folks I have strange problem using cmd.exe from asp code

I am trying to save the results of an FTP command into a text file. When I
run this command from the command line of the web server it creates the text
file OK and it contains the results of the FTP commands.

ftp.exe -s:test.ftp > c:\tempfile.txt

However when I run it from asp using cmd.exe, it creates the file
c:\tempfile.txt but there is nothing in it.

set oScript=Server.CreateObject("WSCRIPT.SHELL")
oScript.run("cmd.exe /c ftp.exe -s:test.ftp > c:\tempfile.txt")

Any ideas why?

Thanks a lot,

Derek
just a guess but permission to FTP.EXE?
 
D

Derek Timothy

Curt,

It was worth a try, but sadly I get the same problem

Am I adding permission to the correct account IUSR_ANON?

Best Regards,
Derek
 
C

Curt_C [MVP]

Derek said:
Curt,

It was worth a try, but sadly I get the same problem

Am I adding permission to the correct account IUSR_ANON?

Best Regards,
Derek




I

text


just a guess but permission to FTP.EXE?
as a test, try using an admin account as your IIS user...
 
D

Derek Timothy

Curt,

I don't have the authority to change the admin account, but I think this
problem may because the script file and the file I want to ftp are not on
the web server itself but on a network share. I am pretty sure that the
ISR_ANON has the access rights to the network share but something about
permissions must be wrong.

If I copy the ftp script to the local server then the result file is now
created but it fails to change folder to \\server\share\folder

Once again it runs OK from a command line prompt.

It must be something related to permissions but which ones?

Thanks again.

Best Regards,
Derek




 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top