473,504 Members | 13,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Executing another application from one vb.net application

kd
Hi All,

Would anybody be able to post me the command used in vb.net to execute an
application from within the current application?

Thanks.
kd
Nov 21 '05 #1
13 3322
Hi,

Process.Start("C:\MyApp.exe")

Ken
--------------------------
"kd" wrote:
Hi All,

Would anybody be able to post me the command used in vb.net to execute an
application from within the current application?

Thanks.
kd

Nov 21 '05 #2
kd
Thanks

"Ken Tucker [MVP]" wrote:
Hi,

Process.Start("C:\MyApp.exe")

Ken
--------------------------
"kd" wrote:
Hi All,

Would anybody be able to post me the command used in vb.net to execute an
application from within the current application?

Thanks.
kd

Nov 21 '05 #3
kd
Hi Ken,

How are the parameters passed to the exe?

Thanks.
kd

"Ken Tucker [MVP]" wrote:
Hi,

Process.Start("C:\MyApp.exe")

Ken
--------------------------
"kd" wrote:
Hi All,

Would anybody be able to post me the command used in vb.net to execute an
application from within the current application?

Thanks.
kd

Nov 21 '05 #4
KD,

Using the processInfo
http://msdn.microsoft.com/library/de...classtopic.asp

\\\Notepad
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.arguments = "c:\windows\win.ini"
pi.FileName = "notepad.exe"
p.startinfo = pi
p.Start()
///
I hope this helps?

Cor

"kd" <kd@discussions.microsoft.com> schreef in bericht
news:E8**********************************@microsof t.com...
Hi Ken,

How are the parameters passed to the exe?

Thanks.
kd

"Ken Tucker [MVP]" wrote:
Hi,

Process.Start("C:\MyApp.exe")

Ken
--------------------------
"kd" wrote:
> Hi All,
>
> Would anybody be able to post me the command used in vb.net to execute
> an
> application from within the current application?
>
> Thanks.
> kd

Nov 21 '05 #5
kd
Thanks Ligthert.

The arguments for to execute my application contains a switch /S followed by
the argument. The following code however is failing.
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.arguments = "/S testarg"
pi.FileName = "C:\Program files\MyApp\test.exe"
p.startinfo = pi
p.Start()
I am not sure if this is the correct way to pass multiple arguments!

Help is greatly appreciated.

kd

"Cor Ligthert" wrote:
KD,

Using the processInfo
http://msdn.microsoft.com/library/de...classtopic.asp

\\\Notepad
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.arguments = "c:\windows\win.ini"
pi.FileName = "notepad.exe"
p.startinfo = pi
p.Start()
///
I hope this helps?

Cor

"kd" <kd@discussions.microsoft.com> schreef in bericht
news:E8**********************************@microsof t.com...
Hi Ken,

How are the parameters passed to the exe?

Thanks.
kd

"Ken Tucker [MVP]" wrote:
Hi,

Process.Start("C:\MyApp.exe")

Ken
--------------------------
"kd" wrote:

> Hi All,
>
> Would anybody be able to post me the command used in vb.net to execute
> an
> application from within the current application?
>
> Thanks.
> kd


Nov 21 '05 #6
"kd" <kd@discussions.microsoft.com> schrieb:
Would anybody be able to post me the command used in vb.net to execute an
application from within the current application?


\\\
Imports System.Diagnostics
..
..
..
Process.Start("notepad", """C:\Bla Bla\1.txt""")
///

- or -

\\\
Shell("notepad ""C:\Bla Bla\1.txt""", AppWinStyle.NormalFocus)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #7
Kd,

You can always try this from the (DOSbox) commandline.
When it does it like that, than this would do it in my opinion as well as
you wrote it.

Cor
Nov 21 '05 #8
kd
Cor,

The command runs successfully when executed from the command window. But
fails when executed through the vb.net code.

kd

"Cor Ligthert" wrote:
Kd,

You can always try this from the (DOSbox) commandline.
When it does it like that, than this would do it in my opinion as well as
you wrote it.

Cor

Nov 21 '05 #9
And what is the behaviour.

Did you try it with notepad in the same place?
(other arguments of course)

Cor
Nov 21 '05 #10
kd
Cor,

Running notepad is working. Notepad.exe takes just one argument. So, does
IE. I was looking for any application that takes more than one argument,
along with switches, in order to test where the problem lies. If you do come
across any, please post it here, so that I can test it.

Regards.
kd.

"Cor Ligthert" wrote:
And what is the behaviour.

Did you try it with notepad in the same place?
(other arguments of course)

Cor

Nov 21 '05 #11
KD,

I checked it with this program and it did as expected.

\\\
Public Class KDtest
Public Shared Sub main(ByVal args() As String)
If args.Length > 0 Then
If args(0).ToUpper = "\S" Then
MessageBox.Show(args(1))
End If
Else
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.Arguments = "\S Hello"
pi.FileName = "KD"
p.StartInfo = pi
p.Start()
End If
End Sub
End Class
///

I hope this helps?

Cor
Nov 21 '05 #12
"kd" <kd@discussions.microsoft.com> schrieb:
Running notepad is working. Notepad.exe takes just one argument. So, does
IE. I was looking for any application that takes more than one argument,
along with switches, in order to test where the problem lies. If you do
come
across any, please post it here, so that I can test it.


Depending on the application, certain parameter values need to be put
between double quotes, for example, file names containing space characters.
Maybe this is causing your problem.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #13
kd

The application is running successfully now.

Thanks Cor, your assistance was of great help.

kd.

"Cor Ligthert" wrote:
KD,

I checked it with this program and it did as expected.

\\\
Public Class KDtest
Public Shared Sub main(ByVal args() As String)
If args.Length > 0 Then
If args(0).ToUpper = "\S" Then
MessageBox.Show(args(1))
End If
Else
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.Arguments = "\S Hello"
pi.FileName = "KD"
p.StartInfo = pi
p.Start()
End If
End Sub
End Class
///

I hope this helps?

Cor

Nov 21 '05 #14

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

Similar topics

13
2809
by: BK | last post by:
Can someone point me to a code sample that illustrates executing long running tasks (asynchronous) from a web application in ASP.NET? I assume that Web Services might come into play at some point,...
4
12656
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck...
1
3132
by: rvdw | last post by:
Hi All, I've a serious problem with executing stored procedures (SQL2000) from an Access db (version 97). After executing a stored procedure , msaccess hangs. The whole call to the procedure is...
2
9750
by: Tony Liu | last post by:
Hi, I want to get the name of the calling function of an executing function, I use the StackTrace class to do this and it seems working. However, does anyone think that there any side effect...
15
2118
by: Chakkaradeep | last post by:
Hi all, i have written a Service,now i want to execute another application (for eg;calc.exe) in the service....how will i perform it??... i tried using this.... /**************Executing a...
7
5224
by: Jibey | last post by:
Hello: I'm facing a very strange problem. When I run my Web application in Visual Studio.NET the Page_Load event is not executing. Other events like a Button_Click are executing. It doesn't...
3
2156
by: Peter Strøiman | last post by:
Hi. I have a web application that needs to run tasks at regular intervals. E.g. it must send out emails every night to people who subscribe to that service. I have come up with one solution,...
0
1374
by: whidbeywave | last post by:
Hello all, Help me understanding this situtation. While debugging a scenario for error 403.9 on IIS/XP Pro, I added two counters to perfmon app.I saw at some point of time Session Active =0 , but...
1
1740
by: Ryan.Mohammed | last post by:
I have a problem where the code that serializes and deserializes an object is actually not the start application but loaded by reflection and located in a subdirectory of the start application. ...
2
5203
by: Divakar | last post by:
Hi, How can we find which SQL statement is executing when "list application show detail" shows "UOW Executing" against an application. This topic was touched upon earlier by one of the member....
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7366
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...
1
7017
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...
0
7471
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...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1526
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 ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
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...

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.