VBScript Complex Regex Replace

A few days ago I posted a blog entry on simple regular expression replacements in VBScript. Let me show you a more complex example. It helps to have a purpose, even for demonstration so my need is to convert an html table to CSV output using regular expressions.

Read More

VBScript Simple Regex Replace

Last week I talked about using Regular Expressions in VBScript. In that post I focused on simple matching. However, you can also do string replacements using the regular expression object’s Replace() method. You specify a string to replace and its replacement text. I always test the expression to make sure the string exists before doing anything. Here’s a function I use for this task.

Read More

VBScript Regular Expressions

I seem to find my self turning to regular expressions more often these days, often to help out a fellow scripter in one of the many scripting forums I keep tabs on. I thought I’d take a moment and provide a brief explanation on how to use regular expressions in VBScript. First off, for those who don’t know, a regular expression is a way of identifying or matching a string against a pattern. For example we all know that 172.16.100.200 looks like an IP address because of its pattern. The string roygbiv@rainbow.net looks like an email address, again based on the pattern. A regular expression can be used identify strings based on a pattern.

Read More

Sometimes all you need is an editor

System Administrator are a busy lot and some of them literally run around all day fighting fires on computers no longer connected to anything. Others use remote access to tend to a large number of servers. Or both. Thanks to scripting, most repetitive tasks are taken care of. But sometimes you need to double check […]

Read More

Up a Tree

One of the first CMD commands I fell in love with (yes I’m that geeky) was TREE. When executed from a command prompt it would give you a nice graphical representation of the directory structure. Never being satisfied I wrote a VBScript version years ago. I decided to dust it off and tweak it some. Here is TREE.VBS.

Read More

Using the VBScript Dictionary

I don’t want you to think that it is PowerShell now and forever more. VBScript isn’t going away anytime soon and I still answer plenty of VBScript questions in the forums at ScriptingAnswers.com. A topic that has come up several times in recent days is the Dictionary object. It is easy to use in VBScript and often comes in handy. Let me show you how.

Read More

New Logon Script Wizard

PrimalScript 2009 ships with a new Logon Script Wizard, generating VBScript code and providing easy customization. Most of the items are straight forward, like drive and printer shares. You can edit your Welcome message right there in the wizard and specify external command line tools to be executed. The section with the custom VBScript actions […]

Read More

Are you leading me on?

Recently in the VBScript forum at ScriptingAnswers.com there was a question about creating a file name from the current date, but with leading zeros. This is a pretty common question. It is easy enough to get the month or day portion of the current day.

dy=Day(Now)

However there is no VBScript function to format this to provide a leading 0. Neither FormatDate or FormatNumber can help. So instead I offered a function. Here is a modified version of what I originally offered that is a little more flexible.

Read More

So when is PrimalScript 2009 being released?

The PrimalScript 2009 code is locked and loaded! We are just putting on some finishing touches and getting all of the “accoutrements” in place so that the purchase and upgrade experience is as smooth as possible. We will be doing our final testing of everything Valentine’s weekend and expect to go LIVE by Tuesday, Feb. 17th. PrimalScript 2009 is […]

Read More

Where do I begin?

“I’m new to scripting and need a book recommendation.” “Should I learn VBScript or PowerShell?” “What are some good books for learning scripting?”

These are natural and common questions. A few years ago the answers would have been simple. But today if you are just getting started with administrative scripting, the answers only bring more questions. The real question isn’t what book should you read but what technology should you learn? If you are a a SAPIEN blog reader I’m going to assume that the choice comes down to VBScript or PowerShell. The quick answer is to learn both, but I realize that’s not practical. So let’s look at this a bit further and realize that some of this will change once PowerShell v2.0 is released as part of Windows 7 and depending on your adoption of Windows 7.

Read More

Search

Enter any query and press enter
Advanced search operators:
+ ⟶ Term must appear
- ⟶ Term must not appear
"" ⟶ Exact string must appear
How do I use these?

Join our mailing list

Enter your email address to subscribe to our mailing lists for Monthly Blog Digests, Product Announcements and more (you can choose which you receive once you sign-up!)

Tags

Categories

Archives

Dashboard