473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Cannot execute EXE from .Net

Here is my code;

Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.FileName = "C:\WinProg.exe"
System.Diagnostics.Process.Start(psi)

Have tested WinProg.exe and works., However, when called from .Net, EXE doesn't execute.

Any help would be appreciated.

Nov 20 '05 #1
12 1896
* "=?Utf-8?B?Sm9obiBGLg==?=" <John F.@discussions.microsoft.com> scripsit:
Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.FileName = "C:\WinProg.exe"
System.Diagnostics.Process.Start(psi)

Have tested WinProg.exe and works., However, when called from .Net, EXE doesn't execute.


Try 'System.Diagnostics.Process.Start("C:\WinProg.exe" )'. If this
doesn't work, try 'Shell(..., ...)'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Imports System.Diagnostics

Dim NewProcess as Process = new Process

NewProcess.Start("C:\MyApplication.exe")

regards

M. posseth [MCP]

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2j*************@uni-berlin.de...
* "=?Utf-8?B?Sm9obiBGLg==?=" <John F.@discussions.microsoft.com> scripsit:
Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.FileName = "C:\WinProg.exe"
System.Diagnostics.Process.Start(psi)

Have tested WinProg.exe and works., However, when called from .Net, EXE
doesn't execute.
Try 'System.Diagnostics.Process.Start("C:\WinProg.exe" )'. If this
doesn't work, try 'Shell(..., ...)'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #3
* "M. Posseth" <mi*****@nohausystems.nl> scripsit:
Imports System.Diagnostics

Dim NewProcess as Process = new Process

NewProcess.Start("C:\MyApplication.exe")


No! 'Start' is a /shared/ method of 'Process' that will /return/ a
'Process' object.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
I tried....

Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.WorkingDirectory = "C:\"
psi.FileName = "WinProg.exe"
System.Diagnostics.Process.Start(psi)
Shell("c:\WinProg.exe", AppWinStyle.Hide, False, -1)

and .........

Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.WorkingDirectory = "C:\"
psi.FileName = "WinProg.exe"
System.Diagnostics.Process.Start("C:\WinProg.exe")

In both cases WinProg.exe did not execute. However, I opened the Windows Task Manager and WinProg.exe was listed in the 'Processes' window with ASPNET as the 'User Name'.

"Herfried K. Wagner [MVP]" wrote:
* "=?Utf-8?B?Sm9obiBGLg==?=" <John F.@discussions.microsoft.com> scripsit:
Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.FileName = "C:\WinProg.exe"
System.Diagnostics.Process.Start(psi)

Have tested WinProg.exe and works., However, when called from .Net, EXE doesn't execute.


Try 'System.Diagnostics.Process.Start("C:\WinProg.exe" )'. If this
doesn't work, try 'Shell(..., ...)'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #5


I tried....

Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.WorkingDirectory = "C:\"
psi.FileName = "WinProg.exe"
System.Diagnostics.Process.Start(psi)
Shell("c:\WinProg.exe", AppWinStyle.Hide, False, -1)

and......

Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.WorkingDirectory = "C:\"
psi.FileName = "WinProg.exe"
System.Diagnostics.Process.Start("C:\WinProg.exe")

No errors were returned. WinProg.exe failed to execute. However, it was listed as a Process int the Windows Task Manager with ASPNET as the User Name.
"Herfried K. Wagner [MVP]" wrote:
* "=?Utf-8?B?Sm9obiBGLg==?=" <John F.@discussions.microsoft.com> scripsit:
Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.FileName = "C:\WinProg.exe"
System.Diagnostics.Process.Start(psi)

Have tested WinProg.exe and works., However, when called from .Net, EXE doesn't execute.


Try 'System.Diagnostics.Process.Start("C:\WinProg.exe" )'. If this
doesn't work, try 'Shell(..., ...)'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #6
* =?Utf-8?B?Sm9obiBG?= <Jo***@discussions.microsoft.com> scripsit:
Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.WorkingDirectory = "C:\"
psi.FileName = "WinProg.exe"
System.Diagnostics.Process.Start(psi)
Shell("c:\WinProg.exe", AppWinStyle.Hide, False, -1)

and......

Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.WorkingDirectory = "C:\"
psi.FileName = "WinProg.exe"
System.Diagnostics.Process.Start("C:\WinProg.exe")

No errors were returned. WinProg.exe failed to execute. However, it was listed as a Process int the Windows Task Manager with ASPNET as the User Name.


Did you call the executable from within an ASP.NET app? Maybe you will
have to use impersonation to call the executable with an other user's
rights.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #7
Yes - called the EXE from a .Net app running in Debug mode on same computer. Since the process is started, I seem to need a way to activate it(???)

"Herfried K. Wagner [MVP]" wrote:
* =?Utf-8?B?Sm9obiBG?= <Jo***@discussions.microsoft.com> scripsit:
Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.WorkingDirectory = "C:\"
psi.FileName = "WinProg.exe"
System.Diagnostics.Process.Start(psi)
Shell("c:\WinProg.exe", AppWinStyle.Hide, False, -1)

and......

Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.WorkingDirectory = "C:\"
psi.FileName = "WinProg.exe"
System.Diagnostics.Process.Start("C:\WinProg.exe")

No errors were returned. WinProg.exe failed to execute. However, it was listed as a Process int the Windows Task Manager with ASPNET as the User Name.


Did you call the executable from within an ASP.NET app? Maybe you will
have to use impersonation to call the executable with an other user's
rights.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #8
HUH ???? !!!

question was : Cannot execute .exe from .NET

So what is wrong with my answer ???

Please explain ?

Because as you were letting me feel stupid with your big NO ! to this hole
comunity i think i deserve an explanation
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim myproc As System.Diagnostics.Process

myproc = New System.Diagnostics.Process

' Do not receive an event when the process exits.

myproc.EnableRaisingEvents = False

' Start Internet Explorer, passing in a Web page.

myproc.Start("notepad.exe")

End Sub

i would not now anny reasson why this code wouldn`t be valid

As this code is in the field known as the replacement for the shellexecute
API
as this code was recomended as a replacement for the shellexecute api by
ALLAPI.net
as this code appears in MSDN as a valid code to execute external programs or
asociations ( like a web adres or mailto command )

' Start Internet Explorer, passing in a Web page.
myproc.Start("IExplore.exe", http://www.microsoft.com)

your answer

No! 'Start' is a /shared/ method of 'Process' that will /return/ a
'Process' object.
So what ??? does this mean i can`t start a external exe from .net with it ??
cause then i and a few thousand other developers in the world have a special
kind of computer cause on mine it does work flawless
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2j*************@uni-berlin.de... * "M. Posseth" <mi*****@nohausystems.nl> scripsit:
Imports System.Diagnostics

Dim NewProcess as Process = new Process

NewProcess.Start("C:\MyApplication.exe")


No! 'Start' is a /shared/ method of 'Process' that will /return/ a
'Process' object.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #9
"M. Posseth" <mi*****@nohausystems.nl> schrieb
Dim myproc As System.Diagnostics.Process

myproc = New System.Diagnostics.Process

' Do not receive an event when the process exits.

myproc.EnableRaisingEvents = False

' Start Internet Explorer, passing in a Web page.

myproc.Start("notepad.exe")

End Sub

[...]

No! 'Start' is a /shared/ method of 'Process' that will /return/
a
'Process' object.


So what ??? does this mean i can`t start a external exe from .net
with it ?? cause then i and a few thousand other developers in the
world have a special kind of computer cause on mine it does work
flawless

It works, but you
a) never start the process "myproc"
b) ignore the Process object created by myProc.Start
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #10
Hi M. Posseth,

I hate wrong quoting.
No! 'Start' is a /shared/ method of 'Process' that will /return/ a
'Process' object.
Because as you were letting me feel stupid with your big NO ! to this hole comunity i think i deserve an explanation


This is not a Big NO it is a normal No, which starts as the first word of a
sentence and has therefore a capital N.

Your message is in my opinion much more agressive than the one from
Herfried.

When you normal ask something as "Why? are you writing this", than I am sure
that he will sure give your an explanation, for which I am as well very
curious as you.

I have never seen Herfried saying he is perfect.

Cor
Nov 20 '05 #11
* "M. Posseth" <mi*****@nohausystems.nl> scripsit:
HUH ???? !!!

question was : Cannot execute .exe from .NET

So what is wrong with my answer ???


See:

<URL:http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdiagnosticsprocessclassstarttopic3.asp>

'Start' is a shared property of the 'Process' class, so instantiating
doesn't make sense.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #12
Hi,
I've experience the same problem. This happens when I tried to make it works with web application. I'm using VS .net 2003. Suprisingly, When I use Windows application, everything works fine. Anyone can explain why this happens?
Noor

"John F" wrote:
Yes - called the EXE from a .Net app running in Debug mode on same computer. Since the process is started, I seem to need a way to activate it(???)

"Herfried K. Wagner [MVP]" wrote:
* =?Utf-8?B?Sm9obiBG?= <Jo***@discussions.microsoft.com> scripsit:
Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.WorkingDirectory = "C:\"
psi.FileName = "WinProg.exe"
System.Diagnostics.Process.Start(psi)
Shell("c:\WinProg.exe", AppWinStyle.Hide, False, -1)

and......

Dim psi As New System.Diagnostics.ProcessStartInfo
psi.UseShellExecute = True
psi.WorkingDirectory = "C:\"
psi.FileName = "WinProg.exe"
System.Diagnostics.Process.Start("C:\WinProg.exe")

No errors were returned. WinProg.exe failed to execute. However, it was listed as a Process int the Windows Task Manager with ASPNET as the User Name.


Did you call the executable from within an ASP.NET app? Maybe you will
have to use impersonation to call the executable with an other user's
rights.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #13

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

Similar topics

2
by: Joel | last post by:
Hello, ASP does not work locally on my main web site when I browse the machine locally at the console itself, but to the outside world all is fine, and ASP executes normally. I have 4 other...
5
by: M P | last post by:
Hi Team! Hope that you could help me! Its been days since I made this script but I cannot fix the problem! IE is prompting me that there is a Syntax Error but it seems that the syntax is OK! Can...
4
by: frank | last post by:
I posted a question before (to too many groups) and this time I am sending to this group only. I have a quick script as seen below, the file_list table has a unique field called file_name. The...
1
by: Chris | last post by:
I built small C# Web and Web Service applications in a training class last week. The applications worked in the class, but when I tried to run them again over the weekend, they both bombed....
2
by: Ken Allen | last post by:
I have a service that was developed in C# that I wish to debug. The project resides on my desktop system and I wish it to execute on a remote test system (actually on the next desk). When I...
4
by: Chris | last post by:
I posted this in the C# language group, then thought it might be more appropriate in this group. I would not cross-post except I want the answer so badly. I built small C# Web and Web Service...
3
by: Peter Afonin | last post by:
Hello, Our SQL server used to run under System account, and I had no problems executing DTS packages from the ASP.NET: Dim oPkg As DTS.Package oPkg = CreateObject("DTS.Package")...
1
by: den 2005 | last post by:
Hi everybody, I created several stored procedure in a local sql server 2005 express database, now when I call/execute them in the asp.net 2.0 web page, it returns an error message of "Cannot...
4
by: Michael C | last post by:
Hi All, I'm trying to drop an sqlserver database from c# but can't because it is claiming it is in use. As I don't have a connection to it it must be connection pooling that is causing the...
4
by: pizzetta72 | last post by:
Hi all, i just finish to install cygwin on windows XP adding also gcc compiler module. After I tried to execute a file called fstsg.0.3-sparc (www.fstha.com) used to cript a Unix shell, I receive...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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
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...

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.