Friday, January 29, 2010

Windows Server 2008 R2 Core activation by phone

Here is a very good manual, how to activate Windows Server 2008 R2 Core by phone.
Short summary:
  1. Enter product key: Cscript.exe %systemroot%\system32\slmgr.vbs -ipk
  2. Get installation ID: Cscript.exe %systemroot%\system32\slmgr.vbs -dti
  3. Get phone number to receive the activation ID: notepad %systemroot%\system32\sppui.inf
  4. There' a bug in the original article - the filename to get the phone number is wrong
  5. Choose and call the phone number, follow instructions, receive activation ID
  6. Write down the activation ID received by phone (ideally write it directly to a notepad window to copy and paste then for product activation
  7. Activate product using: Cscript.exe %systemroot%\system32\slmgr.vbs –atp
  8. Verify product activation: Cscript.exe %systemroot%\system32\slmgr.vbs –dlv
  9. Enjoy!

Friday, January 15, 2010

Crash dump file missing with Windows 7

Yes, even Windows 7 can crash. And one may want to know why. Looking for .dmp file you may be very surprised: the .dmp file won't be saved on the local disk.

It is not a bug - it is the new feature in Windows 7.

After hours spent to locate the reason, found following article @ OSR: one of my favorite sources regarding Windows kernel.

Shortly:
"By setting the \HKLM\System\CCS\Control\CrashControl\AlwaysKeepMemoryDump DWORD value to 1 you will guarantee that you will always have a crash dump file after crashing the system."

Set the registry key an enjoy!



Friday, January 08, 2010

wsdl and blanks in file pathnames

Using wsdl utility (as for WIndows SDK 6.0A) you may encounter following error:

Error: Could not find a part of the path 'd:\projects\my%20project\xsd\type1\Adresses.xsd'.

This is because your project filepath contains blanks:

"d:\projects\my project\xsd"

Copy files to another, MS DOS - 8.3 - conform location and retry (for example,

"d:\projects\myprj\xsd"

).
You will see it works now.
Enjoy!

Wednesday, January 06, 2010

switch, default and break in C#

When you "switch" from C++ to C# and want to use "switch" statement, do not forget on of the major differences between switch in C++ and switch in C#:

Unlike the C++ switch statement, C# does not support an explicit fall through from one case label to another. (here)

Even default must have it's own break now - otherwise you'll get a following message from compiler:

Control cannot fall through from one case label ('default:') to another.

So, do not forget break for default

switch(...)
{
case ...:
...
break;
...
default:
...
break; // !!!
}


and enjoy!