Assume path1,path2 and path3 are complete path of dll files including name.
System.Diagnostics.Process Prcs;
Prcs = System.Diagnostics.Process.Start("regsvr32.exe", "\"" + path1 + @""" /s");
Prcs.WaitForExit();
Prcs = System.Diagnostics.Process.Start("regsvr32.exe", "\"" + path2 + @""" /s");
Prcs.WaitForExit();
Prcs = System.Diagnostics.Process.Start("regsvr32.exe", "\"" + path3 + @""" /s");
Prcs.WaitForExit();
Prcs.Close();
To Unregister:
System.Diagnostics.Process Prcs;
Prcs = System.Diagnostics.Process.Start("regsvr32.exe", "\"" + path1 + @""" /s /u");
Prcs.WaitForExit();
Prcs = System.Diagnostics.Process.Start("regsvr32.exe", "\"" + path2 + @""" /s /u");
Prcs.WaitForExit();
Prcs = System.Diagnostics.Process.Start("regsvr32.exe", "\"" + path3 + @""" /s /u");
Prcs.WaitForExit();
Prcs.Close();
ok, but you might want and try this cmd..
ReplyDelete(works from command line too)
For %i in (*.foo) do regsvr32 %i
(replace *.foo with *.dll or *.ocx) also can add /u and /s as needed.
Sean Rohde