Problem using cmd.exe from asp

Discussion in 'ASP General' started by Derek Timothy, Jun 10, 2005.

  1. 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
    Derek Timothy, Jun 10, 2005
    #1
    1. Advertising

  2. Derek Timothy

    Curt_C [MVP] Guest

    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
    Curt_C [MVP], Jun 10, 2005
    #2
    1. Advertising

  3. 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




    "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
    news:%...
    > 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, Jun 10, 2005
    #3
  4. Derek Timothy

    Curt_C [MVP] Guest

    Derek Timothy wrote:
    > 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
    >
    >
    >
    >
    > "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
    > news:%...
    >
    >>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

    >
    >
    >

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



    --
    Curt Christianson
    site: www.darkfalz.com
    blog: blog.darkfalz.com
    Curt_C [MVP], Jun 10, 2005
    #4
  5. 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:...
    > Derek Timothy wrote:
    > > 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
    > >
    > >
    > >
    > >
    > > "Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
    > > news:%...
    > >
    > >>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

    > >
    > >
    > >

    > as a test, try using an admin account as your IIS user...
    >
    >
    >
    > --
    > Curt Christianson
    > site: www.darkfalz.com
    > blog: blog.darkfalz.com
    Derek Timothy, Jun 10, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Achim Domma (Procoders)

    read input for cmd.Cmd from file

    Achim Domma (Procoders), Jun 3, 2005, in forum: Python
    Replies:
    2
    Views:
    8,040
    Peter Otten
    Jun 3, 2005
  2. Sarir Khamsi

    Interpreter-like help in cmd.Cmd

    Sarir Khamsi, Jun 9, 2005, in forum: Python
    Replies:
    4
    Views:
    355
    Bengt Richter
    Jun 26, 2005
  3. =?ISO-8859-1?Q?Sch=FCle_Daniel?=

    [exec cmd for cmd in cmds]

    =?ISO-8859-1?Q?Sch=FCle_Daniel?=, Mar 8, 2006, in forum: Python
    Replies:
    3
    Views:
    371
    Scott David Daniels
    Mar 8, 2006
  4. Diez B. Roggisch

    pydb remote debugging/cmd.Cmd over socket?

    Diez B. Roggisch, May 28, 2008, in forum: Python
    Replies:
    2
    Views:
    539
    Diez B. Roggisch
    May 29, 2008
  5. Sol Linderstein
    Replies:
    3
    Views:
    174
    Matt Garrish
    Jun 18, 2004
Loading...

Share This Page