Posts Tagged ‘com’


Changes are coming to the script packager

Monday, June 3rd, 2013 by Alex Riedel
The Script Packager has been a key feature of PrimalScript for many years now. Devised originally in the Windows 2000 era, it has some features that simply are no longer relevant or applicable in modern Windows versions. As many of you know, the packager has the ability to self-extract data files and COM objects when invoked. In that regard, packages work very much like a self-extracting ZIP files. Obviously that method did impose some size limitations, but it has worked well for many years. Starting with Windows Vista and Windows Server 2008, this self-extracting nature of script packages became more…   More »

Registry access from 32 to 64 bit and back

Tuesday, August 18th, 2009 by Alex Riedel
Just recently, I received an email asking how you can access the 64 bit registry from a 32 bit script, or vice versa. The task the individual was facing was to come up with a way to verify installed applications via checking the corresponding Windows Installer registry entries. For a C++ programmer with access to the API, that really is not a big issue. From VBScript, using only WshShell.RegRead that is a completely different story. A quick consult with some fellow script experts revealed that the only real way was using WMI and the StdRegProvider. The main complaint I heard…   More »

More fun with Microsoft Word and PowerShell

Friday, August 15th, 2008 by Jeffery Hicks
I needed a demonstration for one of my last online PowerShell classes on using COM objects in PowerShell. I took an old VBScript that used Microsoft Word to get document statistics such as word and page count and transformed it into PowerShell. I quickly realized I could flesh out the demo into a larger function that I can actually use. Given that I generate a lot of Word docs, being able to get some document statistics is helpful. So I created a function called Get-DocStatistic.   More »

PowerShell and COM objects.

Thursday, August 7th, 2008 by Alex Riedel
While developing a COM object for scripting use I wanted to provide a VBScript sample as well as a PowerShell sample. While creating the PowerShell sample I received an unexpected error message when setting a property value. Some quick review shows that PowerShell 1.0 (I did not check with the 2.0 CTP yet) cannot handle write-only COM properties. Consider the following PowerShell script: $obj = New-Object -comObject "PropertyTest.PropTest" $obj.ReadWrite = "Some text" $readonly = $obj.ReadOnly $obj.WriteOnly = "some more text" The object's properties behave as they are named. If you run these instructions one by one in PowerShell you get…   More »

Searching Word

Monday, July 28th, 2008 by Jeffery Hicks
One of the last tasks I needed to accomplish to get Managing Active Directory with Windows PowerShell: TFM ready for publication was to assemble all the script samples. They'll be available for download from SAPIENPress when the book is published. I knew that most of the scripts were in my primary scripts directory, but probably not all. I usually copied scripts from my test environment to my scripts directory but I knew some were bound to be missing. I didn't want to manually open 16 chapters, search for script names, check if I had the script and then move it to a new folder. I don't have time for that. But I do have time to figure out how to do it in PowerShell.   More »

Better Sense for PowerShell

Tuesday, May 6th, 2008 by Don Jones
 PrimalScript 2007 build 566 (free to current PrimalScript 2007 owners - log into to download) includes significant updates to the product's "PrimalSense" code-hinting and completion feature. For starters, you'll now get PrimalSense for COM component ProgIDs when using the New-Object cmdlet to instantiate COM components - much like the PrimalSense VBScripters have had with the CreateObject() function. You'll also enjoy improved PrimalSense for .NET Framework classes, helping you squeeze more power from PowerShell by directly utilizing the vast functionality of the underlying .NET Framework. Be sure to download this latest service release and take advantage of this and other…   More »

Free FTP Component Updated

Wednesday, February 13th, 2008 by SAPIEN Technologies
Hop over to to download the new version of our free FTP COM component, which includes commands for changing directories and other functionality. This component is also included in the "PrimalToys" collection that is installed with all editions of PrimalScript 2007 (latest service release).…   More »