|
-
Nov 18th, 2003, 11:26 AM
#1
Thread Starter
Hyperactive Member
Calling process! **SOLVED**
Hey all,
I have a smal prob and I am really hoping someone knows an answer to it.
So heres what I do, I have a small app which needs to call a tool called gacutil. I do that using following code:
Code:
doRegsvcs.StartInfo.FileName = txtNetDir.Text + @"\\Primary Interop Assemblies\\gacutil";
doRegsvcs.StartInfo.Arguments= "/i " + txtNetDir.Text + @"\Primary Interop Assemblies\adodb.dll";
doRegsvcs.StartInfo.UseShellExecute = false;
doRegsvcs.EnableRaisingEvents = false;
doRegsvcs.StartInfo.RedirectStandardOutput = true;
doRegsvcs.StartInfo.CreateNoWindow = true;
doRegsvcs.Start();
finalStatus = finalStatus + doRegsvcs.StandardOutput.ReadToEnd().ToString();
doRegsvcs.WaitForExit();
doRegsvcs.Close();
So calling the app works,...but with one Problem:
the tool I am calling is saying that the function gacutil /i only takes one argument. Well as you can see I am only passing one argument. I figure that this tool I am calling is not supporting whitespaces in the Folder Names! So how can I get this tool to work? Is it possible to change to the directory and then perform the tool? Or does anyone know some sort of workaround?
Hope that makes sense, thanks in advance,
Stephan
Last edited by Sgt-Peppa; Nov 19th, 2003 at 04:09 AM.
Keep Smiling - even if its hard 
Frankie Says Relax, wossname Says Yeah!
wossname:--Currently I'm wearing a gimp suit and a parachute.
C# - Base64 Blog
-
Nov 18th, 2003, 05:33 PM
#2
PowerPoster
Yes, I had the same problem when trying to start a word document through a command line argument. You are right, the white space is causing the problem because it is thinking the arguments are seperated by white space.
You need to include quotes around it.
Do something like this:
Code:
string dir = @"C:\Root";
MessageBox.Show("/i \"" + dir + "\\Primary Interop Assemblies\\adodb.dll\"");
-
Nov 19th, 2003, 04:09 AM
#3
Thread Starter
Hyperactive Member
That does the trick, thanks a lot, saved me a lot of time!
Thanks again,
Stephan
Keep Smiling - even if its hard 
Frankie Says Relax, wossname Says Yeah!
wossname:--Currently I'm wearing a gimp suit and a parachute.
C# - Base64 Blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|