What is Windows 7 God Mode
1/18/2010 12:59:38 AM

As cool as the name sound - Windows 7 God Mode provides a total control of the operating system's configuration aspect. You can think of it as an extended version of 'Control Panel'

Add a folder and name it as GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}

Double click on the created folder and get complete control over your Windows 7 System.

 

 

 

What does it mean to be Compatible with Windows 7 - Migration SWAT Team expert Chris Jackson gives his views
1/13/2010 4:42:10 AM

When you say that you your application is Windows 7 Compatible - What does that exactly mean? Does it mean that your application is built for Windows 7 or does it mean that it would work on Windows 7 with the help of the shim database.

Migration Expert Chris Jackson also known as ' The App Compat Guy' gives his views.

Read here for Chris's explanation.

 

 

VS 2010 - Collaborative Debugging
12/1/2009 6:31:38 PM

Came across an intresting article on collaborative debugging on Visual Studio 2010.

Read the full article here

 

Little-known cool command line utility: clip
11/19/2009 2:40:48 AM

Little-known command line utility: clip

Windows 7 includes a tiny command line utility called clip. All it does is paste its stdin onto the clipboard.

dir | clip
echo hey | clip

 

New Windows 7 Themes
11/6/2009 5:40:21 AM

Download new themes from here

Find out what people are saying about Windows 7
11/5/2009 10:24:53 PM

 

If you want to know what people are saying about Windows 7 refer this link

 

 

 

Microsoft Intelligence Report - Finds Vista more robust to virus and malware attacks
11/4/2009 11:09:04 PM

Microsoft isssued a security intelligence report for the period of January through June 2009.

Based on the key findings and data  - Windows Vista had a very less infection rate than XP by 61.9 percent.

For the full story download the Report from here

 

 

Software That Fixes Itself
10/30/2009 5:02:15 AM

Came across an intresting article on Software that could create a patch for itself detecting a flaw in its code. Read the full article here

Source:Technology Review

Windows 7 Deployment Guide
10/28/2009 5:09:21 AM

If you want to start with Windows 7 deployment in your organization consider going through the Magazine issued by Microsoft on how to effectively deploy Windows 7.

Cover's all topics including running compatiblity tests. Dowload the magazine here

 

Disk2Vhd - A tool that creates virtual disk of you live drive!
10/26/2009 2:46:02 AM

 

I work with a lot of VM's for my testing and development purposes - And sometimes would like to create a VM of my own host machine when moving to a new environment.

I had recently moved from Vista to Win 7 , and needed a backup of my box and environment.

Used a nice tool Disk2Vhd - That takes an image of your live system which can be used on Virtual PC and on Hyper-V.

Dowload the tool here!

 

Windows 7 Compatiblity Center - Live!
10/26/2009 12:44:20 AM

Windows 7 compatiblity center is now live !. Search for applications/driver and hardware that you have or wish to install on Windows 7 and see if it would work on Windows 7 or if there is any upgrades available.

 

Web Link : http://www.microsoft.com/windows/compatibility/windows-7/en-us/default.aspx

 

 

 

Getting Token Information from a .NET Application [Code Included]
10/23/2009 2:54:01 AM

I have seen a lot of requests on getting token information from a .NET application so I went on to create a API  that can be used .In order to understand this custom API you would need to read on whats a 'Token'

 

"According to Microsoft an access token is an object that describes the security context of a process or a thread"

 

 

Refer MSDN for a more detailed descriptionhttp://msdn.microsoft.com/en-us/library/aa374909(VS.85).aspx

 

 

This API uses Pinvoke , hence make sure you import the required dll's and structures. A handle to the process that needs to be queried is passed.

resultDTO is a DTO object.

 

Source Code:

/*File Details
Company Name : NathCorp
File Name        : GetTokenInfo.cs
Created on      : 12.31.2007
Author           : Ganesh
 */

#region Headers

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Security.Principal;

#endregion

namespace nath.API
{
     /// <summary>
    /// Class used to get Process Token.
   /// </summary>
    class TokenAPI
    {

        #region Constants
        //Constant values used for function GetTokenInformation.
        const UInt32 TOKEN_QUERY = 0x0008;
       
        public const uint ERROR_SUCCESS = 0;
        public const uint ERROR_INSUFFICIENT_BUFFER = 122;
        public const uint TokenIntegrityLevel = 25;

        const long SECURITY_MANDATORY_UNTRUSTED_RID = (0x00000000L);
        const long SECURITY_MANDATORY_LOW_RID = (0x00001000L);
        const long SECURITY_MANDATORY_MEDIUM_RID = (0x00002000L);
        const long SECURITY_MANDATORY_HIGH_RID = (0x00003000L);
        const long SECURITY_MANDATORY_SYSTEM_RID = (0x00004000L);
        const long SECURITY_MANDATORY_PROTECTED_PROCESS_RID = (0x00005000L);
        #endregion

 

             #region Structures
        enum TOKEN_INFORMATION_CLASS
        {
            TokenUser = 1,
            TokenGroups,
            TokenPrivileges,
            TokenOwner,
            TokenPrimaryGroup,
            TokenDefaultDacl,
            TokenSource,
            TokenType,
            TokenImpersonationLevel,
            TokenStatistics,
            TokenRestrictedSids,
            TokenSessionId,
            TokenGroupsAndPrivileges,
            TokenSessionReference,
            TokenSandBoxInert,
            TokenAuditPolicy,
            TokenOrigin,
            TokenElevationType,
            TokenLinkedToken,
            TokenElevation,
            TokenHasRestrictions,
            TokenAccessInformation,
            TokenVirtualizationAllowed,
            TokenVirtualizationEnabled,
            TokenIntegrityLevel,
            TokenUIAccess,
            TokenMandatoryPolicy,
            TokenLogonSid,
            MaxTokenInfoClass
        }

        enum TOKEN_VIRTUALIZATION_ENABLED
        {
            buff
        }

        [StructLayout(LayoutKind.Sequential)]
        public struct TOKEN_MANDATORY_LABEL
        {

            public SID_AND_ATTRIBUTES Label;

        }

        [StructLayout(LayoutKind.Sequential)]
        public struct SID_AND_ATTRIBUTES
        {
            public IntPtr Sid;
            public int Attributes;
        }
        #endregion
       


        #region Dll Import Functions

        [DllImport("advapi32.dll", SetLastError = true)]
        static extern bool GetTokenInformation(IntPtr TokenHandle,
        TOKEN_INFORMATION_CLASS TokenInformationClass, IntPtr   TokenInformation,
        uint TokenInformationLength, out uint ReturnLength);

        [DllImport("advapi32.dll", SetLastError = true)]
        static extern bool OpenProcessToken(IntPtr ProcessHandle, UInt32
        DesiredAccess, out IntPtr TokenHandle);


        [DllImport("kernel32.dll")]
        public static extern IntPtr LocalAlloc(uint uFlags, UIntPtr uBytes);

        [DllImport("advapi32.dll", SetLastError = true)]
        public static extern IntPtr GetSidSubAuthority(IntPtr pSid, UInt32 nSubAuthority);

        [DllImport("advapi32.dll", SetLastError = true)]
        public static extern IntPtr GetSidSubAuthorityCount(IntPtr pSid);
     
        #endregion

            
        //Constructor
        public TokenAPI() { }
    
        /// <summary>
        /// Function that Queries a process to check if its Virtualized.
        /// </summary>
        /// <param name="handle">A Handle to the Process</param>
        /// <returns>resultDTO</returns>
        public resultDTO QueryProcess(IntPtr handle)
        {
            IntPtr hToken;
            uint dwSize2;

            uint dwLengthNeeded;
            uint dwError = ERROR_SUCCESS;
            TOKEN_MANDATORY_LABEL pTIL;
            int IntegrityLevel = 0;


            TOKEN_VIRTUALIZATION_ENABLED tokenVirtualized;
            IntPtr pVirtualized = Marshal.AllocHGlobal(sizeof(TOKEN_VIRTUALIZATION_ENABLED));

            OpenProcessToken(handle, TOKEN_QUERY, out hToken);

            GetTokenInformation(hToken, TOKEN_INFORMATION_CLASS.TokenVirtualizationEnabled, pVirtualized, sizeof(TOKEN_VIRTUALIZATION_ENABLED), out dwSize2);
            tokenVirtualized = (TOKEN_VIRTUALIZATION_ENABLED)Marshal.ReadInt32(pVirtualized);
            Marshal.FreeHGlobal(pVirtualized);

            if (TokenConstants.Virtualized == Convert.ToString(tokenVirtualized))
            {
                result.virtualized = true;
            }
            else
            {
                result.virtualized = false;
            }
            
            if (!GetTokenInformation(hToken, (TOKEN_INFORMATION_CLASS)TokenIntegrityLevel, IntPtr.Zero, 0, out dwLengthNeeded))
            {
                dwError = (uint)Marshal.GetLastWin32Error();

                if (dwError == ERROR_INSUFFICIENT_BUFFER)
                {
                    IntPtr StructPtr = Marshal.AllocHGlobal((int)dwLengthNeeded);
                    try
                    {
                        if (GetTokenInformation(hToken, (TOKEN_INFORMATION_CLASS)TokenIntegrityLevel, StructPtr, dwLengthNeeded, out dwLengthNeeded))
                        {
                            pTIL = (TOKEN_MANDATORY_LABEL)Marshal.PtrToStructure(StructPtr, typeof(TOKEN_MANDATORY_LABEL));
                            IntPtr SubAuthorityCount = GetSidSubAuthorityCount (pTIL.Label.Sid);
                            int count = Marshal.ReadInt32(SubAuthorityCount);
                            uint AuthCount = (uint)count - 1;

                            IntPtr IntegrityLevelPtr = GetSidSubAuthority(pTIL.Label.Sid, AuthCount);
                           
                            IntegrityLevel = Marshal.ReadInt32(IntegrityLevelPtr);

                        }
                       
                        if (IntegrityLevel < SECURITY_MANDATORY_MEDIUM_RID)
                        {

                            result.integrity = "Low";

                        }
                        else if (IntegrityLevel >= SECURITY_MANDATORY_MEDIUM_RID && IntegrityLevel < SECURITY_MANDATORY_HIGH_RID)
                        {
                            result.integrity = "Medium";

                        }
                        else if (IntegrityLevel >= SECURITY_MANDATORY_HIGH_RID)
                        {
                            result.integrity = "High";

                        }
                    }
                    catch
                    {
                   
                    }
                       
                    finally
                    {

                        Marshal.FreeHGlobal(StructPtr);

                    }

                }

            }
            return result;

        }

    }
}

 

 

Windows 7 - New Features
10/22/2009 3:17:52 AM

There are a lot of improvements made on Windows 7. Below are some of the most discussed areas in a nutshell.

  • bullet.gifFaster Boot up time - Windows 7 has a faster boot up time than an O.S
  • bullet.gifWindows Touch  - Next level in Computer User Interaction
  • bullet.gifBranch Cache - Achieve faster file transfer's
  • bullet.gifRemote Media Streaming - A new media feature that comes only with Windows 7
  • bullet.gifHome Group - For your own personal network.
  • bullet.gifJump Lists - Easy user acess
  • bullet.gifSnap -  Easy navigation makes a good user experience.
  • bullet.gifFull 64 bit support - Leverage full processing power of mordern processors.

 

Top 5 Must Read books for Every IT professional
10/22/2009 2:44:07 AM

I have compiled a list of Top 5 must reads for every IT professional. The books below are in no particular order as each one covers a different area that every IT professional would be required to know.

Windows Internals – Learn about the in depth workings of the Windows Operating System. A 5th edition is out now which covers Windows Vista and Windows Server 200

Programming Windows by Charles Petzold – Learn about Windows programming. The book starts with the basics taking you from the simplest concepts moving higher to Win32 API’s and then the MFC’s.

 C# Cookbook 2nd edition – Good samples great programming and useful tricks that every .NET developer must know.

 Windows 7 Secretes by Paul Thurrott – One of my favorite speaker’s and blogger has a book out on Windows 7 . A must read

The world is flat 3.0 – Get a good overall feel about IT before making that  leap.

 

 

How To Burn CDs & DVDs In Windows 7
10/22/2009 2:32:07 AM

Take burning a CD or DVD for example, firstly it involved scouring the web for burning software which will work for you. Then depending on what software you choose, you could either end up handing over some money or you may have gotten a free program, regardless you will then have to download and install it. After all this you may be plagued with problems such as the software not detecting your burning drive or not recognizing discs in the drive.

Finally you would then have to open up your chosen software, navigate through some menus, which even your local tech enthusiast will struggle to understand, select the files you want and finally go hunting for that burn button.

With Windows 7, things have got a whole lot easier. Windows 7 has its own built in burning features so you can burn a CD/DVD in just a few clicks.

Take burning a CD or DVD for example, firstly it involved scouring the web for burning software which will work for you. Then depending on what software you choose, you could either end up handing over some money or you may have gotten a free program, regardless you will then have to download and install it. After all this you may be plagued with problems such as the software not detecting your burning drive or not recognizing discs in the drive.

Finally you would then have to open up your chosen software, navigate through some menus, which even your local tech enthusiast will struggle to understand, select the files you want and finally go hunting for that burn button.

With Windows 7, things have got a whole lot easier. Windows 7 has its own built in burning features so you can burn a CD/DVD in just a few clicks.

 1.    Select a file or files your want to burn to a disc, and click the Burn button at the top of your window.

2.    You will then be presented with another window showing the files added to the burn list, so you will be able to add more files to the burn list if you want or you can just click burn to disc.

3.    It will then check to make sure you have a disc inserted into your drive, and if you do you will be asked to add a name to the disc and you can choose a different write speed if you wish but it will automatically select the highest recording speed available for you.

4.    And once you’ve clicked next it will begin burning the files to the disc, and then your done.

5.    So it’s as simple as that, you will also be given the opportunity to create an additional copy of the disc if you want.

6.    You can also easily burn iso image files just as easily

Windows 8 - 128 bit support?
10/22/2009 1:46:28 AM

128 Bit Support?

I was in a discussion with one of my friends on computing performance , we ended up talking about 32bit and 64bit operating system's. The next step would be 128 bit right?

I searched the net for 128 bit O.S or atleast plan's for a 128 bit system. I landed up on a Windows 8 page. The rumours are that it would support 128 bit for certain type of processors.

 

Windows 7 - Top 10 Features
10/22/2009 1:39:16 AM

1. Problem Steps Recorder
You're probably very used to friends and family asking for help with their computer problems, yet having no idea how to clearly describe what's going on. Windows 7  include's an excellent new solution in the Problem Steps Recorder.

2. Burn images
Windows 7 introduces a feature that other operating systems have had for years - the ability to burn ISO images to CDs or DVDs.

3. Create and mount VHD files
Microsoft's Virtual PC creates its virtual machine hard drives in VHD files, and Windows 7 can now mount these directly so you can access them in the host system.

4. Troubleshoot problems
If some part of Windows 7 is behaving strangely, and you don't know why, then click Control Panel > Find and fix problems (or 'Troubleshooting') to access the new troubleshooting packs.
5. Startup repair

6. Take control
AppLocker is a new Windows 7 feature that ensures users can only run the programs you specify. Don't worry, that's easier to set up than it sounds: you can create a rule to allow everything signed by a particular publisher, so choose Microsoft, say, and that one rule will let you run all signed Microsoft applications.

7. Calculate more
 This offers many different unit conversions (length, weight, volume and more), date calculations (how many days between two dates?), and spreadsheet-type templates to help you calculate vehicle mileage, mortgage rates and more.

8. Switch to a projector
Windows 7 now provides a standard way to switch your display from one monitor to another, or a projector - just press Win+P or run DisplaySwitch.exe and choose your preferred display

9. Get a power efficiency report

10. Understanding System Restore
Using System Restore in previous versions of Windows has been something of a gamble. There's no way of telling which applications or drivers it might affect - you just have to try it and see.

Create MD5 hash code of a string
10/9/2009 3:56:19 AM

Two namespaces are used for creating MD5 hash code.

using System.Security.Cryptography;
using System.Text;

Function which return MD5 hash code by passing string value.

protected string TexttoMD5 (string strInputString)
{ //Change the syllable into UTF8 code

byte[] pass = Encoding.UTF8.GetBytes(strInputString);
MD5 md5 = new MD5CryptoServiceProvider();
string strHash = Encoding.UTF8.GetString(md5.ComputeHash(pass));
return strHash;

}

Time Saving Shortcuts for Windows
10/9/2009 3:52:20 AM

Keyboard/ Command Line shortcut that get you to particular control panel or windows. It makes you easier and faster to open the windows applets.

Following are some useful shortcuts :

1. Open Add/Remove Windows Components dialog box - usually accessed from Add/Remove Programs, 4 mouse-clicks that really slow you down if you do this on a frequent basis. (The Add/Remove Programs applet itself takes a while to open before you can press the Windows Components short-cut):
control appwiz.cpl,,2
2. Add/Remove Programs - if you haven't already guessed it:appwiz.cpl
3. Network Connections applet: ncpa.cpl
What would be really cool along with this: being able to get to TCP/IP Properties of a network interface... has anyone figured that out yet?
4. Display Properties: desk.cpl
5. To set resolution, et al from the Display properties, Settings tab:control desk.cpl,,3
6. System properties: sysdm.cpl
System properties | Computer name: control sysdm.cpl,,1
System properties | Remote: control sysdm.cpl,,6
List of all values for System properties
General(0), Computer Name(1), Hardware(2), Advanced(3), System Restore(4), Automatic Updates(5), Remote (6)
7. Active Directory Users & Computes: dsa.msc
8. Active Directory Domains & Trusts: domain.msc
9. Active Directory Sites & Services: dssite.msc
10. DNS Management Console: dnsmgmt.msc
11. Computer Management Console: compmgmt.msc
12. Disk Management: diskmgmt.msc
13. Show Desktop (minimizes all programs): Windows key + D
14. Hibernate (great for a short-cut that you can than place in the quick launch bar in the Task Bar: %windir%\system32\rundll32.exe powrprof.dll,SetSuspendState Hibernate
15. Event Viewer (an old NT favorite): eventvwr