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

Get process full path

Hi,
I want to check if in this computer have outlook a programe.
If yes -->
System.Diagnostics.Process.Start ("OUTLOOK.EXE");

How to check if no??
if no --some msg...
How can I check it?
How to get OUTLOOK.EXE path and ask:
File.Exists(path)

I'm using vs.net 2003
Thank's,
Yael.

May 27 '07 #1
4 10340
Yael,

Are you trying to get the path to Outlook so that you can just open it,
or do you want to actually do something with it once you open it? Either
way, I think you should use automation to create a new instance of the
Application class for Outlook, and then work from there.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Yael" <Ya**@discussions.microsoft.comwrote in message
news:22**********************************@microsof t.com...
Hi,
I want to check if in this computer have outlook a programe.
If yes -->
System.Diagnostics.Process.Start ("OUTLOOK.EXE");

How to check if no??
if no --some msg...
How can I check it?
How to get OUTLOOK.EXE path and ask:
File.Exists(path)

I'm using vs.net 2003
Thank's,
Yael.
May 27 '07 #2
Microsoft.Win32.RegistryKey key =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@ "SOFTWARE\Microsoft
\Windows\CurrentVersion\App Paths\OUTLOOK.EXE", false);
string path = (string)key.GetValue("Path");

HTH :)
Yael je napisao/la:
Hi,
I want to check if in this computer have outlook a programe.
If yes -->
System.Diagnostics.Process.Start ("OUTLOOK.EXE");

How to check if no??
if no --some msg...
How can I check it?
How to get OUTLOOK.EXE path and ask:
File.Exists(path)

I'm using vs.net 2003
Thank's,
Yael.
May 27 '07 #3
Thank's It's working to me when I'm running this on my local driver, but if I
run this OutlookChecker.exe (my c# project) on the server I get this error
Error:
An unhandled exception of type 'System.Security.SecurityException' occurred
in OutlookChecker.exe
================= Start Code =================
private void isOutlook()
{
Microsoft.Win32.RegistryKey key =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey(" Software\\microsoft\\windows\\currentversion\\app paths\\OUTLOOK.EXE");

string path = (string)key.GetValue("Path");
if( path != null)
System.Diagnostics.Process.Start("OUTLOOK.EXE");
else
MessageBox.Show("There is no Outlook in this computer!","System
Error",MessageBoxButtons.OK,MessageBoxIcon.Exclama tion);
}
================= End Code =================

I tryed to run only this line, this is running good, seams like RegistryKey
problem??
MessageBox.Show("There is no Outlook in this computer");
Additional information: Request failed.

"Miroslav Stampar [MCSD.NET / Security+]" wrote:
Microsoft.Win32.RegistryKey key =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@ "SOFTWARE\Microsoft
\Windows\CurrentVersion\App Paths\OUTLOOK.EXE", false);
string path = (string)key.GetValue("Path");

HTH :)
Yael je napisao/la:
Hi,
I want to check if in this computer have outlook a programe.
If yes -->
System.Diagnostics.Process.Start ("OUTLOOK.EXE");

How to check if no??
if no --some msg...
How can I check it?
How to get OUTLOOK.EXE path and ask:
File.Exists(path)

I'm using vs.net 2003
Thank's,
Yael.

May 28 '07 #4
Yael,

When you run it on the server, are you keeping the program on a share
and then running it from there? If so, the runtime prevents the registry
key class from running, as anything not on the local machine by default is
considered potentially harmful.

Because of this, you would have to go to the .NET Administration utility
in Administrative Tools and set the code policy for the application so that
the app has the rights you need to run on the local machine.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Yael" <Ya**@discussions.microsoft.comwrote in message
news:59**********************************@microsof t.com...
Thank's It's working to me when I'm running this on my local driver, but
if I
run this OutlookChecker.exe (my c# project) on the server I get this error
Error:
An unhandled exception of type 'System.Security.SecurityException'
occurred
in OutlookChecker.exe
================= Start Code =================
private void isOutlook()
{
Microsoft.Win32.RegistryKey key =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey(" Software\\microsoft\\windows\\currentversion\\app
paths\\OUTLOOK.EXE");

string path = (string)key.GetValue("Path");
if( path != null)
System.Diagnostics.Process.Start("OUTLOOK.EXE");
else
MessageBox.Show("There is no Outlook in this computer!","System
Error",MessageBoxButtons.OK,MessageBoxIcon.Exclama tion);
}
================= End Code =================

I tryed to run only this line, this is running good, seams like
RegistryKey
problem??
MessageBox.Show("There is no Outlook in this computer");
Additional information: Request failed.

"Miroslav Stampar [MCSD.NET / Security+]" wrote:
> Microsoft.Win32.RegistryKey key =
Microsoft.Win32.Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft
\Windows\CurrentVersion\App Paths\OUTLOOK.EXE", false);
string path = (string)key.GetValue("Path");

HTH :)
Yael je napisao/la:
Hi,
I want to check if in this computer have outlook a programe.
If yes -->
System.Diagnostics.Process.Start ("OUTLOOK.EXE");

How to check if no??
if no --some msg...
How can I check it?
How to get OUTLOOK.EXE path and ask:
File.Exists(path)

I'm using vs.net 2003
Thank's,
Yael.

May 28 '07 #5

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

Similar topics

9
by: Paul | last post by:
Hi, VB.NET is saying the file I am creating is in use by another process and won't complete its task of moving the file to the specified destination folder. Here is my code (the main bit...
3
by: Jeff Jarrell | last post by:
I have an object to execute a process. its intent is to do a simple execute and capture stdin and stdout. Nothing fancy, not for long processes. simple. I expect to typically use it with a fully...
7
by: Christopher Attard | last post by:
Hi, How can I obtain the full path for a running process without using WMI? I've tried to use the Process.StartInfo.WorkingDirectory but it's not valid since the process is already running. ...
4
by: Primo | last post by:
Hi, This problem has been frustrating me for days and I hope you experts can help me out. I am trying to run a command, which I would normally run from the command line, from within my C#...
6
by: Saso Zagoranski | last post by:
Hi! I'm trying to run a decryption utility (des), which needs the following parameters: -D-u -k "key" input.file output.file If I run this from the command-prompt it works but when I try to...
12
by: Noam | last post by:
I had originally written a program as a c# console application. The program used a reference that I wrote in c++. Later I was told to re-write the application as a windows service. When the service...
4
by: =?Utf-8?B?VkIgSm9ubmll?= | last post by:
I am at my witless end here, please help! I have an ASP.Net aspx web page, hosted on Windows Server 2003, that receives a query string with the path to an autocad drawing file selected from a...
7
by: xla76 | last post by:
Using WMI I can get the full path of a process on a remote computer: "SELECT ExecutablePath FROM Win32_Process" Without wmi I can get theprocessname and id: For Each ps In...
4
by: Kerem Gümrükcü | last post by:
Hi, i wonder that the Process.Start(...) needs full path to the executable to start it, even the executable is listed in the PATH Variable and can be launched from any console on my system. Is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
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?
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.