Windows Shortcuts Made Easy with VBScript


Oftentimes desktop administrators need to create Windows shortcuts from within their scripts. VBScript makes this task very easy. Here’s a script that can run as a stand-alone command-line application or be incorporated into a larger script for creating these shortcuts.

Read more ...

Convert Text Files Between Unix/DOS In VBScript

Silver Pen and Notebook

If you’ve ever downloaded a text file onto a Windows computer and been disappointed with how it looks in Notepad, then this article may be for you. Here’s a way to quickly convert those Unix-formatted text files to something Windows can make sense of.

Windows and Unix formatted text files have one key difference—how they represent line breaks. Unix uses only a linefeed character (ASCII 10) whereas Windows uses both a carriage return (ASCII 13) and a linefeed. This is why sometimes

Read more ...

Delete Empty Folders in Windows Programmatically with VBScript

Empty Folder

I’m sure you, like me, have more data on your computer than seems possible! Alas, this is the reward of downloading too many files, saving too many pages and plain old trying to keep everything just in case. You’ve also probably tried to remedy the problem by creating folders and subfolders to organize all that stuff. This is what I have done and after searching and deleting certain files and file types, I ended up with numerous empty folders. Here’s how to get rid of them.

Read more ...

Mass Change Genre Tag of Music Files in Windows Media Player 12

Edit Genre in WMP 12

This seemingly easy solution escaped me for longer than I’ll admit! I just wanted to change the genre tag to something new and I didn’t want to do it one file at a time.

On Windows 7, open WMP 12 and click genre under the Music option on the lefthand side. This will display a list of the genres in your media library.

Read more ...

Delete Duplicate Records in MySQL

MySQL Logo

How can you delete duplicate records in MySQL? Well, first you need to define what constitutes a duplicate record. After that you just need to. . .

Read more ...

Convert VB6/VBA Code to VBS

Having worked with all of Microsoft’s Basic languages, I’ve built up various collections of functions and procedures in all of them. Even though they are different languages, they are syntactically very similar. Here’s a conversion script to output VBS versions of your legacy VB6 and VBA code.

Read more ...

Replacing IF and SWITCH Statements with a Hash in JavaScript

If you’ve ever found yourself using if or switch statements to return or print a string response, then have a look at an alternative method that will greatly simplify such code.

Have you ever seen code like this, or maybe even written it yourself?

Read more ...

PHP’s Very Useful “HEREDOC” Syntax

Strings can be stored three different ways in PHP. I talked about two of them in a previous post. Now I’ll discuss the most powerful, yet underused, of the bunch.

Ordinarily I use single quotes when storing strings in PHP. But sometimes I have to use double-quotes as the two methods of quoting have tradeoffs. A third possibility, known as

Read more ...

Create List of All Songs in Windows Media Player Library on Windows 7

If you’d like to have a list of every song in your media player library to display in a web page or print or any other purpose, you’ll discover this is not easy to do without third-party software. Here I present a totally free solution that requires no extra software at all.

Read more ...

PHP’s Identity Comparison To The Rescue

Here’s a PHP gotcha that stumped me for awhile not too long ago. It reminded me to pay attention to how comparisons are actually made.

Read more ...

Generate A Random String In VBScript

Always a need for that random string in programming. Here are three ways to generate one in VBScript.

First of all there’s the

Read more ...

Add Row Numbers to MySQL Results

Sometimes when querying MySQL I like to return a new column containing an ordered numerical sequence for each row in the result set. Here’s an explanation of how to do it.

I suppose this isn’t really needed in many, if not most, queries, but sometimes it’s just what I want. As an example, I have

Read more ...

Change the Targeted .Net Framework Version in Visual C# 2010 Express

Visual C# 2010 Express uses the .Net 4.0 framework by default in its WPF project template. You can, however, change the framework version targeted by your application. For example, you want your app to run under .Net 3.0 so that Vista RTM is supported. This can broaden the reach of your application.

Sometimes I write WPF apps that require the broadest installation base possible, and that’s .Net 3.0. This allow

Read more ...

Download a List of Files from the Internet with PowerShell

PowerShell’s ability to leverage the .Net framework can be really handy. With ease it can download a slew of files from the ‘Net. Just watch this.

Ordinarily, if you want to download a bunch of files from the ‘Net you would queue them into a download manager. But, with PowerShell, a simple script is all it takes to

Read more ...

Overlooking The Obvious – Trouble Installing Oracle Database 10G Express In Oracle Linux?

If you’ve tried installing the Oracle 10G Express database on a Linux computer, you may have had a really tough time ever getting the thing to start. It’ll install alright, but actually running. . . that’s another story. Read on for a description of what should’ve been a typical software installation that went inexplicably wrong, the easy-to-overlook problem that caused it to fail and the oh-so-simple solution that finally made it work.

Read more ...

How To Change the Default Web Folder in Expression Web 4

Someone asked me today how to change the default web folder in Expression Web 4. If you’d like to do this read on.

Read more ...