Case Else:

/*** Code’s last stand ***/

Case Else: Horseshoe waterfall outside Kitimat, BC

Matching Arbitrary Name Lists in Active Directory

September 14th, 2008 · 4 Comments

This Hello, My Name is stickerscript will take a CSV file of two columns — ostensibly in ‘last-name, first-name’ format — and attempt to convert it into valid userIDs, despite irregularities in the list.

[Read more →]

→ 4 CommentsTags: Uncategorized

Why not to use Excel for Data Gathering

August 6th, 2008 · 17 Comments

Here’s a request that happens fairly regularly in different offices I’ve been associated with:

  1. We receive surveys/orders/documents that have been filled out by various people as Excel spreadsheets
  2. We need to put the information into a database
  3. We want you to write a script to automate the imports.

My thoughts as a scripter: [Read more →]

→ 17 CommentsTags: Uncategorized

Multithreading in Batch Script, Part 2: Running Code

May 22nd, 2008 · 5 Comments

Wherein we take the multithread concept, and run like blazes.
[Read more →]

→ 5 CommentsTags: Batch Scripts

Multithreading in Batch Script, Part 1: An Example

May 22nd, 2008 · 9 Comments

Multithreaded applications have the potential to run much faster than single-threaded applications, given the right circumstances. With batch scripts, we often write routines that spend a lot of their time waiting for other things to finish; downloading sets of files, for example, or pinging a range of servers to see if they are alive.Various Agent Smiths Blocking functions (ie, where the scripts stalls until they are done) that spend their time waiting for other things are the big beneficiaries of multithreading. With some care, we can get the same benefits by ‘multithreading’ our batch scripts.

[Read more →]

→ 9 CommentsTags: Batch Scripts

Recursion in Batch, Part 2: a tree command

May 21st, 2008 · 2 Comments

FileTree is a rewrite of the Tree.com command.Motivational Poster for Recursion FileTree started off as a simple example of recursion, but turned out to be 2K long–so play with it if you wish. It turned out much better than I had anticipated; and it uses some Batch geek tricks to make things work. Treeing is the quintessential recursive *thing*. Without recursion, this sort of command would likely be impossible in Batch, and pretty damn hard in other languages.
[Read more →]

→ 2 CommentsTags: Batch Scripts · dev · scripting

Recursion in Batch, Part 1: An Example

May 21st, 2008 · 2 Comments

Recursion is one of those epiphanous things; people don’t seem to grasp it at first, but once you do; it can streamline a lot of problems. I started jotting down an illustration of recursion for a coworker, and it got complicated, and then it turned into an application, so you get two. Both are batch files (don’t ask . .. it was just for sport)

[Read more →]

→ 2 CommentsTags: Batch Scripts · dev · scripting

How to close open files on a server share

May 17th, 2008 · 17 Comments

One of our departments needed to upgrade software on a number of their servers, but it is an application that users like to leave running when they leave at night, and the connected files keep the upgrade from working. They needed to close thousands of open files in the application shares on several hundred servers.

They asked me if there’s a way to close all of the connected files in the application shares on those servers. I put together this little batch script to do just that.
[Read more →]

→ 17 CommentsTags: Batch Scripts · dev · scripting

Timezones from the Commandline

May 16th, 2008 · No Comments

Timezones need to be set, sometimes. We move machines all over the country, and they need to be right when they get there. We’ve used various scripts in various languages to set the time and the timezones, but there is also a hard-to-find command line that will accomplish the task.
[Read more →]

→ No CommentsTags: Batch Scripts