On Windows Vista, Process.Start() generates Win32Exception.
Sample Code:
Dim selfProc As String = System.Windows. Forms.Applicati on.ExecutablePa th
System.Diagnost ics.Process.Sta rt(Chr(34) & selfProc & Chr(34))
The generated Exception:
System.Componen tModel.Win32Exc eption: The parameter is incorrect
at System.Diagnost ics.Process.Sta rtWithShellExec uteEx(ProcessSt artInfo
startInfo))
at System.Diagnost ics.Process.Sta rt()
at System.Diagnost ics.Process.Sta rt(ProcessStart Info startInfo)
at System.Diagnost ics.Process.Sta rt(String fileName)
at ...MyProcedure( ...)
What is wrong with my code?
Thanks
Atara
*** Sent via Developersdex http://www.developersdex.com *** 5 5826
Are you sure you need quotes ? (executable and arguments are provided
separately unlike when typing in the console).
"Atara" <At***@DD.com a é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.Applicati on.ExecutablePa th
System.Diagnost ics.Process.Sta rt(Chr(34) & selfProc & Chr(34))
The generated Exception:
System.Componen tModel.Win32Exc eption: The parameter is incorrect
at System.Diagnost ics.Process.Sta rtWithShellExec uteEx(ProcessSt artInfo
startInfo))
at System.Diagnost ics.Process.Sta rt()
at System.Diagnost ics.Process.Sta rt(ProcessStart Info startInfo)
at System.Diagnost ics.Process.Sta rt(String fileName)
at ...MyProcedure( ...)
What is wrong with my code?
Thanks
Atara
*** Sent via Developersdex http://www.developersdex.com ***
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.StartIn fo.UseShellExec ute = False
???
Thanks
Atara
*** Sent via Developersdex http://www.developersdex.com ***
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.com a écrit dans le message de news:
%2************* ***@TK2MSFTNGP0 3.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.StartIn fo.UseShellExec ute = False
???
Thanks
Atara
*** Sent via Developersdex http://www.developersdex.com ***
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 ***
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.Componen tModel.Win32Exc eption
and I get
ex1.ErrorCode() .ToString =[-2147467259]
ex1.NativeError Code().ToString =[87]
according to [url:http://support.microso ft.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.developersd ex.com *** This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 ??? It seems to be possible, that a Win32Exception will be thrown.
Will this give me this reason , if the process cannot be
started? The docs looks a little vage for me.
Thanks in advance,
Manfred Braun
|
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 simple batch file (echo hello world) and was trying to
retrieve the standard output but every time I run the code it returns
ExitCode as 1.
|
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 for the
application doesn't appear - however, I can see the process in the
TaskManager.
Now, feel free to mention that starting a regular windows application
|
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, exception). Note that when the other program dies due to
exception, it writes to messagebox.
does the "StandardOutput" and "StandardError" is only good for console
|
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 "Access is Denied"
Win32Exception. What do i do to not generate this exception ?
Any help highly appreciated,
Thanks,
Jay
| |
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
does not work on Vista
#if DEBUG
|
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 (C#);
public class MyServiceInstaller : System.Configuration.Install.Installer
{
private System.ServiceProcess.ServiceProcessInstaller
serviceProcessInstaller;
|
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). Much of the contents of this article are tested on Windows XP professional SP2 by the author. Some instances of this article may be altogether different/missing on Windows Vista, XP and other Windows NT systems, but I have tried to write a...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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...
|
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,...
|
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...
|
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...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| | |