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

not able to run the Process

Hi guys,
it's me again. today i'm trying the "Process" class.
I'm trying to uninstall one product developed by my company thorugh
..net code but it seems not working but when i execute the commandline
MSI uninstall command it seems working fine. the code i'm using is:

System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.CreateNoWindow = true;
p.StartInfo.FileName =
Path.GetFullPath(System.Environment.GetEnvironment Variable("WINDIR") +
"/system32/msiexec.exe");//Environment.GetEnvironmentVariable("WINDIR")+
"/system32/msiexec.exe";
p.StartInfo.Arguments = "/uninstall " + new
FileInfo(powerlearn.MSIPath).Name + " /qn";
p.Start();
p.WaitForExit();
whenever i execute the code, it does nothing. i mean i tried to debug
this code but when i came to "p.WaitForExit();" and i pressed the F10
it moved to another line without waiting process to be completed. seems
that process is somehow not able to run.

can anyone help me out from this problem? any other solution is also
welcome.

Tools:
c#.net 2.0 (VS.NET 2005)
Thanks,
Lucky

Aug 24 '06 #1
3 883
I forgot to add some information.

when i start the process it exits in a second and returns ExitCode :
1619

i hope it would help more.

thanks again,
Lucky

Aug 24 '06 #2
Hi guys,

it's again me. i found the solution of my problem.
there are to ways to do it.

1) in the Arguments pass the fullname of the FileInfo object rather
then only file name
2) keep the code as it is and change the directory to file directory
where the file is, before this code.

it is all about telling msi the full path of the s/w msi file. it
doesnt matter wihch way u do it. you only needs to tell it where is
that file.

by the way. thanks for reading.

Lucky

Aug 24 '06 #3
Hello Lucky,

Actually, it does matter how you do it. Unless you set the working directory
back after you are done.. things may not work as expected. Given a choice,
you should always opt to pass the full path rather than change the working
directory.

-Boo
Hi guys,

it's again me. i found the solution of my problem. there are to ways
to do it.

1) in the Arguments pass the fullname of the FileInfo object rather
then only file name
2) keep the code as it is and change the directory to file directory
where the file is, before this code.
it is all about telling msi the full path of the s/w msi file. it
doesnt matter wihch way u do it. you only needs to tell it where is
that file.

by the way. thanks for reading.

Lucky

Aug 25 '06 #4

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

Similar topics

12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
6
by: KathyK | last post by:
Hi and Thanks in advance! I am able to link to a MSAccess 2000 db that I secured. I have removed all permissions from the Admin user and actually the whole users group and admins group. I...
3
by: Ajay | last post by:
Hi Gurus, Here is my Problem I am not able to create the asp.net web application when ever i tried to create a new project i am getting the following error message. "Visual Studio .NET could...
1
by: Ajay | last post by:
Hi Gurus, Here is my Problem I am not able to create the asp.net web application when ever i tried to create a new project i am getting the following error message. "Visual Studio .NET could...
2
by: Lucky | last post by:
Hi guys, it's me again. today i'm trying the "Process" class. I'm trying to uninstall one product developed by my company thorugh ..net code but it seems not working but when i execute the...
1
by: moondaddy | last post by:
I had to repost this becuase I renewed-changed my msdn alias. Also, the asnwer in the other past did not understand what I'm trying to do, so I'll attempt to clarify. I have a .net 2.0 winforms...
0
by: narayan2586 | last post by:
Hi all, When ever i am trying to connect my application it's giving below error message: RemoteException occurred in server thread; nested exception is: java.rmi.RemoteException: ; nested...
1
by: Wazza | last post by:
G'Day, I have a re-occurring problem and wish to design a framework or pattern to address it. I have some Ideas but I would like to do some brainstorming with my peers before commencing. The...
14
by: masaniparesh | last post by:
Hi Friends, The basic issue is "To read stdin and stdout in the same program" The following program is i have wrote using thread but i figured out that stdout is working but it is not working when...
2
by: jrkarthi | last post by:
dim con As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\KarthI\sample\db1\WindowsApplication1\WindowsApplication1\bin\Debug\phm_pharmacy.mdf;Integrated Security=True;Connect...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.