Archive for November, 2008

VBS script to rename files

November 19th, 2008

So an upgrade gone wrong at my current client site (no I was not doing the upgrade!) caused about 30 file names to be renamed into a 8.3 format.  This little incident brought operations to a halt in almost every branch!  No pressure for the consultant, right!

VBS script to the rescue.  Just create a input (text) file which has the bad file name, the delimiter of your choice, and the correct file name.  It looks like this (with “#” as my delimiter):

badname1.txt#goodname1.txt
badname2.txt#goodname2.txt
badname3.txt#goodname3.txt
etc....

Place this script in the same folder as the input file, change the Path variable to the path containing the files, then run the script.

Const ForReading = 1
 
On Error Resume Next
 
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.OpenTextFile(".\name_changes.txt", ForReading)
var1 = f1.ReadAll
var2 = Split(var1, vbcrlf)
path = "C:\Test"
For i = 0 To UBound(var2)
                badName = left(var2(i), instr(1, var2(i), "#", 1) -1)
                goodName = right(var2(i), instrrev(var2(i), "#", -1) -1)
                Set filA = fso.GetFile(path & "\" & badName)
                filA.name = goodName
Next
msgbox "All Done!"

By the way, when I showed this script to my son his reply was, “well, that’s not that impressive…”

hmmmm…

In order to use Operations Manager 2007 Web Console it is required for JavaScript to be enabled

November 17th, 2008

I came across this issue recently at a client site.  I installed System Center Operations Manager SP1 on a Windows 2008 server.  I had followed the guidance given on

Walter Chomak’s blog to choose the roles/features required to support OpsMgr. 

Error when accessing web console on Windows 2008 server

Error when accessing web console on Windows 2008 server

All was working fine until I tried using the web console.  I was getting an error which seemed to indicate I had a browser issue:

 

 

When I added CGI support to the Application Development Role Service on my RMS the web console page came up fine on my client machine. W00t!