Winhelponline.com

Blogs

(Page 2 of 2)   « Prev  1  
2
  
Next »

Q:  Is there a way to create a batch file which would put a desktop icon onto the desktop which invokes an html page in a web browswer (MSIE) and change the associated icon for that particular desktop item, all in one batch file? Thanks

A: Yes. This is possible. Here are some examples:

--------------------Launches a HTML page---------------
echo [InternetShortcut] >"%userprofile%\desktop\localpage.url"
echo URL=C:\myfile.htm >>"%userprofile%\desktop\localpage.url"
echo IconFile=C:\favicon.ico >>"%userprofile%\desktop\localpage.url"
echo IconIndex=0 >>"%userprofile%\desktop\localpage.url"
------------------------------------------------------------
--------------------Launches a website--------------------
echo [InternetShortcut] >"%userprofile%\desktop\google.url"
echo URL=http://www.google.com/ >>"%userprofile%\desktop\google.url"
echo IconFile=e:\Backups\google.ico  >>"%userprofile%\desktop\google.url"
echo IconIndex=0 >>"%userprofile%\desktop\google.url"
------------------------------------------------------------

Q:  The article How to automatically delete folders that are n days old? is so useful. I have sub-folders such as the following:

  • D:\Reports\20051101
  • D:\Reports\ABC_20051101
  • D:\Reports\20051102
  • D:\Reports\ABC_20051102

I need to delete the folders which begin with the letters ABC. I used the same script as you suggested, but, I'm not able to delete the folders because there is no Select query. My requirement is to delete the folders start with the ABC name and the folders should be 2 days old. --Thanks, Gayatri

A: The same script can be modified slightly to accomplish this. In the last part, you may add a line of code to check if the first three characters of the folder contain string ABC.

For Each fName in fNameArray
    'This line checks if the first three chars are "ABC". If so, deletes the folder
    If left(fName,3) = "ABC" then
        FSO.DeleteFolder(BasePath & "\" & fName)
    End if
Next

Note that the above snippet is only a part of the actual code, available at this link.

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.

Set objExplorer = WScript.CreateObject _
("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:

Sub Macro1()
    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.

MS06-013 Cumulative Security Update for Internet Explorer has been released. Known issues are documented in the following KB article

MS06-013: Cumulative security update for Internet Explorer

Note that this cumulative update issues a new version of MSHTML.DLL and the solves a problem that was caused by Internet Explorer ActiveX update - 912945.

Those affected by the above problem (refer my previous blog post) may need to register the DLL file again. Type regsvr32 /i mshtml.dll in Start, Run dialog.

Recently Microsoft issued an ActiveX update that changes the way in which Internet Explorer handles some Web pages that use ActiveX controls.

The MSHTML.DLL file that shipped with this update however had a serious problem. Here are the steps to reproduce the problem in a test computer.

Important: The following steps are to be done in a test system if you're wanting to replicate the problem.

1. Install Q912945 update and reboot.
2. Click Start, Run and type regsvr32 /i mshtml.dll

Try to open System Restore, User Accounts and other things that use MSHTML.DLL. All the dialogs will be blank, and you'l be unable to use IE.

DllInstall and DllRegisterServer method updates several registry values with wrong data, instead of setting the
full path to the DLL file. This is purely a bug in this version of MSHTML.DLL (6.0.2900.2838)

To restore the functionality back:

Uninstall Q912945 update via Add/Remove Programs applet and reboot. After rebooting once, re-run the regsvr32 /i mshtml.dll command again. Then reapply Q912945 if you need it.

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)

strComputer ="."
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

Microsoft TechNet: Scriptomatic Tool

Scriptomatic 2.0: Readme

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.

(Page 2 of 2)   « Prev  1  
2
  
Next »
No blogs found.
No popular articles found.