Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to use RegSrv32 to register COM interfaces through Win32::Process

Status
Not open for further replies.

Phalanx1

Programmer
Jul 21, 2003
128
US
Code:
use Win32;
use Win32::Process;
        sub ErrorReport{
                print Win32::FormatMessage( Win32::GetLastError() );
        }
        my $ProcessObj = Win32::Process::Create($Obj,
                                "C:/windows/system32/RegSrv32.exe",
                                "RegSvr32 YourComponentsnamehere.wsc",
                                0,
                                NORMAL_PRIORITY_CLASS,
                                ".")|| die ErrorReport();
               if ($Obj->Resume()) {
        open FH, ">>results.txt" || die ErrorResport();
print FH "Component registered\r\n";
print FH "by Phalanx1 with Perl\r\n";

this is probably not the most ethical peice of code but it works.but it accomplishes the task required.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top