473,382 Members | 1,809 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,382 software developers and data experts.

On Windows Vista, Process.Start() generates Win32Exception.

On Windows Vista, Process.Start() generates Win32Exception.

Sample Code:

Dim selfProc As String = System.Windows.Forms.Application.ExecutablePath
System.Diagnostics.Process.Start(Chr(34) & selfProc & Chr(34))
The generated Exception:

System.ComponentModel.Win32Exception: The parameter is incorrect
at System.Diagnostics.Process.StartWithShellExecuteEx (ProcessStartInfo
startInfo))
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName)
at ...MyProcedure(...)
What is wrong with my code?

Thanks
Atara

*** Sent via Developersdex http://www.developersdex.com ***
Mar 6 '07 #1
5 5798
Are you sure you need quotes ? (executable and arguments are provided
separately unlike when typing in the console).

"Atara" <At***@DD.coma écrit dans le message de news:
uN**************@TK2MSFTNGP03.phx.gbl...
On Windows Vista, Process.Start() generates Win32Exception.

Sample Code:

Dim selfProc As String = System.Windows.Forms.Application.ExecutablePath
System.Diagnostics.Process.Start(Chr(34) & selfProc & Chr(34))
The generated Exception:

System.ComponentModel.Win32Exception: The parameter is incorrect
at System.Diagnostics.Process.StartWithShellExecuteEx (ProcessStartInfo
startInfo))
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName)
at ...MyProcedure(...)
What is wrong with my code?

Thanks
Atara

*** Sent via Developersdex http://www.developersdex.com ***

Mar 6 '07 #2

I had the same error , when not having the chr(34), so I added it.

Do you think that this might cause the problem?

while googling, I found Microsoft Process Monitor , I will try to use it
during this week.

Do you think I need to set
Process.StartInfo.UseShellExecute = False
???

Thanks

Atara
*** Sent via Developersdex http://www.developersdex.com ***
Mar 6 '07 #3
Would say a problem with the target file. Do you have the same problem when
try to launch some other EXE file such as calc.exe ?

What kindf of file are you trying to launch ? For executable and unless you
want to use redirection it shouldn't make any difference.

Finally it could be perhaps something with Vista new security featrures (UAC
or hgher privileged directory ?)

For now I would make a test with calc.exe to see if it works for something
simple...

Good luck.

"Atara" <At***@DD.coma écrit dans le message de news:
%2****************@TK2MSFTNGP03.phx.gbl...
>
I had the same error , when not having the chr(34), so I added it.

Do you think that this might cause the problem?

while googling, I found Microsoft Process Monitor , I will try to use it
during this week.

Do you think I need to set
Process.StartInfo.UseShellExecute = False
???

Thanks

Atara
*** Sent via Developersdex http://www.developersdex.com ***

Mar 6 '07 #4

sorry I did not answer before, busy with other projects.
I hope to update this thread when I have new info

Thank you all.

Atara.
*** Sent via Developersdex http://www.developersdex.com ***
Mar 25 '07 #5

I started investigating the problem...

I get the same error in two cases:
1. When I try to re-execute my application.
2. When I try to open an html file in the default browser.

regardind the 2nd case, I added
Catch ex1 As System.ComponentModel.Win32Exception

and I get
ex1.ErrorCode().ToString =[-2147467259]
ex1.NativeErrorCode().ToString =[87]

according to [url:http://support.microsoft.com/kb/305703]
... if you use this approach on a computer that does not have a
browser installed, an exception occurs. ...

so my question now is:
How to start the default Internet browser on Vista ?

Atara
*** Sent via Developersdex http://www.developersdex.com ***
Mar 27 '07 #6

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

Similar topics

3
by: Manfred Braun | last post by:
Hi All, the Process.Start method returns a boolean value to indicate, if a process was started or not. Where can I obtain more detailed error information, if the process could not be started ???...
11
by: Nurit N | last post by:
This is the third newsgroup that I'm posting my problem. I'm sorry for the multiple posts but the matter becoming urgent. I hope this is the right place for it... I have created a very...
3
by: illegal.prime | last post by:
Hi all, I have a service that needs to start a regular windows application. I'm running the service as ServiceAccount.LocalSystem. But, when it starts the process (using Process.Start) the GUI...
5
by: alexia.bee | last post by:
Hi, I my program runs other program(form) by process.start. In some cases the other program gets exception and dies. Can I get the reason of the termination of other program(Stopped by user,...
7
by: =?Utf-8?B?ams=?= | last post by:
I am using System.Diagnostics.Process class to open a word document by call ing Process.Start("test.doc"). I am using C# as programming language. On some of the computers on running this code i get...
5
by: ink | last post by:
Hi all, I cant seem to debug my windows service on my Vista machine. It seems it has something to do with 0 Session. What I would normally do is add the following code to my OnStart() but it...
1
by: =?Utf-8?B?Qi5BaGxzdGVkdA==?= | last post by:
Hi all, This is something that I have been toying with for about a week now. What I want to achieve is Install a Service with Customised parameters (using InstallUtil.exe) for User Name. Example...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: Overview NOTE- This complete article on "Windows Autorun FAQs" applies theoretically to all Windows NT-based OSes till Windows Vista (and probably Vista's successors too)....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.