473,813 Members | 3,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Process.Start vs. Command line syntax

I'm trying to programatically run an app.
The command line syntax is:
"C:\Program Files\WinSCP3\W inSCP3.exe" -script=myscript .txt
and it works as intended.
In code, I have this
Dim myProc As Process = New Process()

myProc.StartInf o.FileName = "C:\Program Files\WinSCP3\W inSCP3.exe"
I've also tried """C:\Progr am Files\WinSCP3\W inSCP3.exe"""

myProc.StartInf o.Arguments = "-script=myscript .txt"

myProc.Start()

This doesn't work and doesn't produce an error.

What am I doing wrong?

thanks

Kevin Vogler
Aug 29 '08 #1
7 2100
On Aug 29, 11:59 pm, "Kevin Vogler" <kvog...@phoeni xgrouppos.com>
wrote:
I'm trying to programatically run an app.
The command line syntax is:
"C:\Program Files\WinSCP3\W inSCP3.exe" -script=myscript .txt
and it works as intended.

In code, I have this
Dim myProc As Process = New Process()

myProc.StartInf o.FileName = "C:\Program Files\WinSCP3\W inSCP3.exe"
I've also tried """C:\Progr am Files\WinSCP3\W inSCP3.exe"""

myProc.StartInf o.Arguments = "-script=myscript .txt"

myProc.Start()

This doesn't work and doesn't produce an error.

What am I doing wrong?

thanks

Kevin Vogler
Try this:

Dim p As New Process
Dim info As New ProcessStartInf o _
("C:\Program Files\WinSCP3\W inSCP3.exe", _
"-script=myscript .txt")
p.Start(info)
Hope it works,

Onur Güzel
Aug 29 '08 #2
Process.Start(" C:\Program Files\WinSCP3\W inSCP3.exe",
"-script=myscript .txt")

"kimiraikko nen" <ki************ *@gmail.comwrot e in message
news:81******** *************** ***********@k37 g2000hsf.google groups.com...
On Aug 29, 11:59 pm, "Kevin Vogler" <kvog...@phoeni xgrouppos.com>
wrote:
>I'm trying to programatically run an app.
The command line syntax is:
"C:\Program Files\WinSCP3\W inSCP3.exe" -script=myscript .txt
and it works as intended.

In code, I have this
Dim myProc As Process = New Process()

myProc.StartIn fo.FileName = "C:\Program Files\WinSCP3\W inSCP3.exe"
I've also tried """C:\Progr am Files\WinSCP3\W inSCP3.exe"""

myProc.StartIn fo.Arguments = "-script=myscript .txt"

myProc.Start ()

This doesn't work and doesn't produce an error.

What am I doing wrong?

thanks

Kevin Vogler

Try this:

Dim p As New Process
Dim info As New ProcessStartInf o _
("C:\Program Files\WinSCP3\W inSCP3.exe", _
"-script=myscript .txt")
p.Start(info)
Hope it works,

Onur Güzel
Aug 29 '08 #3
Thanks for the quick response.

That doesn't work also.

Maybe I've got this screwed up.

I've been running the command line from the Run command not a terminal
window. Does that make a difference.

Thanks
Kevin
"kimiraikko nen" <ki************ *@gmail.comwrot e in message
news:81******** *************** ***********@k37 g2000hsf.google groups.com...
On Aug 29, 11:59 pm, "Kevin Vogler" <kvog...@phoeni xgrouppos.com>
wrote:
I'm trying to programatically run an app.
The command line syntax is:
"C:\Program Files\WinSCP3\W inSCP3.exe" -script=myscript .txt
and it works as intended.

In code, I have this
Dim myProc As Process = New Process()

myProc.StartInf o.FileName = "C:\Program Files\WinSCP3\W inSCP3.exe"
I've also tried """C:\Progr am Files\WinSCP3\W inSCP3.exe"""

myProc.StartInf o.Arguments = "-script=myscript .txt"

myProc.Start()

This doesn't work and doesn't produce an error.

What am I doing wrong?

thanks

Kevin Vogler
Try this:

Dim p As New Process
Dim info As New ProcessStartInf o _
("C:\Program Files\WinSCP3\W inSCP3.exe", _
"-script=myscript .txt")
p.Start(info)
Hope it works,

Onur Güzel
Aug 29 '08 #4
Kevin Vogler wrote:
I'm trying to programatically run an app.
The command line syntax is:
"C:\Program Files\WinSCP3\W inSCP3.exe" -script=myscript .txt
and it works as intended.
In code, I have this
Dim myProc As Process = New Process()

myProc.StartInf o.FileName = "C:\Program Files\WinSCP3\W inSCP3.exe"
I've also tried """C:\Progr am Files\WinSCP3\W inSCP3.exe"""

myProc.StartInf o.Arguments = "-script=myscript .txt"

myProc.Start()

This doesn't work and doesn't produce an error.

What am I doing wrong?

thanks

Kevin Vogler
What do you mean when you say that it "doesn't work"? What happens, and
how does that differ from what you expect?

--
Göran Andersson
_____
http://www.guffa.com
Aug 30 '08 #5
Thanks for the response.
When I put that command in Start/Run it runs a script that places a file in
a folder via SFTP.

When I put that command in a sub in a vb.net windows app and run it, nothing
happens. No file, no errors thrown.

At this point the myscript.txt file is in the same directory as the
WinSCP3.exe. Do I have to give the absolute path to the myscript.txt since
my app is now running out of my debug folder of my windows app as opposed to
program I'm calling?

I can't try this at the moment because I'm not in the office.

Thanks
Kevin Vogler

"Göran Andersson" <gu***@guffa.co mwrote in message
news:ub******** ******@TK2MSFTN GP03.phx.gbl...
Kevin Vogler wrote:
>I'm trying to programatically run an app.
The command line syntax is:
"C:\Program Files\WinSCP3\W inSCP3.exe" -script=myscript .txt
and it works as intended.
In code, I have this
Dim myProc As Process = New Process()

myProc.StartIn fo.FileName = "C:\Program Files\WinSCP3\W inSCP3.exe" I've
also tried """C:\Progr am Files\WinSCP3\W inSCP3.exe"""

myProc.StartIn fo.Arguments = "-script=myscript .txt"

myProc.Start ()

This doesn't work and doesn't produce an error.

What am I doing wrong?

thanks

Kevin Vogler

What do you mean when you say that it "doesn't work"? What happens, and
how does that differ from what you expect?

--
Göran Andersson
_____
http://www.guffa.com

Aug 30 '08 #6
Kevin Vogler wrote:
I'm trying to programatically run an app.
From where? What /sort/ of process?
The command line syntax is:
"C:\Program Files\WinSCP3\W inSCP3.exe" -script=myscript .txt
and it works as intended.
In code, I have this
Dim myProc As Process = New Process()
myProc.StartInf o.FileName = "C:\Program Files\WinSCP3\W inSCP3.exe"
I've also tried """C:\Progr am Files\WinSCP3\W inSCP3.exe"""
You don't need the quotes - the ProcessStartInf o class will take care of
those for you.
myProc.StartInf o.Arguments = "-script=myscript .txt"
myProc.Start()
Where does that /script/ live? How is WinScp3.exe supposed to find it?

Try setting the .WorkingDirecto ry property as well (to the directory in
which the script resides).
This doesn't work and doesn't produce an error.
If Process.Start couldn't find the .exe, you'd get an error all
right(!), so that bit /must/ be working; I suspect it's just that the
..exe can't find the script.

HTH,
Phill W.
Sep 2 '08 #7
Phil,

Thanks the response. It clarified a few things for me. Part of my problem
was the syntax for a console window vs. the Run dialog. Once I sorted it out
in the console window, I was able to get things to work in code.

Thanks again,

Kevin Vogler
Sep 2 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1777
by: Ryan Walker | last post by:
Hi, I'm getting started with python and have almost zero programming experience. I'm finding that there are tons of tutorials on the internet -- such as the standard tutorial at python.org -- that tell you all about the language. That is, what are the methods, functions, modules, syntax, punctuation, etc. No problem there! Meanwhile, I'm finding that there is very little (that I can find) about how to do basic logistical things related...
18
4897
by: jas | last post by:
Hi, I would like to start a new process and be able to read/write from/to it. I have tried things like... import subprocess as sp p = sp.Popen("cmd.exe", stdout=sp.PIPE) p.stdin.write("hostname\n") however, it doesn't seem to work. I think the cmd.exe is catching it.
10
14428
by: Sorin Dolha [MCSD .NET] | last post by:
I would like to start a process from C# code as another user. The C# code is executed as the ASPNET user because it relies in a Web Page class, and I would like that the process will run as another user to gain the required rights for execution (the external process needs to create a mailbox in Exchange, so it needs to be run as an Exchange Full Administrator-powered user). For the moment, I have tries using the Start() static method of the...
10
15919
by: Tony | last post by:
I am running an application called AcroComm.exe to poll time clocks here at our company. I have written a small C# app that will poll the clocks based on information found in a DB. My problem is that AcroComm will sometimes stop polling in the middle of the process and terminate. The programing manual for the app says that it sends a code to the operating system when it is done that tells what has happend like the following: 0 ...
6
2218
by: danl | last post by:
I need to be able to execute a .bat file from a C# web application I have the following code that compliles and seems to run fine, but the bat file never does it's work =================================== System.Diagnostics.Process p = new Process() p.StartInfo.RedirectStandardOutput=false p.StartInfo.FileName = "C:\\ftp_scripts\\script.bat" p.StartInfo.UseShellExecute=true p.Start() p.WaitForExit() p.Dispose();
0
2191
by: WATYF | last post by:
This is my problem... I have some code that starts a Process and returns it to a variable... (prcBat) At any time while that process is running... I want to be able to Kill it by pressing a command button in the application. So the code goes something like this: psiBat = New ProcessStartInfo(arrRun.Item(0)(1)) psiBat.WindowStyle = ProcessWindowStyle.Hidden
7
7015
by: WALDO | last post by:
I wrote a console application that basically consumes arguments and starts other command line apps via System.Process. Let's call it XCompile for now. I wrote a Visual basic add-in that does pretty much the same thing to XCompile. Let's call it MyAddin. XCompile collects information to send to vbc.exe. When it comes across any arguments that are file paths, it wraps them in quotes. For example: Dim prms As String
1
3771
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a C# application in which I start another process which produces output to stdout and stderr. In fact, that process is the uSoft VS2005 C/C++ compiler itself! I would like to capture the results of the compile and display them in a RichTextBox. The problem I'm having is that when I intentionally introduce an error in the C code I'm compiling, I can't read the error output in my C# program. I've tried redirecting both...
12
2491
by: =?Utf-8?B?ZXAu?= | last post by:
What is preferred method to start an app process and then fill in form fields? The following prog does not compile (b/c AppActivate does not have the correct param): ---------------------------------------------------------------------------------------- Imports Microsoft.VisualBasic Imports System.Windows.Forms Imports System.Diagnostics Module Module1 Sub Main()
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10406
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10420
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10139
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5568
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3029
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.