Creating GUIDs with Javascript Windows scripting host

18Aug10

I need to do some scripting from time to time, and I usually use Javascript to do everything. I needed to generate GUIDs for some CRM data that I wanted to create programmatically. I found this article from the Microsoft Scripting Guy.

He gave the example in VBScript, so here is the equivalent in JScript:

function guidGen() {
    var typeLib = new ActiveXObject( "Scriptlet.TypeLib" );
    return typeLib.Guid;
}
Advertisements


No Responses Yet to “Creating GUIDs with Javascript Windows scripting host”

  1. Leave a Comment

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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


%d bloggers like this: