- Home
- Blogs
Blogs
Automatically launch a webpage in the background and then close it after a certain time
- By Ramesh Srinivasan
- Published
Q: I have a tip request I think might be useful to others. I have been looking around for a way to use Scheduled Tasks to launch a webpage in the background and then close it after a certain time. I do not have cron jobs on my website and the newsfeeds are cached for about 2 hours. The site is new so some pages may not be accessed as often and then the first person to access one of these pages if the cache has expired has to wait a little too long. I thought since I work on my pc for a good part of the day I could use Scheduled Tasks like a poor man's cron and call these pages every few hours to make sure there is always a cached copy. --Burt.
A: I've written a small script that'll do the task for you. Change the URL in the following script (opens Google.com by default) and set the wait time accordingly (60 seconds wait time) before the IE window will be closed automatically.
("InternetExplorer.Application", "IE_")
objExplorer.Navigate "http://www.google.com"
'Determines if the window is visible or not
objExplorer.Visible = 0
'Suspend the script for 1 minute
WScript.Sleep 60000
'Close the IE (instantiated) window
objExplorer.quit
Sub IE_onQuit()
Wscript.Quit
End Sub
Copy the above lines and paste the contents to Notepad. Save the file with .VBS extension (launchsite.vbs). You can then schedule this script to run at specific intervals
Q: I've installed Media Info Exporter from the Winter fun pack (Microsoft). When I export my song list to Word or Excel the track length is in seconds. I want to convert the seconds to mm:ss format, like it displays in Windows Media Player. How do I do that?
A: I'm not sure if this setting is configurable in Media Info Exporter plug-in options, but you can accomplish this using Formula in Microsoft Excel, or perhaps by writing a Macro. Here is a Macro that should do the task:
Dim rng As Range, cell As Range
Set rng = Range("g2:g50")
For Each cell In rng
If cell.NumberFormat = "General" Then
cell.Value = cell.Value / 86400
cell.NumberFormat = "mm:ss"
End If
Next
End Sub
FYI: Column G contains the Track Length, and this script takes the cell range G2:G50. If you have too many lines, you may have to modify the cell range in Macro accordingly.
Retrieving BIOS information using WMI
- By Ramesh Srinivasan
- Published
I'd like to know if there is a way to determine the BIOS version of a given computer without rebooting and entering the BIOS at boot. In other words, is there some utility within XP that will display the BIOS version?
The BIOS information can easily be retrieved using a WMI script. Also, the same script can be run against a list of computers in your network and generate the output from the machine where you sit.
Here is a sample script that gathers the BIOS information from the local system. (Watch for line wraps)
Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMI.ExecQuery("SELECT * FROM Win32_BIOS")
For Each itm In colItems
strBIOSVersion = Join(itm.BIOSVersion, ",")
WScript.Echo "BIOSVersion: " & strBIOSVersion
WScript.Echo "BuildNumber: " & itm.BuildNumber
WScript.Echo "SMBIOSBIOSVersion: " & itm.SMBIOSBIOSVersion
WScript.Echo "SMBIOSMajorVersion: " & itm.SMBIOSMajorVersion
WScript.Echo "SMBIOSMinorVersion: " & itm.SMBIOSMinorVersion
WScript.Echo "Version: " & itm.Version
Next
Additional resources
Microsoft Windows 2000 Scripting Guide - Retrieving Information About the BIOS
My laptop is running Windows XP Professional and is connected to a domain. The IP address is obtained automatically from the router but the DNS entry is manually entered based on the domain controller's static address. All works fine. I want to make it easy for the user to take the laptop and use it on other networks where all the TCP/IP information is obtained automatically.
I have considered using the Alternate Configuration except that there is a DHCP server on both networks. Both networks have routers which are DHCP servers and the Alternate Configuration assumes that it won't find one in order to switch configurations. The only parameter that is different is either a manually configured DNS entry or an automatically assigned one.
You can create a script that sets the DNS addresses automatically. Another script (home.vbs) can set automatic DNS for your home configuration.
Please see this ready-made script from the Microsoft Script center. You can tailor this script as per your requirements.
How Can I Configure a Computer to Use a Dynamically-assigned DNS Server?
That article tells you how to set the DNS settings to manually assigned address, and the later part explains how to set the DNS address settings to automatic.
I've tried the script and it works very well, and the settings are immediately applied without needing a reboot.
Q: I used the Windows Update Catalog to download the fixes locally. the problem is that it downloads the updates to different folders (seperate folder for each update) and if there are hundred updates, I have to go into each folder and move the .exe files to a separate folder. This is time consuming.
How do I organize the updates (move the .exe files to a separate location, say D:\AllUpdates)
A: You may use the file search feature in XP to accomplish this task. Assuming that you've downloaded the WU fixes to this location:
C:\Hotfix\WU\Software\en
Do a file search in this folder (and sub-folders). Search for all the *.exe files, and when the search result appears, move the executables to a new folder of your choice (D:\AllUpdates). All the executables are in one location now.
