Scripting. Stuff. (By Froosh)

January 6, 2009

Byte Array and SID manipulation class and component

Filed under: VBScript — Froosh @ 11:41 am

In a move that is a little like Marge re-using the 1 stylish dress she found, I’ve wrapped my old Byte() and SID manipulation code into a VBScript Class and a Windows Script Component.

The class code can be directly used within your VBScript VBS/WSF file, or included in a WSF package with the <script src=…> tag.

The Windows Script Component needs to be installed on each machine it will be used with and registered with “regsvr32 scrobj.dll /n /i:<path to wsc file>”.

Alternatively, it may be possible to use the WSC without registering it as in the following snippet:

Set objComponent = GetObject(“script:c:\COM\MyComponent.wsc”)

This loads the first (or only) <component> section and is usable the same way as calling CreateObject(“MyComponent”). One upside of this is that normally component registration requires administrator rights, but using a WSC this way does not.




  1. […] Hex SID to Decimal SID Translation Filed under: VBScript — Froosh @ 11:46 am Update: I’ve rolled this into a VBScript class and a Windows Script Component. […]

    Pingback by Hex SID to Decimal SID Translation « Scripting. Stuff. (By Froosh) — January 16, 2009 @ 1:47 pm

  2. Hey that’s great stuff. One thing though that I see in all this is code (I’ve found a lot of examples, but I like this so far the most…) — when the SID is converted, why don’t I find the 28 byte output that one would expect? I want to plug a Local machine’s SID into hex form into the registry, but I can’t find one that outputs the correct form. I may just missing something quite obvious. I can send an example if you think you can point me in the right direction.

    Comment by Djimi — June 12, 2009 @ 10:45 am

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: