Steps to powershell register ocx vbs

Asked By 40 points N/A Posted on -
qa-featured

How to do the power shell register OCX VBS? Is there any websites that explains about the power shell register OCX VBS?

SHARE
Best Answer by Nichols Fryman
Answered By 0 points N/A #137157

Steps to powershell register ocx vbs

qa-featured

Hi chad,

Using the power shell script to register. You can use the script control from the commandline.

It works the same as in C# in POwerSHell .

It is a com object.

$a = new-object -comobject MSScriptControl.ScriptControl
$a.language = "vbscript"
$a.addcode("function getInput() getInput = inputbox(`"Message box prompt`",`"Message Box Title`") end function" )
$b = $a.eval("getInput")

Best Answer
Best Answer
Answered By 15 points N/A #197301

Steps to powershell register ocx vbs

qa-featured

Hi Chad,
There are multiple ways to register the ocx file.
Solution 1: Register file through the system properties
The steps to register OCX file are as mentioned below:
1) Click 'Start', Select 'My Computer'
2) Select the file required, right click and select 'Open with' from the menu
3) Navigate to the 'windowssystem32' directory and select 'regsvr32.exe' file
4) Click 'Open' to select the file, Click 'OK'
5) After the process is complete, you will receive a successfully registered message

Solution 2: Register file through VBScript
1) Select the file located in the system hierarchy
2) After the file is located, use the bit code mentioned below to register the file
3) Set oShell=CreateObject("Wscript.Shell")
oShell.Run"RegSvr32/s" &char(34)& "Pathtofile.ocx" &char(34)
4) Execute the code and your ocx file will be registered

Related Questions