All posts tagged: VBScript

Sysinternals: Auto update script for sysinternals tools

I have written it many times but I like to say it again and again. I am a Sysinternals fan. I use their tools quite often, if not everyday. Sysinternals team releases updates to these tools often. These updates are either bug fixes or somtimes new features / tools. There are multiple ways to know about these updates Subscribe to sysinternals blog RSS feed and download the update manually Visit sysinternals website regurarly and get the updates when ever available Or many other ways…. I am not used to any RSS aggregators or readers. Even if I use one, I still have to manually download the update. It is the same case with visting their website. I wanted to write something to automatically update my sysinternals tools folder as and when there is an update. Again, there are multiple ways to achieve that. I could have written a RSS listener service which will look for updates in the Sysinternals feed and download the updates once they are available.  But that is too complex for a simple task like downloading files from a website. My method to achieve …

Bing developer APIs – A VBScript demonstration

Bing – the most talked about and the most innovative decision engine. There is lot of talk on the Internet about this already. I am not going to write a review on that here. I want to show how developers can use — using a simple VBScript — the power of Bing in their applications. Bing API offers open, flexible options for building or enhancing your site or applications. Developing an application with the new API is straightforward: Choose a SourceType (or SourceTypes—Search, Spell, Translation, etc), choose an output protocol (JSON, SOAP, or XML) and then customize according to your needs. Before getting started with BING APIs, you need to get a APPID from Bing. For more information on how to create a appid, refer to http://www.bing.com/developers. You will have to login using your live ID and create an APPID for the application you are creating. There is a nice API basics guide to get you started. Now, to the more interesting stuff..! [Code][/Code] First example: Spell check [Code lang=”vb”] Set http = CreateObject(“Microsoft.XmlHttp”) strURL = “http://api.search.live.net/xml.aspx?AppId=Your_APPID&Query=coffee&Sources=Spell” …

Obtaining WDS server IP from WDS PXE boot

Recently, I worked on some automation related to OS recovery using WDS and in that process I needed to obtain the WDS server IP address using a script. In this scenario, I used a custom WinPE boot image and no install image. Hence, I modified startnet.bat to invoke a custom application to do OS recovery. Coming to the subject of this post, when ever we use a WinPE boot image and use WDS PXE method to boot the client, boot server information is stored in WinPE registry as HKLM\SYSTEM\CurrentControlSet\Control\PXE\BootServerReply. Presence of this key itself indicates that the system booted off a WDS server. However, this entry is a binary value and does not directly give any information about WDS server name or IP address. We need to parse the a few bytes of information to obtain the right values. Within this binary value, IP address information starts at byte offset 20. So, here is the script to do that job Const HKEY_LOCAL_MACHINE = &H80000002 strComputer = “.” Set objReg = GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & _ strComputer & “\root\default:StdregProv”) strKeypath …

VBScript to change the default VHD / VM location

I have found numerous resources on the net to perform this using PowerShell scripting. However, doing the same in VBScript isn’t straight forward. I needed this piece of code for my HVS2008 UI project on Codeplex. I just worked on it and wanted to share the same here. You can download the script http://139.59.40.198/blog/wp-content/uploads/2008/10/changevmssdata1.vbs