Showing posts with label ie. Show all posts
Showing posts with label ie. Show all posts

Thursday, February 15, 2007

Scripting Games 2007 - Live Scores

This little script will parse the scores table on the scripting games website and output the results into the console. It is working kinda slow due to some PS inconsistencies regarding IE automation, so I'll have to keep on checking on it . Meanwhile, get your own results ;-)

 

[string]$url="http://www.microsoft.com/technet/scriptcenter/funzone/games/games07/psascores.mspx"
$ie=new-object -com internetexplorer.application
$ie.visible=$true
$ie.navigate($url)
while($ie.ReadyState -ne 4) {start-sleep -m 500}

$ds = new-object "System.Data.DataSet" $ds.Tables.Add("score")
[void]$ds.Tables[0].Columns.Add("Name",[string])
[void]$ds.Tables[0].Columns.Add("Country",[string])

1..10 | foreach {
    [void]$ds.Tables[0].Columns.Add("e$_",[string])}
    [void]$ds.Tables[0].Columns.Add("Total",[string])
    $table = $ie.document.getElementById("E4")
    $trs=$table.GetElementsByTagName("TR")
    $trs | foreach {     
        $tds = $_.GetElementsByTagName("TD")     
        $x=0     
        $dr = $ds.Tables[0].NewRow()     
        $tds | foreach {$dr[$x] = $_.innerText}     
        $x++
    }
}   

$ds.Tables[0].Rows.Add($dr)
$ds.Tables[0].rows[0].delete()
$ds.tables | ft * -auto

$hay

Tuesday, January 23, 2007

Open In Regedit (IE Context Menu)

About a year ago I contributed a tool I wrote, called "Open In Regedit", to Daniel's Petri IT knowledgebase. (You can read Daniel's review here).

Since I run my own blog now, I decided to re-publish it here and also check if it will run on Windows Vista.

Open In Regedit is a Context-Menu enhancement for Internet Explorer. While browsing the net for some articles , KBs and other system related issues, often you will have to make some registry modifications.

Usually, you will write down copy-paste the key , open regedit.exe and navigate your way inside. Well, not anymore.

Open In Regedit enables you to highlight registry paths written inside web pages, right-click on them and launching regedit.exe with the specified key location already highlighted (depends if the key already exists).

I tested it on Win XP SP2 (IE6) and Windows Vista (Business edition IE7). I have found that the difference between a registry path in XP and Vista is the Prefix "My computer\path_to_key_or_value" and "Computer\ path_to_key_or_value " respectively.

Play with it, and if you find a bug or even extended it in your way, then fill free to drop a comment. You can download it here.

$hay