Farhan Parkar
Thursday, April 22, 2010
getting .net on Windows 2008
“Group cannot be specified along with other identification conditions.”
Windows Server Core 2008 R2
While using server core yesterday I came across another interesting error. I was attempting to update a firewall rule and I kept receiving this error:
“Group cannot be specified along with other identification conditions”
I double checked my spelling and syntax and everything looked right. Take a look at the picture below, can you see my mistake?
It turns out it was actually a pretty dumb issue, but an easy one to overlook. I had copy and pasted the command in from a webpage, and the quotes must have been Microsoft Word style quotes. I deleted the quotes, re-ran the command, and success! It’s a minor issue that was easy to overlook. In this case it was quick to find and fix, but it reminded me of the days when I searched for an error in my .NET code only to see that two single quotes ” looked like one ” double quote character. It took forever to find the error because everything appeared right, but of course it wasn’t.
Monday, April 19, 2010
Set Desktop Wallpaper according to screen Resolution
It is writen in vbscript to use run cscript script-name.vbs or set by GPO
I had kept the background images at a location named according to resolution like bg-1024.jpg, bg-1280.jpg, bg-1440.jpg ___________________________________________________________________
Dim strComputer
strComputer = "."
' Prepare WMI Connection
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
' Query WMI
Set getPixelsWidth = objWMIService.Execquery("Select * from CIM_VideoController")
' Get the Horizontal Resolution
strPixelWidth = getPixelsWidth.ItemIndex(0).CurrentHorizontalResolution
' Prepare filename for background wallpaper
strWallPaper = "\\x.x.x.x\usrdata\commonfiles\bg-" & strPixelWidth & ".jpg"
' Setting the wallpaper
Dim strWallPaper
Dim wshShell
Dim sUserName
Set wshShell = WScript.CreateObject("WScript.Shell")
sUserName = wshShell.ExpandEnvironmentStrings("%USERNAME%")
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
sWallPaper = strWallPaper
' update in registry
oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper
' let the system know about the change ( looped few times as always does'nt work first time )
For i = 0 to 15
oShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", True
wscript.echo i
Next
___________________________________________________________________
Best Regards.
Wednesday, April 14, 2010
The Man Who Survived Two Atomic Bombs
Yamaguchi was a resident of Nagasaki but on the fateful day of 6 August 1945 he was in Hiroshima, on business for his employer, Mitsubishi. He was badly wounded when the bomb carried by Enola Gay exploded above Hiroshima but survived and returned to Nagasaki the next day.
Amazingly, he returned to work on August 9 – most of us in this day and age will take a day off work if we have a nosebleed, let alone get blown up by an atomic bomb. He was explaining the first bomb to his supervisor when Bocks Car flew over Nagasaki. The Fat Man atomic bomb was dropped on to the city and Tamaguchi became the victim of a second atomic blast. He was three kilometers away from Ground Zero but was not able to get treatment for the injuries he had received in Hiroshima – for obvious reasons.
He was recognised as a hibakashu (one of those affected by the explosions) but only of the Nagasaki bomb – he kept his remarkable story to himself for many years. The Japanese government finally recognised his presence in both cities in 2009. He died of stomach cancer in January 2010.
We may not have heard the last of Tsutomu Yamaguchi. Several months before his death he met the film director James Cameron (of Titanic and Avatar fame). It seems that the director is keen to shoot Yamaguchi’s story – and it certainly does deserve more exposure. Let’s just hope that Celine Dion doesn’t sing the theme music.