For Programmers: Free Programming Magazines  


Home > Archive > ASP > June 2005 > Problem using cmd.exe from asp









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problem using cmd.exe from asp
Derek Timothy

2005-06-10, 3:55 pm

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


Curt_C [MVP]

2005-06-10, 3:55 pm

Derek Timothy wrote:
> 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?

--
Curt Christianson
site: www.darkfalz.com
blog: blog.darkfalz.com
Derek Timothy

2005-06-10, 3:55 pm

Curt,

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

Am I adding permission to the correct account IUSR_ANON?

Best Regards,
Derek




"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:%23zYcCOcbFHA.2900@TK2MSFTNGP15.phx.gbl...
> Derek Timothy wrote:
I[color=darkred]
text[color=darkred]
> just a guess but permission to FTP.EXE?
>
> --
> Curt Christianson
> site: www.darkfalz.com
> blog: blog.darkfalz.com



Curt_C [MVP]

2005-06-10, 3:55 pm

Derek Timothy wrote:
> Curt,
>
> It was worth a try, but ly I get the same problem
>
> Am I adding permission to the correct account IUSR_ANON?
>
> Best Regards,
> Derek
>
>
>
>
> "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
> news:%23zYcCOcbFHA.2900@TK2MSFTNGP15.phx.gbl...
>
>
> I
>
>
> text
>
>
>
>

as a test, try using an admin account as your IIS user...



--
Curt Christianson
site: www.darkfalz.com
blog: blog.darkfalz.com
Derek Timothy

2005-06-10, 3:55 pm

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




"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:eCyyNkcbFHA.3844@tk2msftngp13.phx.gbl...
> Derek Timothy wrote:
When[color=darkred]
> as a test, try using an admin account as your IIS user...
>
>
>
> --
> Curt Christianson
> site: www.darkfalz.com
> blog: blog.darkfalz.com



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com