Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 28th, 2007, 08:47 PM
Authorized User
 
Join Date: Apr 2004
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default Executing Third Party Program from .NET

Hi,
I have been using System.Diagnostics.ProcessStartInfo class to execute cmd.exe which run non-Window commands such as pscp.exe to transfer file. My problem is that I need to pass value to the pscp.exe command when it prompt for input.
Code:
 '**start the process
        Dim myProcess As System.Diagnostics.Process = System.Diagnostics.Process.Start(myProcessStartInf o)

        '**For reading output
        Dim myOutput As System.IO.StreamReader = myProcess.StandardOutput

        '**Instantiate standard input and writer
        Dim myInput As System.IO.StreamWriter = myProcess.StandardInput

        Dim inputError As System.IO.StreamReader = myProcess.StandardError
        myInput.Flush()
        '***Execute pscp.exe to list file
        myInput.WriteLine("pscp -ls -pw password user@server:c:\")
  '**Expecting a prompt and I need to answer Y here...does not work..just hang because it does not return to command prompt.
        myInput.WriteLine("y")

        '**exit cmd
        myInput.WriteLine("exit")

Any idea or better process that I could/should use?

Thanks!

Peter
__________________
Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
executing a jsp program on tomcat server sushant2002 JSP Basics 2 August 28th, 2007 10:54 PM
Executing a java program from an ASP page Anirban Dhar Classic ASP Professional 1 July 2nd, 2006 10:58 AM
Executing External Applications(.net) pkgonline .NET Web Services 0 February 21st, 2005 09:34 AM
Executing an external program. saint VB.NET 2002/2003 Basics 3 July 22nd, 2003 08:30 PM
Third party program library method calls invocatio yeeck VB Components 0 June 20th, 2003 01:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.