How to install Windows 7 from a USB drive (using DISKPART)

by Shawn March 01, 2010 04:45

This guide works 100% for Vista & Windows 7 unlike most of the guides out there. I have seen many sites/blogs that have “Install Vista from USB guide” but either with incomplete steps or not working guide. I have also seen some guides that don’t’ use proper commands in this guide. After spending many hours I have come up with this 100% working guide.

I just did this method on one of my friends machine and installed the new Windows 7 BETA. The main advantage is that by using USB drive you will be able to install Windows 7/Vista in just 15 minutes. You can also use this bootable USB drive on friend’s computer who doesn’t have a DVD optical drive.

The method is very simple and you can use without any hassles. Needless to say that your motherboard should support USB Boot feature to make use of the bootable USB drive.

Requirements:

*USB Flash Drive (Minimum 4GB)

*Windows 7 or Vista installation files.

Follow the below steps to create bootable Windows 7/Vista USB drive using which you can install Windows 7/Vista easily.

1. Plug-in your USB flash drive to USB port and move all the contents from USB drive to a safe location on your system.

2. Open Command Prompt with admin rights. Use any of the below methods to open Command Prompt with admin rights.

*Type cmd in Start menu search box and hit Ctrl+ Shift+ Enter.

Or

*Go to Start menu > All programs > Accessories, right click on Command Prompt and select Run as administrator.

3. You need to know about the USB drive a little bit. Type in the following commands in the command prompt:

First type DISKPART and hit enter to see the below message.

Next type LIST DISK command and note down the Disk number (ex: Disk 1) of your USB flash drive. In the below screenshot my Flash Drive Disk no is Disk 1.

4. Next type all the below commands one by one. Here I assume that your disk drive no is “Disk 1”.If you have Disk 2 as your USB flash drive then use Disk 2.Refer the above step to confirm it.

So below are the commands you need to type and execute one by one:

SELECT DISK 1

CLEAN

CREATE PARTITION PRIMARY

SELECT PARTITION 1

ACTIVE

FORMAT FS=NTFS

(Format process may take few seconds)

ASSIGN

EXIT

Don’t close the command prompt as we need to execute one more command at the next step. Just minimize it.

5. Next insert your Windows7/Vista DVD into the optical drive and check the drive letter of the DVD drive. In this guide I will assume that your DVD drive letter is “D” and USB drive letter is “H” (open my computer to know about it).

6. Maximize the minimized Command Prompt in the 4th step.Type  the following command now:

D: CD BOOT and hit enter.Where “D” is your DVD drive letter.

CD BOOT and hit enter to see the below message.

7. Type another command given below to update the USB drive with BOOTMGR compatible code.

BOOTSECT.EXE /NT60 H:

Where “H” is your USB drive letter. Once you enter the above command you will see the below message.

8. Copy your Windows 7/Vista DVD contents to the USB flash drive.

9. Your USB drive is ready to boot and install Windows 7/Vista. Only thing you need to change the boot priority at the BIOS to USB from the HDD or CD ROM drive. I won’t explain it as it’s just the matter the changing the boot priority or enabling the USB boot option in the BIOS.

Note: If you are not able to boot after following this guide means you haven’t set the BIOS priority to USB. If you got any problem in following this guide feel free to ask questions by leaving comment.

Update: If you are looking for something with a nice friendly GUI, use the easy-to-use guide to create a bootable USB to install Windows 7 using official tool.

Tags:

Windows | Windows 7

Ever wanted to know how to install Windows 7 from a USB? It's easy!

by Shawn March 01, 2010 04:39

As we reported earlier, Microsoft released a free tool called Windows 7 USB/DVD Download Tool to help you install Windows 7 on all netbooks in simple steps.

Although you can refer the how to install Windows 7 from USB guide to do the same, this tool simplifies the job. Here are the five simple steps that you need to follow to create a bootable USB flash drive to install Windows 7 from USB device:

 

Note: You need a USB flash drive with a minimum of 4 GB of free space. And also please backup your data from USB first.

1. Download Windows 7 USB/DVD Tool and install it.

 

2. Run the program, browse to your Windows 7 ISO image using the Browse button.

3. In this step, you need to select your media type. As we are here to create a bootable USB, simply click on USB device button.


4. Select your USB flash drive from the drop down box and click on Begin copying button.

5. The Windows 7 USB/DVD tool will take a few minutes to complete the procedure.

6. You are done. You can now use this USB on any machine that can boot from USB to start installing Windows 7.

 

 

 

 

 

Tags:

Windows | Windows 7

Passthrough NTLM Authentication for FireFox

by Shawn January 27, 2010 11:01

In Firefox

  1. In the Address Bar, type: about:config and either press the ENTER key on the keyboard or click on the GO button

  2. On some machines you may get the warning message shown below.  If you follow our steps, you will NOT void your warranty

  3. When the new page appears with the configuration settings, In the Filter bar, search for NTLM and the result will show 3 entries. The one you need is NETWORK.AUTOMATIC-NTLM-AUTH.TRUSTED-URLS. Double-click the NETWORK.AUTOMATIC-NTLM-AUTH.TRUSTED-URLS entry to open the Enter string value window

  4. When the Enter the string value window opens, type the portal URLs that you wish to access automatically, separated by a comma. Note:  If you want to set it up for the entire domain, just enter .yourdomain.com

  5. When you are finished, click OK.
  6. You should now be able to nagigate to an NTLM protected website and access it without being prompt for credentials (as long as you current have access to it)

 

Tags: ,

Information | SharePoint | Windows

Windows Server 2008 as a Super Workstation

by Shawn January 25, 2010 09:12

Tags: ,

Windows

Update to TopProcess gadget

by Shawn October 13, 2009 04:00

Here is a small update to the TopProcesses gadget.

Changes

  • Reduced font size

TopProcess.gadget (46.56 kb)

Tags: , ,

Windows | Windows 7

RDP Gadget for Windows

by Shawn October 13, 2009 03:58

Here is an updated version of the popular frxRDP gadget with a few tweaks and bug fixes

  • Supports additional resolutions
  • Fix to "Console" feature so that it works with Vista/Windos 7
  • Slight code cleanup

RDP.gadget (359.10 kb)

Tags: , ,

Windows | Windows 7

SharePoint, Host headers, and the Loopback Check in Windows Server

by Shawn October 07, 2009 09:14

As a SharePoint developer, I find that I spend a lot of time using one of the Server Operating Systems (2003/2008).  Interestingly enough a registry tweak is needed before you can actully do any real testing (like using host headers). 

The solution for me and one of my colleagues turns out to be this old known issue
http://wcornwill.wordpress.com/2006/06/06/mapping-host-headers-causes-looping-windows-authentication/
and
http://www.sharepointblogs.com/george/archive/2009/04/16/error-401-connecting-to-local-iis-website-after-3-credential-prompts.aspx

I would only recommend to disable the Loopback checking for developing environments.

Disable Loopback Checking

  1. open regedit
  2. Find HKLM\System\CurrentControlSet\Control\Lsa
  3. Create a new DWORD value called DisableLoopbackCheck and give it a value of 1
  4. Restart the computer

Tags:

Information | SharePoint | Windows

Windows Vista and batch files: UAC changes the rules (Part 1 of 2)

by Shawn March 03, 2009 10:15

This is a reprint of the article from: http://www.romhack.net/index.php?post/2008/08/18/Windows-Vista-and-batch-files%3A-UAC-changes-the-rules-Part-1-of-2 

Windows Vista… whenever I hear this name, the first I think about is the polemic and only then about the Operating System. Vista has been the target of many criticisms, some justified, some simple matters of personal taste, and some only created to put gasoline on the fire. As such, many IT professionals expressed a great dislike of UAC (User Account Control), one of the main new security features of Vista, especially because they felt it was getting in their ways too often and that they knew their job well enough to not be bugged by it. Even if they are of course able to disable it on the computers they use, they would still have to bear with it on the other computers of their networks or on their customer’s machines: they simply can’t disregard UAC’s existence and have to cope with it and make sure their software and products get along nicely with it.

Personally, I don’t dislike UAC as it is helps reducing the risks of malware infection and of an user doing something dangerous rather than having it all the time running as admin (to be honest, in corporate environment, I even prefer to have users run as real users rather than as pseudo-administrators behind the UAC safeguard, which has been possible way before Vista but that’s another topic…)

For various reasons, I’m still running on Windows XP but have a Windows Vista virtual machine that I fire up whenever I need to check if one of my programs or scripts run properly on it. Today, I wrote a batch file as a test/prototype to include it in a bigger script written in the AutoIT scripting language (good scripting language that I’m going to talk about someday). Batch files may be outdated, lack features (try to do some nested conditions/branching without the script becoming a mess…) but they have the advantage to work relatively the same way on all the NT-based operating systems (or so I thought), do not need any compilation or runtime to install on the machines and provided you do not try to do anything overly complex, they have the most straightforward syntax of any scripting language you may find, all of which makes it great to quickly test ideas involving more externals programs than complex language features.

So my little batch file had several independent executables residing in the same directory as its own’s (very classic approach), which means that they were referenced in the script by base file name, without path. Everything worked fine under XP so I decided to unpack a pristine Vista virtual machine and do the test on this operating system. This script was adding a network adapter using an external executable, which is obviously an action requiring administrative privileges. In Vista, I got into the directory containing my script, right clicked on it and selected the “Run as Administrator” option… and then the problems started…

Several message boxes were complaining that the executables files referenced by my script could not be found. A bit surprised, I looked again and they were all  there. Suspecting a Path issue, I then added a “Echo %CD%” at the start of my script, which quickly confirmed the problem.

The “Echo %CD%” command reveals that the current directory was changed to system32 instead of remaining in the script’s directory
The “Echo %CD%” command reveals that the current directory was changed to system32 instead of remaining in the script’s directory

When running the script in elevated mode, the current directory was changed to C:\Windows\System32 directory (since it is where the cmd.exe command interpreter lies) and as a result, the executables that were residing in the script’s directory could not be found. It is the difference between the current directory and the application’s directory. I knew I wouldn’t have this problem with the AutoIt version as it provides easy ways to retrieve the path name the script resides in, but it is more complex with batch files and I was curious on how to fix the problem.

The surprising thing is that launching the script from the directory by double-clicking on it always worked in previous versions of the operating system, even the 16-bits ones as far as I can remember, so it isn’t really an expected change. While this feature was maybe not documented anywhere, it had become a given among scripters and I wonder how many batch files this change broke (although the problem only impacts those launched by clicking on them from the shell). I decided to check the differences between the ways the script was launched in non-elevated and elevated mode using Regedit and debuggers/monitors.

The command string used to run a batch file in normal, non-elevated, mode
The command string used to run a batch file in normal, non-elevated, mode

OllyDBG reveals the API call corresponding to a double click on the batch file from Explorer in non-elevated mode 
OllyDBG reveals the API call corresponding to a double click on the batch file from Explorer in non-elevated mode

The command string used to run a batch file in elevated mode  
The command string used to run a batch file in elevated mode

Process Monitor reveals that the API called when running the batch file from the “Run as Administrator” option is CreateProcessAsUser
Process Monitor reveals that the API called when running the batch file from the “Run as Administrator” option is CreateProcessAsUser

As we can see, the non-elevated command simply references the script’s file name as an argument (%1), which gets executed by CreateProcess (with the lpCurrentDirectory parameter correctly set to the batch file’s directory), while the command used by the “Run As Administrator” option also includes the full path to the command-line interpreter (%SystemRoot%\System32\cmd.exe). The API function launching the process in this case seems to be CreateProcessAsUser. Unfortunately, in the latter case, I didn’t manage to view the parameters passed to the function as I didn’t manage to hook the function: the API Spy I use needs to run elevated to successfully register its hooks and then start the program I want to inspect, but which would in this case run elevated as well because being a child of the API Spy application, which is itself elevated. Unfortunately, even clicking on “Run as Administrator” ends up calling CreateProcess instead of CreateProcessAsUser in this case (because UAC doesn’t trigger since Explorer is running elevated because the API Spy itself was running elevated… sorry, still following me?). Nevertheless, my theory, even though I couldn’t confirm it is that the problem lies in the lpCurrentDirectory parameter being set to %SystemRoot%\System32 instead than the batch’s file directory.

Now, even if we try modifying the batch’s runas registry entry to work around the issue (which doesn’t work anyway), it would only impact our machine and not the other ones, so, beyond any academic curiosity, what is actually needed is to find a fix to this behaviour that can be implemented at the beginning of the batch file, by running a command changing the current directory from whatever its current value is to the directory of our script. Here is a command sequence that did the trick for me:

@Echo off
pushd "%CD%"
CD /D "%~dp0"
REM Insert your code herepopd

pushd pushes the current directory value to the stack (similar to the push assembly instruction). In other words, it backups the current directory’s path (%SystemRoot%\System32\cmd.exe in our case of the elevated script) that we will restore a bit later. It is always nice to leave things as we found them in the first place to avoid further compatibility problems. Besides, other scripts calling this particular script may not expect this behaviour of changing the current directory and may break as the result, so it is better be safe than sorry and clean up after we are done.

CD /D "%~dp0" is going to change the current directory to the directory containing the running batch file. The /D switch is required in case our script resides in a different drive than %systemdrive% (aka C: in most cases). %~dp0 is a rather weird syntax and I have no idea of what it stands for, nor did I find a reference to any other ~dpX commands (%~dp1 doesn’t do anything for example) and even my favorite book on Command-Line scripting has nothing to say about it. As I was saying earlier, batch files have a very straightforward syntax for simple things but an incredibly obscure and strict one when you try to do something a little bit advanced (I’m thinking about this very %~dp0 variable and the for constructs).

Finally, popd restores the current directory that we previously backed up using pushd. Note that popd doesn’t require any argument and will automatically restore the path at the top of its stack.

With this, our batch file behaves the same way on Vista in elevated mode than it does on XP, but the risk to forget to add these 3 lines every time is real so in the next article I will show a little trick to make sure they get added every time automatically so they are never accidentally forgotten and to save the trouble and frustration of adding them manually every time.

Tags:

Windows

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen | Modified by Mooglegiant