Tag Archives: windows 7

Creating a VHD for multi-boot in Windows 7

Been doing this so much lately with all of the flavors of Windows 8, I figured I’d write this down for my own benefit, but also for anyone who’s interested in doing the same.

  1. Create a new VHD
    1. Go to Start, right-click on Computer and choose Manage
    2. Under Storage in the left pane, single-click Disk Management
    3. In the Actions pane on the right, click More Actions, then choose Create VHD
    4. Specify the location you want to store your VHD file (ex: c:VHDsvhdname.vhd).  Select the virtual hard disk size (I typically do 20GB and Fixed, but it’s up to you) and click Ok.
    5. The VHD will be created, this can take anywhere from 5-20 minutes.
    6. Once finished, you need to initialize the disk.  Right-click on the newly created Disk in the pane below the volumes list (click the left side of the disk, not the white area on the right) and choose Initialize Disk.
    7. Make sure MBR is selected and click OK.
    8. You should now have a VHD, ready for installation of your favorite OS.
  2. Prepare your bootable OS
    1. Download and install the Windows 7 USB DVD Download Tool.  This is a free tool courtesy of Microsoft, and is very handy (IMHO) for creating bootable flash drives for OS installation.
    2. Once installed, run the tool.  In step 1, browse to the location of the ISO file for your OS you want to install on the newly created VHD.
    3. Choose the media type you want the bootable drive created on.  For me, this is a blank flash drive, minimum 8GB.  At this point, the drive should be connected.
    4. Make sure your drive is selected in the drop down list.  If you forgot to connect it, connect it now and click Refresh.  Click Begin Copying.
    5. In step 4, the drive will be formatted, the OS will be installed on the drive, and it will be configured to be bootable.
    6. You should now have a bootable media with your desired OS on it.
  3. Install your OS on your VHD
    1. Plug in your flash drive and restart your machine.  Make sure your machine’s BIOS is set to read flash drives on boot, and also that any VM settings are enabled.
    2. Follow the on-screen instructions for installation of your OS.
    3. When you get to the point where it wants to know which partition to install the OS on to, press SHIFT+F10 to open the command prompt.
    4. Type DISKPART and hit enter
    5. At the DISKPART> prompt, type select vdisk file=<path to vhd file> and hit enter.  NOTE: drive letters may have been rearranged during this install process.  You may need to do some searching around at the various drive letters to find your VHD file, to make sure you have the correct drive letter and path above.
    6. At the DISKPART> prompt, type attach vdisk and hit enter
    7. Close the command prompt window
    8. At the list of available partitions, click Refresh, and make sure your VHD file appears in the list.  If it doesn’t, repeat steps C-F and make sure there are no errors when attaching the VHD to the install session.
    9. Select the VHD partition and proceed with installation.  Ignore any warnings the wizard may tell you about not being able to install on this partition.
    10. A BCD entry will be created for you, and set to default upon completion.
  4. Changing boot order/default boot settings after installation
    1. Before making any changes to the Boot Control, back it up by typing bcdedit /export <filename> and hit enter.  Don’t use spaces in the filename unless you enclose them in double-quotes.
    2. In your default OS (prior to installing the new OS above), open a command prompt and type bcdedit /enum and hit enter.
    3. To set a specific VHD or partition volume as default, locate the identifier GUID and select it by right-clicking and choose Mark, then select the entire GUID (including curly braces {}) and hit enter.
    4. Back at the prompt, type bcdedit /default {GUID} and hit enter, replace {GUID} with the guid you copied and pasted.  To paste, right click and choose Paste.
    5. To change the default selection timeout, so it’s faster or slower, type bcdedit /timeout x, where x = the number of seconds before it selects the default.  To make it bypass this screen, set the timeout value to 0.
    6. To change the description (name as it appears in the list), type bcdedit /set description <whatever you want it to say> and hit enter.

That’s it, enjoy your new VHD!

Eric Oszakiewski

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 37 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a .Net/SharePoint Development Lead for General Motors.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInYouTube

Reveal most useful settings in Windows 7

Most useful here is subjective, but here is a quick way to create your own quick listing of common Windows 7 settings, including shortcuts, links to Control Panel items, etc. It’s definitely not an all-inclusive list, but it works, and it’s pretty cool.

Create a folder somewhere (desktop preferably until you see what it does). Right-click and rename the folder

.{ED7BA470-8E54-465E-825C-99712043E01C}

Note the period between and the unique identifier – very important! “Name of your choice” can be anything you want. Hit enter and voila! If anyone can explain this further feel free, but to me it just looks like a shortcut to a grouped list view of common settings.

Eric Oszakiewski

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 37 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a .Net/SharePoint Development Lead for General Motors.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInYouTube

Getting local IP address programmatically in Windows 7

I created a small client app for my company that required the local IP address (assigned by DHCP) to determine what site it was on. It reads the second octet value, which is consistent with each of our buildings in our enterprise. From here, I can determine what content to load so no matter where the PC is placed, it automatically grabs content only specific to that location.

Anyway, when testing this application on Windows 7 it doesn’t load any content. Initial troubleshooting indicates the IP address is not resolving as it would on a Windows XP machine. I dug into the code today and noticed when run on Windows 7 the IP Address was coming up something like this:

fe80::a0b4:2c9d:2542:6b73%11

This was achieved by using System.Net and the following C# code:

string hostname = Dns.GetHostName();
IPHostEntry ipEntry = Dns.GetHostEntry(hostname);
IPAddress[] ip = ipEntry.AddressList;

Then ip[0].ToString() will give you the IP Address, or in Windows 7 case, the IPv6 address you see above. Let me show you what worked for me:

First, make sure you’re referencing the System.Linq namespace in addition to System.Net. No, I’m not a Linq user or a fan, but it works, so I used it.

Next, replace the above code with the following:

string hostname = Dns.GetHostName();
IPHostEntry ipEntry = Dns.GetHostByName(hostname);
string ip = ipEntry.AddressList.FirstOrDefault().ToString();

Note that Dns.GetHostByName is obsolete, and eventually will be replaced. However, the recommended “GetHostEntry” failed to return the IPv4 address I needed, but instead returned the IPv6 address mentioned above. I welcome feedback on what I might be doing wrong or how to improve on this process, but for now this solves my Windows 7 IP Address issue. Hope this helps someone else.

UPDATE: Thanks to the anonymous comment left that clarified my unfamiliarity with IPv6 address syntax. Corrections were made accordingly.

Eric Oszakiewski

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 37 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a .Net/SharePoint Development Lead for General Motors.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInYouTube

Devices and Printers not populating in Windows 7

I discovered something interesting today…which I’m sure most of you figured out by now, but it’s new news to me. My laptop with Windows 7 Ultimate was taking forever to load the printers and devices screen, and eventually after what seemed like 30+ minutes, it would show nothing, but Windows 7 wouldn’t throw an error or message. It was in fact proud to display nothing, even though I know damn well there are printers loaded! What was the cause of this? If you can believe it, the Bluetooth Support Service. I’m a fairly logical person, and for some reason a bluetooth support service managing printers is a little unusual, but who am I to judge? I had the service manually disabled as part of my service trimming following a clean install. Right click, choose properties and enable the service, then start it and reload your Devices and Printers screen to see and control your printers. Unfortunately, this is one service that has to stay enabled and running in order to manage your printers. Hope this helps someone.

Eric Oszakiewski

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 37 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a .Net/SharePoint Development Lead for General Motors.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInYouTube

Enabling ADUC on Windows 7

I’m unable to locate a working plug-in/snap-in for Active Directory Users and Computers that works on Windows 7. Fortunately, there’s a workaround that allows administration of ADUC in Windows 7 with a little modification.

First, you’ll need to download and install RSAT for Windows 7. It’s found here. You’ll need this before you can do anything else. Once this is installed, on your Windows 7 box, open Programs and Features and click the Turn Windows Features On or Off option. In the Windows Features box, locate Remote Server Administration Tools and expand the item. Expand Role Administration Tools, then expand the AD DS and AD LDS Tools item, then the AD DS Tools item. Check the box for AD DS Snap-ins and Command-line Tools. Click Ok and those features will be enabled.

The ADUC shortcut will be placed in your Administrative Tools under Control Panel just like it used to be.

Also note, this is for the 32 bit versions only. This hasn’t been tested on 64 bit, and others have complained that they couldn’t get this working on 64 bit.

If anyone else has a better method of administering ADUC on Windows 7 Pro please feel free to post a comment. Until then, hope this helps someone!

Eric Oszakiewski

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 37 years of IT experience, and 19 years Native American Gaming experience. He is currently working as a .Net/SharePoint Development Lead for General Motors.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInYouTube