Filed under App Update, Microsoft Updates by Ankit on February 27, 2010 at 12:51 am
no comments
Today I installed 5 WU on my Win7 Ultimate laptop. As nothing special to do on this night, I thought to write about them.
1. KB979306: Related to Daylight saving time and new time zone laws.
2. KB976662: IE8’s JSON interoperability in Conformance with new ECMAScript, 5th Edition.
3. KB977863: Cumulative update for media center for Windows 7. For a complete listing of issues fix, refer the KB article here
4. KB971033: Hero of the day! Update for Windows Activation Technologies, which detects activation exploits & tampering to key windows system files. KB article here
5. KB976264: Related to AppCompatibility issues. For a complete listing of the fixed issues, refer the KB article here.
Here, I want to discuss about the last update, which is related to Application compatibility issues. This fix is applicable for LongHorn SP2 and above and makes no registry key changes, no restart required. If I am wrong, This is the first AppCompatibility package for Windows 7 & Server R2.
Around 329 Apps fixed with this (on Win7). Like in NERO 8, Preview option should work when you open a photo in Nero PhotoSnap. Hmm! Sound useful fix as it covers many popular apps. FYI, it also (Hard/soft)Blocks around 52 Applications. Why? Just for making Your Windows Experience better!!

Filed under Microsoft Products, Microsoft Updates by Ankit on February 13, 2010 at 1:40 pm
2 comments
Introduction:
The kernel in Microsoft Windows NT 3.1 through Windows 7, including Windows 2000 SP4, Windows XP SP2 and SP3, Windows Server 2003 SP2, Windows Vista SP1, and SP2, and Windows Server 2008 RTM and SP2, when access to 16-bit applications is enabled on a 32-bit x86 platform, does not properly validate certain BIOS calls, which allows local users to gain privileges by crafting a VDM_TIB data structure in the Thread Environment Block (TEB), and then calling the NtVdmControl function to start the Windows Virtual DOS Machine (aka NTVDM) subsystem, leading to improperly handled exceptions involving the #GP trap handler (nt!KiTrap0D), aka "Windows Kernel Exception Handler Vulnerability."
Solution to the original problem:
Well, it’s a 17 Year Old Bug that MS guys fixed in this month’s Tuesday Updates.
http://www.microsoft.com/security/updates/bulletins/201002.aspx
In this release, they included 13 packages including the kernel fix.
Twist
After installing packages, System requests for reboot and once you do so, you may get BSOD. MS guys found that there is only one patch that requires un-installation to resolve the blue screen issue. KB977165 is the patch in question; the other patches do not seem to cause the blue screen behavior and do not need to be uninstalled.
So, focus is on that KB only. Here is its bulletin:
http://www.microsoft.com/technet/security/bulletin/ms10-015.mspx
http://support.microsoft.com/kb/977165
Now What??
They are investigating it.
Here is the official response from MS Guys.
http://blogs.technet.com/msrc/archive/2010/02/11/restart-issues-after-installing-ms10-015.aspx
Filed under Technology, Windows 7 by Ankit on February 2, 2010 at 12:46 pm
no comments
In Windows XP, the default data location for each user profile was the My Documents folder, with My Pictures and My Music created as subfolders in that location. Windows Vista introduced the concept of a user profile with separate subfolders for different data types and removed the “My” prefix from these locations. With Windows 7, the personal pronoun is back. Or is it? If you open a Command Prompt window and look at a raw directory listing of your user profile, you’ll see that the actual name of the folder displayed as My Documents is simply Documents. The same is true for the Music, Pictures, and Videos folders. So where does the “My” come from? The display text comes from a custom Desktop.ini file that appears in each of these four folders. An entry at the top of the file points to a location within the system file Shell32.dll, which contains a localized name for this folder that varies according to your language. If you want to get rid of the pronoun, open your user profile folder, right-click the folder (My Documents, My Music, and so forth), and click Rename. Whatever text you enter here becomes the new value in the LocalizedResourceName value line in Desktop.ini.
Filed under PowerShell by Ankit on January 27, 2010 at 11:58 am
no comments
A fairly good amount of time we spend on our system for managing, searching files, folders. And when you are in learning phase of any new scripting language (just like me, in PS), it is obvious to have an eagerness about “How to” work with files and folder in that Scripting lang. Fortunately, PowerShell makes scripting files and directories as easy as working at the command line. Being an administrative shell, PowerShell directly supports tasks such as visiting all the files in a subdirectory or moving a file from one directory to another.
To retrieve the list of files in a directory, use the Get-ChildItem cmdlet. To get a specific item, use the Get-Item cmdlet:
· To list all items in the current directory, use the Get-ChildItem cmdlet:
Get-ChildItem
· To list all items that match a wildcard, supply a wildcard to the Get-ChildItem cmdlet:
Get-ChildItem *.doc
· To list all files that match a wildcard in the current directory (and all its children), use the –Include and –Recurse parameters of the Get-ChildItem cmdlet:
Get-ChildItem –Include *.doc -Recurse
· To list all directories in the current directory, use the Where-Object cmdlet to test the PsIsContainer property:
Get-ChildItem | Where { $_.PsIsContainer }
· To get information about a specific item, use the Get-Item cmdlet:
Get-Item test.txt
More to come in next post…
Filed under Microsoft Products, Technology by Ankit on January 26, 2010 at 1:12 pm
no comments
Filed under Random by Ankit on January 20, 2010 at 5:21 pm
no comments
I am using twitter from the last few months actively and today I got “fail whale” first time.
Hmmm….. when its going to Up.

Filed under PowerShell by Ankit on January 20, 2010 at 1:41 pm
2 comments
(My Article for Weekly PowerShell Column in office e-mag)
Today we learn about a surprising feature of PowerShell: forms. Many people think that PS is just another bro of cmd.exe and can’t do much fun with GUI. Hmmm…they are simply wrong. Since PS is based on .NET platform, it can access any .NET base class easily and Forms are no exception. So let’s try something into it.
Before calling any .NET namespace, we need to load that DLL into PS session. And this can be done with following commands:
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
For creating a form object, try this:
$form1 = New-Object System.Windows.Forms.Form
You can set various properties of form object directly. E.g. Name, text:
$form1.Text = "Ankit Form"
$form1.Name = "form1"
For a button object, try it:
$button1 = New-Object System.Windows.Forms.Button
$button1.Name = "button1"

We will discuss various aspects of forms in coming posts. For now, if you wanna play with some form code, try this PS Code:
function GenerateForm {
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null
[reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null
$form1 = New-Object System.Windows.Forms.Form
$button1 = New-Object System.Windows.Forms.Button
$InitialFormWindowState = New-Object System.Windows.Forms.FormWindowState
$button1_OnClick=
{
[System.Windows.Forms.MessageBox]::Show("Now call Police!")
}
$OnLoadForm_StateCorrection=
{
$form1.WindowState = $InitialFormWindowState
}
$form1.Text = "Ankit Form"
$form1.Name = "form1"
$form1.DataBindings.DefaultDataSourceUpdateMode = 0
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 284
$System_Drawing_Size.Height = 262
$form1.ClientSize = $System_Drawing_Size
$button1.TabIndex = 0
$button1.Name = "button1"
$System_Drawing_Size = New-Object System.Drawing.Size
$System_Drawing_Size.Width = 104
$System_Drawing_Size.Height = 35
$button1.Size = $System_Drawing_Size
$button1.UseVisualStyleBackColor = $True
$button1.Text = "Kill me!"
$System_Drawing_Point = New-Object System.Drawing.Point
$System_Drawing_Point.X = 89
$System_Drawing_Point.Y = 102
$button1.Location = $System_Drawing_Point
$button1.DataBindings.DefaultDataSourceUpdateMode = 0
$button1.add_Click($button1_OnClick)
$form1.Controls.Add($button1)
$InitialFormWindowState = $form1.WindowState
$form1.add_Load($OnLoadForm_StateCorrection)
$form1.ShowDialog()| Out-Null
}
#Call the Function
GenerateForm
Filed under PowerShell by Ankit on January 15, 2010 at 5:10 pm
no comments
Assignment in PS. Here is the ScreenShot
need to complete by next Wednesday… Hmmmmmm

Filed under PowerShell by Ankit on January 14, 2010 at 1:27 am
no comments
In today’s training session, learned about how to mix-up C# with PowerShell. An Example here:
Add-Type -Typedefinition @"
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
public class Program
{
public static void Main(string[] args)
{
String[] items = new String[] { "Joe", "John", "Jimmy", "Jerr" };
int totallenght =0;
foreach(String item in items)
{
totallenght+= item.Length;
}
Console.WriteLine("the total is {0}",totallenght);
}
}
}
"@
[ConsoleApplication1.Program]::Main($null)
Interestingly, the whole action of the above code can be done through this smaller (Only) PowerShell code too:
function list {$args}
$totallenght = 0
list Joe John Jimmy Jerry | foreach { $totallength+= $_.Length }
"the total is $totallength"
Filed under PowerShell by Ankit on January 13, 2010 at 1:27 am
2 comments
Note: The Code given here uses Google Dictionary for word definition. Its just a toy…
$Word= Read-host "What is your Word? "
$url = "http://www.google.com/dictionary?langpair=en|en&q=" + $Word
$ie = New-Object -com internetexplorer.application;
$ie.visible = $false;
$ie.navigate($url);
while ($ie.Busy -eq $true)
{
Start-Sleep -Milliseconds 1000;
}
$text = $ie.document.body.innertext
$atpos=$text.IndexOf("Synonyms")
if ($atpos -gt 0){
$len=$text.Length -$atpos
$result=$text.Substring($atpos,$len)
$atlast= $result.IndexOf("Web definitions")
$mean= $result.Substring(0, $atlast)
Write-Host $mean
}
else { Write-host "Dictionary:: not found"}