473,395 Members | 1,530 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.

Any way I can launch origram with parameter

I used System.Diagnostics.Process.Start(str) to launch application.
str is based on the registry setting, in registry, it might be
str = rundll32.exe "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHand ler
str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle
str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome

System.Diagnostics.Process.Start(str) can't launch with parameter, and there
might be any kind of the parameter in registry with exe file, what should I
do?
Nov 16 '05 #1
7 4061
Steve wrote:
I used System.Diagnostics.Process.Start(str) to launch application.
str is based on the registry setting, in registry, it might be
str = rundll32.exe "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHand ler
str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle
str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome

System.Diagnostics.Process.Start(str) can't launch with parameter, and there
might be any kind of the parameter in registry with exe file, what should I
do?


Check out the ProcessStartInfo class. I usually run external processes
by building one of those objects first.
Nov 16 '05 #2
Hi,

I think you should use
System.Diagnostics.ProcessStartInfo pStartInfo = new
System.Diagnostics.ProcessStartInfo ("filename", "parameters");
and then use Process.Start (pStartInfo) to start the process.

Hope that helps.

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Steve" <St***@discussions.microsoft.com> je napisal v sporočilo
news:B8**********************************@microsof t.com ...
I used System.Diagnostics.Process.Start(str) to launch application.
str is based on the registry setting, in registry, it might be
str = rundll32.exe "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHand ler
str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle
str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome

System.Diagnostics.Process.Start(str) can't launch with parameter, and
there
might be any kind of the parameter in registry with exe file, what should
I
do?

Nov 16 '05 #3
For str is get from registry, str parameter might be all kind of express
str = rundll32.exe "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHand ler
str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle
str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
how can I extract parameter correctly?
If used split "-" "," "/"
str might have "-" "," "/" elsewhere other than parameter


"Peter Jausovec" wrote:
Hi,

I think you should use
System.Diagnostics.ProcessStartInfo pStartInfo = new
System.Diagnostics.ProcessStartInfo ("filename", "parameters");
and then use Process.Start (pStartInfo) to start the process.

Hope that helps.

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Steve" <St***@discussions.microsoft.com> je napisal v sporoèilo
news:B8**********************************@microsof t.com ...
I used System.Diagnostics.Process.Start(str) to launch application.
str is based on the registry setting, in registry, it might be
str = rundll32.exe "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHand ler
str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle
str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome

System.Diagnostics.Process.Start(str) can't launch with parameter, and
there
might be any kind of the parameter in registry with exe file, what should
I
do?


Nov 16 '05 #4
Hi,

Maybe you should use a set of delimiters (-,/,\, ...), split the str and get
the last item in array. e.g.: str = "c:\programs\someexe.exe /param1";

string [] sParams = str.Split ('/');

then the parameter will be in sParams[sParams.Length-1];

Of course that would be ok for just one parameter ...
--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Steve" <St***@discussions.microsoft.com> je napisal v sporočilo
news:84**********************************@microsof t.com ...
For str is get from registry, str parameter might be all kind of express
str = rundll32.exe "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHand ler
str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle
str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
how can I extract parameter correctly?
If used split "-" "," "/"
str might have "-" "," "/" elsewhere other than parameter


"Peter Jausovec" wrote:
Hi,

I think you should use
System.Diagnostics.ProcessStartInfo pStartInfo = new
System.Diagnostics.ProcessStartInfo ("filename", "parameters");
and then use Process.Start (pStartInfo) to start the process.

Hope that helps.

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Steve" <St***@discussions.microsoft.com> je napisal v sporoeilo
news:B8**********************************@microsof t.com ...
>I used System.Diagnostics.Process.Start(str) to launch application.
> str is based on the registry setting, in registry, it might be
> str = rundll32.exe
> "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHand ler
> str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle
> str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
>
> System.Diagnostics.Process.Start(str) can't launch with parameter, and
> there
> might be any kind of the parameter in registry with exe file, what
> should
> I
> do?
>
>


Nov 16 '05 #5
if
str = "C:\Program Files\Internet-Explorer\iexplore.exe" -nohome
have two "-" on the string and -nohome is parameter,
Can I get right parameter with split?
I will try later, thanks a lot
"Peter Jausovec" wrote:
Hi,

Maybe you should use a set of delimiters (-,/,\, ...), split the str and get
the last item in array. e.g.: str = "c:\programs\someexe.exe /param1";

string [] sParams = str.Split ('/');

then the parameter will be in sParams[sParams.Length-1];

Of course that would be ok for just one parameter ...
--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Steve" <St***@discussions.microsoft.com> je napisal v sporoèilo
news:84**********************************@microsof t.com ...
For str is get from registry, str parameter might be all kind of express
str = rundll32.exe "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHand ler
str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle
str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
how can I extract parameter correctly?
If used split "-" "," "/"
str might have "-" "," "/" elsewhere other than parameter


"Peter Jausovec" wrote:
Hi,

I think you should use
System.Diagnostics.ProcessStartInfo pStartInfo = new
System.Diagnostics.ProcessStartInfo ("filename", "parameters");
and then use Process.Start (pStartInfo) to start the process.

Hope that helps.

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Steve" <St***@discussions.microsoft.com> je napisal v sporoeilo
news:B8**********************************@microsof t.com ...
>I used System.Diagnostics.Process.Start(str) to launch application.
> str is based on the registry setting, in registry, it might be
> str = rundll32.exe
> "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHand ler
> str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle
> str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
>
> System.Diagnostics.Process.Start(str) can't launch with parameter, and
> there
> might be any kind of the parameter in registry with exe file, what
> should
> I
> do?
>
>


Nov 16 '05 #6
if you split this str = "C:\Program
Files\Internet-Explorer\iexplore.exe -nohome" you will get an string array
with 3 elements:

C:\Program Files\Internet
Explorer\iexplore.exe
nohome

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Steve" <St***@discussions.microsoft.com> je napisal v sporočilo
news:62**********************************@microsof t.com ...
if
str = "C:\Program Files\Internet-Explorer\iexplore.exe" -nohome
have two "-" on the string and -nohome is parameter,
Can I get right parameter with split?
I will try later, thanks a lot
"Peter Jausovec" wrote:
Hi,

Maybe you should use a set of delimiters (-,/,\, ...), split the str and
get
the last item in array. e.g.: str = "c:\programs\someexe.exe /param1";

string [] sParams = str.Split ('/');

then the parameter will be in sParams[sParams.Length-1];

Of course that would be ok for just one parameter ...
--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Steve" <St***@discussions.microsoft.com> je napisal v sporoeilo
news:84**********************************@microsof t.com ...
> For str is get from registry, str parameter might be all kind of
> express
> str = rundll32.exe
> "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHand ler
> str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle
> str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
> how can I extract parameter correctly?
> If used split "-" "," "/"
> str might have "-" "," "/" elsewhere other than parameter
>
>
>
>
> "Peter Jausovec" wrote:
>
>> Hi,
>>
>> I think you should use
>> System.Diagnostics.ProcessStartInfo pStartInfo = new
>> System.Diagnostics.ProcessStartInfo ("filename", "parameters");
>> and then use Process.Start (pStartInfo) to start the process.
>>
>> Hope that helps.
>>
>> --
>> Regards,
>> Peter Jausovec
>> (http://blog.jausovec.net)
>> "Steve" <St***@discussions.microsoft.com> je napisal v sporoeilo
>> news:B8**********************************@microsof t.com ...
>> >I used System.Diagnostics.Process.Start(str) to launch application.
>> > str is based on the registry setting, in registry, it might be
>> > str = rundll32.exe
>> > "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHand ler
>> > str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle
>> > str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
>> >
>> > System.Diagnostics.Process.Start(str) can't launch with parameter,
>> > and
>> > there
>> > might be any kind of the parameter in registry with exe file, what
>> > should
>> > I
>> > do?
>> >
>> >
>>
>>
>>


Nov 16 '05 #7
Peter,

Thanks a lot for your help.

"Peter Jausovec" wrote:
if you split this str = "C:\Program
Files\Internet-Explorer\iexplore.exe -nohome" you will get an string array
with 3 elements:

C:\Program Files\Internet
Explorer\iexplore.exe
nohome

--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Steve" <St***@discussions.microsoft.com> je napisal v sporoèilo
news:62**********************************@microsof t.com ...
if
str = "C:\Program Files\Internet-Explorer\iexplore.exe" -nohome
have two "-" on the string and -nohome is parameter,
Can I get right parameter with split?
I will try later, thanks a lot
"Peter Jausovec" wrote:
Hi,

Maybe you should use a set of delimiters (-,/,\, ...), split the str and
get
the last item in array. e.g.: str = "c:\programs\someexe.exe /param1";

string [] sParams = str.Split ('/');

then the parameter will be in sParams[sParams.Length-1];

Of course that would be ok for just one parameter ...
--
Regards,
Peter Jausovec
(http://blog.jausovec.net)
"Steve" <St***@discussions.microsoft.com> je napisal v sporoeilo
news:84**********************************@microsof t.com ...
> For str is get from registry, str parameter might be all kind of
> express
> str = rundll32.exe
> "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHand ler
> str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle
> str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
> how can I extract parameter correctly?
> If used split "-" "," "/"
> str might have "-" "," "/" elsewhere other than parameter
>
>
>
>
> "Peter Jausovec" wrote:
>
>> Hi,
>>
>> I think you should use
>> System.Diagnostics.ProcessStartInfo pStartInfo = new
>> System.Diagnostics.ProcessStartInfo ("filename", "parameters");
>> and then use Process.Start (pStartInfo) to start the process.
>>
>> Hope that helps.
>>
>> --
>> Regards,
>> Peter Jausovec
>> (http://blog.jausovec.net)
>> "Steve" <St***@discussions.microsoft.com> je napisal v sporoeilo
>> news:B8**********************************@microsof t.com ...
>> >I used System.Diagnostics.Process.Start(str) to launch application.
>> > str is based on the registry setting, in registry, it might be
>> > str = rundll32.exe
>> > "%ProgramFiles%\INTERN~1\hmmapi.dll",OpenInboxHand ler
>> > str = "C:\PROGRA~1\MICROS~4\OFFICE11\OUTLOOK.EXE" /recycle
>> > str = "C:\Program Files\Internet Explorer\iexplore.exe" -nohome
>> >
>> > System.Diagnostics.Process.Start(str) can't launch with parameter,
>> > and
>> > there
>> > might be any kind of the parameter in registry with exe file, what
>> > should
>> > I
>> > do?
>> >
>> >
>>
>>
>>


Nov 16 '05 #8

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

Similar topics

17
by: George | last post by:
Newbie question: I'm trying to lauch Notepad from Python to open a textfile: import os b1="c:\test.txt" os.system('notepad.exe ' + b1) However, the t of test is escaped by the \, resulting...
8
by: Dutchy | last post by:
Dear reader, In an attempt to obtain the path to the quick-launch-folder in order to create a shortcut to my application-updates during installation , I thought to: 1- check if quick launch...
2
by: MLH | last post by:
I'm trying to manually modify one myself that will specify the executable, the application database and the system database. I would like to do this as an experiment only, so its not a HI-PRI...
7
by: Paul | last post by:
Hi. I need to launch a windows application and then send keyboard event to this process to run certain commands. I've created a COM+ appplication to spawn and talk to the application which works...
8
by: Paul | last post by:
I have looked and looked for this info. All the I/O examples I've found either explicity use a file name or use the OpenFileDialog. When you drag a MS Word document over MS Word, it launches and...
2
by: DavideR | last post by:
How to launch a exe in a vc++ 2002 program? What is the equivalent of vb6's app.path? How can i get the exe name? Thanks davide
4
by: Patrick Dugan | last post by:
I am trying to launch a vbscript from within vb.net (vs2005) The script itself requires a parameter of a filename to process. I have tried: Dim P As Process =...
6
by: Ronald S. Cook | last post by:
How do I launch, say, Microsoft Word from within a C# Win app? Word should launch exterior to my app, of course. Is it easy to set size and position of where Word window will be placed? ...
8
by: Marcus | last post by:
I have this application I have made that I launch when the user logs into Windows XP. I would like to delay the launch of the application so that it starts 1 minute after the user has logged in. ...
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...
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...
0
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...

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.