IT Ramblings

Ramblings from an IT manager and long time developer.

NAVIGATION - SEARCH

Sudo for Windows

With the existance of UAC in the windows world, I find my self looking for easier ways to run a command as administrator (usually via command line) without needing to turn off UAC.

Here are some useful links that helped me solve this very issue

Elevation Power Toys

http://technet.microsoft.com/en-us/magazine/2008.06.elevation.aspx  (note, you also need to sysinternals suite installed in "%ProgramFiles%\Sysinternal Suite"

Elevate Utility

http://code.kliu.org/misc/elevate/

Sudo for windows

http://sourceforge.net/projects/sudowin/

A couple of useful free tools

FreeCommanderis an easy-to-use alternative to the standard windows file manager. The program helps you with daily work in Windows. Here you can find all the necessary functions to manage your data stock. You can take FreeCommander anywhere - just copy the installation directory on a CD or USB-Stick - and you can even work with this program on a foreign computer.

FuturixImager is a compact and customizable image viewer. It is capable of opening more then 40 file types, including all most popular ones (GIF, JPEG, PNG, TIFF, JPEG2000, raw, DNG).

Texter saves you countless keystrokes by replacing abbreviations with commonly used phrases you define. Unlike software-specific text replacement features, Texter runs in the Windows system tray and works in any application you're typing in. Texter can also set return-to markers for your cursor and insert clipboard contents into your replacement text, in addition to more advanced keyboard macros.

Stickies is a PC utility was written to try to cut down on the number of yellow notes I was leaving stuck to my monitor. It is a computerised version of those notes. The design goal behind Stickies is that the program is small and simple. Stickies will not mess with your system files, or write to the registry. Stickies stores information in a single text-based ini file. 

ShellRunAs is a command-line tool call Runas that is handy for launching programs under different accounts, but it’s not convenient if you’re a heavy Explorer user. ShellRunas provides functionality similar to that of Runas to launch programs as a different user via a convenient shell context-menu entry. Read more..

Command Prompt Here tool

Running 32-bit version of the Windows Side Bar on x64 System

After getting Windows 7 x64 installed, I was having a problem getting a few gadgets to work correctly (like the Pandora Gadget). It turns out this gadget uses Flash, which only comes in a 32 bit version. The Sidebar is x64, and can't access Flash. Since there is no x64 version of flash (come on Adobe -- its time to bite the bullet!!), I started digging around for a way to overcome this limitation -- as luck would have it, Microsoft ships the 32-bit version of the side bar in the x64 versions.  Now all I needed to do was get it to startup instead of the default x64 bit version.

Edit the following Registry Key:
\\HKCU\Software\Microsoft\Windows\CurrentVersion\Run\SideBar

Change the key to this: C:\Program Files (x86)\Windows Sidebar\sidebar.exe /autoRun

(The only addition is loading sidebar.exe from c:\program files (x86)\ instead of c:\program files\)

This should get you by until Adobe gets their act together!

Boot from VHD (Windows 7 and/or Server 2008 R2)

Windows 7 Boot from VHD

One of the new features in Windows 7 and Windows Server 2008 R2 is the ability to boot from a VHD. This allows for the use of multiple operation systems on a single computer (like when using Virtualization) however it has much better performance as the OS boots natively.  The great part is that it is pretty simple to enable this feature and have it ready at your disposal!  Before you begin you should note the following…

·         You can only boot a Windows 7 or Windows Server 2008 R2 VHD

·         You must configure the boot editor from a Windows 7 or Server 2008 R2 install

·         You cannot use a Virtual PC VHD, I suggest a Hyper-V VHD

·         You need to start with a clean slate, don’t try and reuse an old VHD

Start by launching a Command Prompt and be sure to run as Administrator, once that is done run the following commands…

bcdedit /copy {current} /d “Boot From VHD (put any name here)”

Copy the CSLID that is displayed and then run…

bcdedit /set {CLSID} device vhd=[C:]\vhdname.vhd

bcdedit /set {CLSID} osdevice vhd=[C:]\vhdname.vhd

bcdedit /set {CLSID} detecthal on

You can replace [C:]\vhdname.vhd with the path and name of your VHD.

Once that is complete reboot and you will have the option to “Boot_From_VHD”!  You can verify the bootloader is configured correctly with the bcdedit command which will list all the boot options.  If you want to delete the entry make note of the GUID listed in bcdedit and use the following command…

bcdedit /delete {GUID} /cleanup

For more information be sure to check out the Windows 7 resource page on Technet.com

Some other useful links:

http://blogs.msdn.com/b/knom/archive/2009/04/07/windows-7-vhd-boot-setup-guideline.aspx

 

 

Just a few of my favorite sidebar gadets

All CPU Meter (http://gallery.live.com/liveItemDetail.aspx?li=587ef54f-e121-418b-b258-e583e105a0d6&bt=1&pl=1)

Network Meter (http://gallery.live.com/liveItemDetail.aspx?li=86656dc5-b0fe-489d-b115-44a76e050f63&bt=1&pl=1)

Outlook Upcoming Appointments (http://gallery.live.com/liveItemDetail.aspx?li=ed840437-7d13-4755-8d0a-0ba2cbbf38e6&bt=1&pl=1)

Drive Meter (http://gallery.live.com/liveItemDetail.aspx?li=19f3ac79-f0b5-479f-9885-3371a51fe247)
or (http://gallery.live.com/liveItemDetail.aspx?li=2604f986-f510-48b9-94c9-10c0d786dd5f&bt=1&pl=1)

Top Process [original] (http://gallery.live.com/liveItemDetail.aspx?li=681102c2-5dde-44d2-a33a-96dbff32517a&bt=1)

XM Radio (http://gallery.live.com/liveItemDetail.aspx?li=25047e29-49f4-42ea-a10a-f05e6747b49a&bt=1&pl=1)

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

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.