3

I'm registering a dll at startup of my application by this command:

System.Diagnostics.Process.Start("regsvr32",strPath);

and after running this line of code , a window appears that says DLL registration was successful or not .

My question is that how can I hide this window in my application?

Shima.Y
  • 373
  • 4
  • 9
  • 18

2 Answers2

4
Process proc = new Process
{
    StartInfo =
    {
        FileName = "regsvr32",
        Arguments = "/s" + strPath,
        RedirectStandardError = true,
        UseShellExecute = false,
        CreateNoWindow = true
    }
};
proc.Start();

Also you can do this:

System.Diagnostics.Process.Start("regsvr32","/s" + strPath);
Ghasem
  • 14,455
  • 21
  • 138
  • 171
3

Use /s – Silent; display no message boxes (added with Windows XP and Windows Vista) option.

Source: What is the different between /n and /i parameters of RegSvr32.exe?

Community
  • 1
  • 1
csharpfolk
  • 4,124
  • 25
  • 31