Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Problem using cmd.exe from asp

Reply
Thread Tools

Problem using cmd.exe from asp

 
 
Derek Timothy
Guest
Posts: n/a
 
      06-10-2005
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


 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      06-10-2005
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
 
Reply With Quote
 
 
 
 
Derek Timothy
Guest
Posts: n/a
 
      06-10-2005
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:%(E-Mail Removed)...
> 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



 
Reply With Quote
 
Curt_C [MVP]
Guest
Posts: n/a
 
      06-10-2005
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:%(E-Mail Removed)...
>
>>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
 
Reply With Quote
 
Derek Timothy
Guest
Posts: n/a
 
      06-10-2005
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:(E-Mail Removed)...
> 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:%(E-Mail Removed)...
> >
> >>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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
send SMS using ASP.NET[1.1], C# using GSM modem connected senthil ASP .Net Mobile 0 10-12-2007 07:17 AM
Drop Downlist using ajax similar to google suggest using ASP ADvantage Javascript 1 05-12-2006 05:29 AM
How to transform xml variable to xsl file using asp.net using vb.net telescient telescient via .NET 247 ASP .Net 1 04-04-2005 02:50 PM
problem creating customized asp reports using asp shovan ASP General 1 08-25-2004 12:06 PM
Using Session cookie to access ASP from within ASP.NET Dax Westerman ASP .Net 0 08-18-2003 07:38 PM



Advertisments