Tuesday, September 21, 2004

 

Another reason to Scriptomatic

I found this on Brian Redmond's Weblog

Basically you browse many of the WMI classes available and it will create runable scripts for you. Download here: http://www.microsoft.com/downloads/details.aspx?displaylang=en&familyid=9ef05cbd-c1c5-41e7-9da8-212c414a7ab0 It is also worth mentioning a newer Scriptomatic for ADSI. I have not used this one, but if it is half as good as the WMI one, it will be a good utility to have on hand. http://www.microsoft.com/downloads/details.aspx?familyid=39044e17-2490-487d-9a92-ce5dcd311228&displaylang=en Go be a Scriptomanic!!!

Blog Entry

Thursday, September 16, 2004

 

TCP/IP Networking update from the guys over at Microsoft

It looks like we have another critical update being pushed out from Redmond, Wash. The GDI+ component processing of JPG files suffered from a buffer overrun issue, which thankfully did not include Windows XP SP2 on its list of affected software. This further highlights the need to update your computer to the latest Service Pack to avoid problems the other side could present when reverse-engineering what great work was done in SP2.

Anyway on to the good stuff... Here is a new link for Automating TCP/IP Networking on Clients which just got published on the first of September. - Enjoy


Sunday, September 12, 2004

 

Office Shortcut bar lives!

Does anyone remember the screen saver button we used to have in the Office Shortcut Toolbar? In fact does anyone remember the Office Shortcut Toolbar? This handy little application was removed somewhere between Office XP and Office 2003. The only reason I can think of for this was the inclusion of toolbars in Windows XP in the Task bar to allow you to create your own Shortcut bar in Windows XP. Using this Toolbar feature on the Task bar in Windows XP or Windows 2003 Server for that matter we can re-create the Office Toolbar along with that special Screen Saver button we all miss.

Once you have moved the toolbar to the correct location it should be displaying all the Office icons. We now need to make some touch ups.

Now for the reason I was posting this blog entry in the first place ;-) - The Screen Saver button! Now we need to fire up trusty notepad and run through the following code:

Set oShell = WScript.CreateObject ("WSCript.shell")

Set WMIService = GetObject("winmgmts:")

Set colComputerSystem = WMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")

For Each objProperty in colComputerSystem

strUsername = replace(objProperty.UserName, "\","\\")

Next

strWQL = "SELECT * FROM Win32_Desktop WHERE Name='" & strUserName & "'"

Set colDesktopItems = WMIService.ExecQuery(strWQL)

For Each objDesktopItem in colDesktopItems

oShell.run bjDesktopItem.ScreenSaverExecutable

Next

In this script it is just a matter of finding the current user logged on to a Windows system and then looking up that users Desktop settings and running the Screen Saver entry. It's that simple.

So save this file and add it as a shortcut into the folder we have selected for our toolbar. Once this is done you can edit you scripts shortcut and change the icon associated with the script.


 

WMI Software Development Kit and XP SP2

I was downloading the Windows Management Instrumentation (WMI) SDK on my Windows XP machine with SP2 installed when the inbuilt pop-up blocker in IE detected a pop-up. Now I do understand that the MSDN site along with the Microsoft.com site are very large, yet its a bad example for Microsoft to still be using pop-up windows on any site. Especailly after the release of Windows XP SP2 pop-up windows are a big no no. Microsoft developer information for XP SP2 pop-up windows page.

Saturday, September 11, 2004

 

Anyone else hate QuickTime trying to control your PC?

I can't think of anything more annoying then when a program keeps registering itself to load at computer startup each time it runs. This is an install option that is at most a once only yes or no answer and then this option should be some where in the options menu for the program if necessary.

QuickTime will keep adding itself into the Registry's Run - "Key path". This is very annoying even if you have Windows XP and can use the msconfig utility (which is a really good utility by the way START > RUN > MSCONFIG - note this was introduced in Windows 98 yet was not made available in W2k for some reason). So here is a little script you can use to avoid QuickTime from loading up in the System Tray the next time you login into Windows after running QT.

The best place to add this script is in the logging off sequence of Windows. That way you don't have to turn the computer off to remove the registry key you just need to log off.

So first the script then i'll show you where to add the file for logging off.

const HKEY_LOCAL_MACHINE = &H80000002

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"

strStringValueName = "QuickTime Task"

oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strStringValueName

Once you have saved the above script to a file eg. c:\scripts\del_quicktime_key.vbs you then need to tell Windows to run the script when you log off.

First Open the Microsoft Management Console (Note this will not work for Windows XP Home). Start > Run > MMC. Then File > Add snap-in > Add > Group Policy > Add > Finish > Close > OK. --- Man I don't remember this process being so long (Note if you find that you want to Edit the Group policy many times you can now select File Save As and save the current arrangement of the console so you do not have to run these steps again). Once you have got the Group Policy just select User Configuration (as we want to do this on a user basis not when the Computer turns off) then select Windows Settings > Scripts (logon/logoff) Open the LogOff option and then select Add then browse to your file and add it into the listing for scripts to run when users logs off.

Now we could have used the registry to do this, yet only the first time we do this would it have been faster. Say we wanted to do the same thing again. Now ee could just do the following:

As a rule if you don't have to manually edit the registry (apart from scripts of course) use another method eg. msconfig or another graphical user interface.


 

MS Scripting Guy's broken link...

Now I'm guessing the guys over at The Scripting Guys' First Blog are pretty busy, yet early last week due to my scripted XML news aggregator ( note: ill post on this later - remind me! ;-) ) I noticed within a few hours of them posting a whole bunch of links on their blog that the URL they had used was internal and could not be accessed by the Internet. So I quickly fired off an email if not only to inform them but to say thank you for all the good work they had been doing. Yet a week later and my inbox still empty from emails from the scripting guys they change the link? Very strange. While i'm talking about the posted links (and they are working) I'll suggest you go visit them by heading over to the Hey, Scripting Guy! site

 

Things to do first!

The first couple of sites you will need to study up on if you're new to scripting are the following... Scripting Concepts and Technologies for System Administration

Windows Script (MSDN)

TechNet Script Center Sample Scripts (CHM file) The view Scripting Guy's Webcasts (Great for newbies!)

 

First Entry

If you're reading this blog in ascending order you should really be starting with The Scripting Guys' First Blog as this is what I did. This is also a great site for getting inside information about scripting at Microsoft. To start this blog off I should introduce myself, my name is Cameron McBride and I work for the Shared Services Group which look after the Northern, Western and Melbourne Health Information Services Department's in Victoria, Australia. I am currently the co-founder of the Melbourne Pocket PC User Group and I host a Technology News Site Itnewslog.com. I started this site to create a repository of all the scripts I have been working on, continue to work on and why. The second reason obviously is to share this information with anyone who is interested in working with scripts to automate tasks at both a home user level (eg. Windows XP) or at a professional level (eg. and Active Directory Service Interfaces and Windows Management Instrumentation). The main reason I like scripting would be that you can sit at the majority of computers on the planet and provided you have the correct access you can accomplish a considerable amount of work with very few lines of code. The other great part is that you require no additional tools then what ships with Windows 2k, 2k3 and XP -- notepad works just fine, and besides it's always good to watch a computer do your work for you ;-)

This page is powered by Blogger. Isn't yours?