Hi,
i'm trying to run a program from the %ProgramFiles% with no success,what is
the problem with this code'why i can't run the program,i've to use the
%ProgramFiles%,Plz help with this code
Process Outlook_Express = new Process();
Outlook_Express.StartInfo.FileName = Environment.SpecialFolder.ProgramFiles
+ @"%programfiles%\Outlook Express\msimn.exe";
Outlook_Express.Start();
Thanks 9 1297
"Avi G" <Av**@discussions.microsoft.com> wrote in message
news:E9**********************************@microsof t.com... Hi,
i'm trying to run a program from the %ProgramFiles% with no success,what is the problem with this code'why i can't run the program,i've to use the %ProgramFiles%,Plz help with this code
Process Outlook_Express = new Process(); Outlook_Express.StartInfo.FileName = Environment.SpecialFolder.ProgramFiles + @"%programfiles%\Outlook Express\msimn.exe"; Outlook_Express.Start();
RTFM.
it took mi 2 minutes to find this in help:
Process Outlook_Express = new Process();
Outlook_Express.StartInfo.FileName =
Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles)
+ @"\Outlook Express\msimn.exe";
Outlook_Express.Start();
Avi G wrote: Hi,
i'm trying to run a program from the %ProgramFiles% with no success,what is the problem with this code'why i can't run the program,i've to use the %ProgramFiles%,Plz help with this code
Process Outlook_Express = new Process(); Outlook_Express.StartInfo.FileName = Environment.SpecialFolder.ProgramFiles + @"%programfiles%\Outlook Express\msimn.exe"; Outlook_Express.Start();
Use Environment.GetFolderPath():
string programFilesFolder
= Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles);
string outlookExpressPath
= Path.Combine(programFilesFolder, @"Outlook Express\msimn.exe");
hth,
Max
btw, aren't "@"%programfiles%" implies the "C:\Program Files" already?
"Avi G" <Av**@discussions.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:E9********************************* *@microsoft.com... Hi,
i'm trying to run a program from the %ProgramFiles% with no success,what is the problem with this code'why i can't run the program,i've to use the %ProgramFiles%,Plz help with this code
Process Outlook_Express = new Process(); Outlook_Express.StartInfo.FileName = Environment.SpecialFolder.ProgramFiles + @"%programfiles%\Outlook Express\msimn.exe"; Outlook_Express.Start();
Thanks
ok,thanks it's working
tell me is this code point to %systemroot%
Environment.GetFolderPath(Environment.SpecialFolde r.System)
or it's point to somewhere else,i need the %systemroot%.
"Artur Borecki" wrote: "Avi G" <Av**@discussions.microsoft.com> wrote in message news:E9**********************************@microsof t.com... Hi,
i'm trying to run a program from the %ProgramFiles% with no success,what is the problem with this code'why i can't run the program,i've to use the %ProgramFiles%,Plz help with this code
Process Outlook_Express = new Process(); Outlook_Express.StartInfo.FileName = Environment.SpecialFolder.ProgramFiles + @"%programfiles%\Outlook Express\msimn.exe"; Outlook_Express.Start();
RTFM. it took mi 2 minutes to find this in help:
Process Outlook_Express = new Process(); Outlook_Express.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles) + @"\Outlook Express\msimn.exe"; Outlook_Express.Start();
"Avi G" <Av**@discussions.microsoft.com> wrote in message
news:0C**********************************@microsof t.com... ok,thanks it's working tell me is this code point to %systemroot% Environment.GetFolderPath(Environment.SpecialFolde r.System) or it's point to somewhere else,i need the %systemroot%.
System.Console.Write(Environment.GetFolderPath(Env ironment.SpecialFolder.System));
and you know everything.
i still can't find there the code for the %systemroot%,can you help?
"Artur Borecki" wrote: "Avi G" <Av**@discussions.microsoft.com> wrote in message news:0C**********************************@microsof t.com... ok,thanks it's working tell me is this code point to %systemroot% Environment.GetFolderPath(Environment.SpecialFolde r.System) or it's point to somewhere else,i need the %systemroot%.
System.Console.Write(Environment.GetFolderPath(Env ironment.SpecialFolder.System)); and you know everything.
I can't find any SpecialFolder enum for that...
So maybe just remove anything after the "\" character.
"Avi G" <Av**@discussions.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:78********************************* *@microsoft.com... i still can't find there the code for the %systemroot%,can you help?
"Artur Borecki" wrote:
"Avi G" <Av**@discussions.microsoft.com> wrote in message news:0C**********************************@microsof t.com... > ok,thanks it's working > tell me is this code point to %systemroot% > Environment.GetFolderPath(Environment.SpecialFolde r.System) > or it's point to somewhere else,i need the %systemroot%.
System.Console.Write(Environment.GetFolderPath(Env ironment.SpecialFolder.System)); and you know everything.
Try :
Console.WriteLine(Environment.GetEnvironmentVariab le("SystemRoot"));
Console.WriteLine(Environment.GetEnvironmentVariab le("WinDir"));
Console.WriteLine(Environment.GetEnvironmentVariab le("ProgramFiles"));
That might help.
Cheers,
Yash
Alternatively you could use:
Console.WriteLine(Environment.ExpandEnvironmentVar iables("%SystemRoot%"));
Console.WriteLine(Environment.ExpandEnvironmentVar iables("%ProgramFiles%"));
Console.WriteLine(Environment.ExpandEnvironmentVar iables("%WINDIR%"));
In the query (%***%), the *** part is case insensitive.
I hope that helps.
Yash ya*****@gmail.com wrote: Try :
Console.WriteLine(Environment.GetEnvironmentVariab le("SystemRoot")); Console.WriteLine(Environment.GetEnvironmentVariab le("WinDir")); Console.WriteLine(Environment.GetEnvironmentVariab le("ProgramFiles"));
That might help.
Cheers, Yash This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Chris Cioffi |
last post by:
I started writing this list because I wanted to have definite points
to base a comparison on and as the starting point of writing something
myself. After looking around, I think it would be a...
|
by: SL_McManus |
last post by:
Hi All;
I am fairly new to Perl. I have a file with close to 3000 lines
that I would like to split out in a certain way. I would like to put
the record type starting in column 1 for 2 spaces,...
|
by: lutorm |
last post by:
Hi,
I'm having a problem with a return statement being parsed to return a
function (I think). Check here:
template <typename T> class A {};
template <typename T> class maker_of_A {
public:...
|
by: Shawn A. Hall |
last post by:
First, I apologize if this isn't the right group to post this question, but
I didn't see a newsgroup specific to CodeDom so here I am.
On to my question:
I am trying to use CodeDom to generate...
|
by: hazz |
last post by:
The following classes follow from the base class ' A ' down to the derived class ' D ' at the bottom of the inheritance chain.
I am calling the class at the bottom, "public class D" from a client...
| |
by: Jim Hubbard |
last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
|
by: eewwttww |
last post by:
how to save with only WebBrowser: save html+picture without dialog box?
what I Have is:
WebBrowser.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_PROMPTUSER, 300, 300
I don't want this code.
I want...
|
by: Chris F Clark |
last post by:
Please excuse the length of this post, I am unfortunately long-winded,
and don't know how to make my postings more brief.
I have a C++ class library (and application generator, called
Yacc++(r)...
|
by: Ron |
last post by:
I've got some C# code that sort of does what I want:
Looking at the xml files in area:
http://www.keepitsimplekid.com/xml
I want to change Untitled Ad at the top of the xml to the name of the...
|
by: Alan Mailer |
last post by:
Again, I'm new to VB.net and there is something I need help with:
Like (I assume) many of us, over time I want to be able to create some
VB.net classes that I might want to use in more than one...
|
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...
| |
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,...
|
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: 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: 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...
|
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,...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |