Friday, August 10, 2012

How to Use the BCDEDIT Command Line Tool





INFORMATION
This will show you how to use BCDEDIT in the command prompt and avoid the need of third party applications like EasyBCD.


NOTE
Bcdedit is a really powerful tool that Windows Vista and Windows 7 uses to manage the boot loader entries.

BCDEDIT needs a boot loader file to boot your system.


A boot loader is a file that contains necessary information that instruct the system how to boot/start an operating system.
Windows 7 and Vista bootloader file is \bootmgr
Windows XP bootloader file is \ntldr
BCDEDIT can support other bootloaders too, like grub for linux. You just have to place the bootloader file on the root of the boot manager partition. e.g. \grldr and you have a grub boot loader enabled.

Bcdedit edits a file called bcd , which is located in Windows 7's hidden partition under \boot\bcd.
In Vista, its located under C:\boot\bcd.

WARNING
You must be logged on in an administrator account to be able to do this tutorial.

To Use bcdedit:

2. Type bcdedit and press enter.
NOTE: By typing just bcdedit you just list your boot entries.



EXAMPLE:

A boot entry consists of 4 main elements:
1. Identifier
The identifier is how the system has named the boot entry.

2. Device
The device is the drive or virtual image that the system will use to boot the boot entry.

3. Path
The path is the location on the device where the bootloader file is found.

4. Description
The description is the friendly name we give to our boot entry, e.g. "Windows 7"
You see next to the identifiers their UUIDs in {}. The UUID is the unique codename that the system gives to each boot entry and cannot be changed.

The standard identifier UUIDs are explained below:
{bootmgr} = the boot manager
{current} = the OS you selected to boot at startup.
{default} = the default OS selected to boot the PC.
{ntldr} = Windows Legacy OS Loader (for windows xp)
there are others like {memdiag} or {ramdisk} but they can't be of much use right now.

WARNING
IMPORTANT: make a backup of your bcd file first. To do that, type:

bcdedit /export C:\SAVEDBCD

This will create a file c:\savebcd which is your boot entry backup.
If you mess up, you can always undo changes by:

bcdedit /import c:\savedbcd

Now to see how we can control the above entries, here are some examples:
bcdedit /set {current} description "My edited Windows Boot Entry"
NOTE: This changes the title of the boot menu entry "{current}".

bcdedit /set {ntldr} device partition=E:
NOTE: This tells bcd that Windows XP partition is drive E:

bcdedit /set {ntldr} path \ntldr
NOTE: This tells bcd that the ntldr file which is the winxp bootloader is on root folder "\" (of drive e: as stated above)

bcdedit /displayorder {ntldr} /addfirst
NOTE: This places Windows XP as the first OS on the menu list.

bcdedit /default {ntldr}
NOTE: This places Windows XP as the default OS to boot first with.

bcdedit /displayorder {33342343-3424-2342342342-2344} /addlast

NOTE: This tells bcd that the boot entry with UUID 3334... should be the last entry on the menu.

You can copy your existing VISTA or Windows 7 boot entry to another identical. Then you can change settings on the new entry to experiment. You will always have the first entry available, so it's safe to play with.
bcdedit /copy {current} /d "New Windows 7 boot entry I just copied!"
this will give you a line:

NOTE: The entry was successfully copied to {4c21825f-e04b-11dd-b760-00195b61617a}. The {4c21825f-e04b-11dd-b760-00195b61617a} is the UUID of the new entry that the system just created. Yours will be different than mine! This is its identifier and you should use this to address that entry. Example:

bcdedit /set {4c21825f-e04b-11dd-b760-00195b61617a} numpoc 2

NOTE: This adds the 2 CPU Core support during boot, like you do in msconfig.

bcdedit /deletevalue {4c21825f-e04b-11dd-b760-00195b61617a} numproc
NOTE: This deletes the numproc parameter from entry {4c21825f....}

bcdedit /delete {4c21825f-e04b-11dd-b760-00195b61617a}

NOTE: This deletes the boot entry {4c21825f....} completely. In order to delete an {ntldr} entry, you must use the /f switch to force deletion: bcdedit /delete {ntldr} /f

You can always type just bcdedit to see your current settings.

What else can I do with BCDEDIT?

You can use BCDEDIT to alter any boot parameter , like you would in msconfig, only more. BCDEDIT works from booting with installation dvd too, so it can be handy for recovery purposes.
bcdedit /timeout 5

NOTE: This sets the wait-to-select-OS menu timeout at startup to 5 seconds . You will notice that I didn't give a UUID above. If you omit the UUID, it applies automatically to the relavant UUID. So: bcdedit /timeout 5 is identical to bcdedit /set {bootmgr} timeout 5
Some more advanced examples:
bcdedit /set {current} detecthal yes
bcdedit /set {current} detecthal no

NOTE: The above commands sets the detecthal to yes or no for entry {current}
To create a new boot entry to load Windows XP from a partition on your disk:

NOTE: The example below uses F: as the Windows XP partition. Replace with your xp drive letter.
bcdedit /create {ntldr} /d "Windows XP"

bcdedit /set {ntldr} device partition=F:

bcdedit /set {ntldr} path \ntldr

bcdedit /displayorder {ntldr} /addlast

NOTE:
Final note: BCDEDIT works from installation boot dvd too. If you mess up with a setting and you cannot boot, just boot from DVD and enter Repair Computer, then go to command prompt and there you go. You can play again with bcdedit to restore your system back.

Windows 7 bootmgr is missing press ctrl+alt +del to restart?


I am getting that error. This is what i have tried so far with no luck. 


1: booted from cd and did the option for repair
2: booted from cd and from command prompt did bootrec /rebuildbcd
3: booted from cd and from command prompt did bootrec /fixboot

4: booted from cd and from command prompt did all this
bootrec.exe /fixmbr
del c:\boot\bcd
bcdedit /createstore c:\boot\bcd.tmp
bcdedit /store c:\boot\bcd.temp /create {bootmgr} /d "Windows Boot manager"
bcdedit /import c:\boot\bcd.tmp
bcdedit /set {bootmgr} device partition=c:
bcdedit /timeout 10
del c:\boot\bcd.tmp
bcdedit /create /d "Windows 7" /application osloader

"this part in the {123} just replace with whatever is on your screen from the previous command
bcdedit /set {123} device partition=c:
bcdedit /set {123} osdevice partition=c:
bcdedit /set {123} path \Windows\system32\winload.exe
bcdedit /set {123} systemroot \Windows
bcdedit /displayorder {123}
exit

--------------------------------------…
Anyway all these different ways said they were successful after running them , but i still get the bootmgr is missing error.

Thursday, July 26, 2012

Trojan (003ab71d1)


Overview
Date Discovered6-Jul-12 12:07:00
Added DAT Info9.142.7000
Threat assesmentLow
Virus TypeTrojan
Affected OSWindows Vista
Windows XP
Windows 2003 Server
Windows 2000
Length49664
AliasesTrojan.Win32.Jorik.Androm.ni (AVP)
Technical Information
  • Copies itself as svchost.exe in the %Documents and Settings%\All Users folder
  • Adds the value
SunJavaUpdateSched = %Documents and Settings%\All Users\svchost.exe
under the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
in the Windows registry to hook system startup.
  • This trojan attempts to download malicious files on the victim machine.
Removal Procedure
  • Update the product to the latest version.
  • Restart the system in safe mode.
  • Run a full system scan.
  • Delete all the files detected as infected with this virus.
  • Open the Windows Registry Editor.
  • Delete the value
SunJavaUpdateSched = %Documents and Settings%\All Users\svchost.exe
under the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
  • Close the Windows Registry Editor.
  • Restart the system.

Trojan-Downloader (00321d031)



Overview
Date Discovered9-Jul-12 12:07:00
Added DAT Info9.135.6547
Threat assesmentLow
Virus TypeTrojan
Affected OSWindows Vista
Windows XP
Windows 2003 Server
Windows 2000
Length50688
AliasesTrojan-Downloader.Win32.Injecter.hpx (AVP)
Technical Information
  • Copies itself as csrss.exe in the %Application Data% folder.
  • Adds the value
Winternals = %Application Data%\csrss.exe
under the key
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run
in the Windows registry to hook system startup.
  • This trojan attempts to download malicious files on the victim machine.
Removal Procedure
  • Update the product to the latest version.
  • Restart the system in safe mode.
  • Run a full system scan.
  • Delete all the files detected as infected with this virus.
  • Open the Windows Registry Editor.
  • Delete the value
Winternals = %Application Data%\csrss.exe
under the key
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run
  • Close the Windows Registry Editor.
  • Restart the system.

Wednesday, June 27, 2012

How to back up Outlook Express items

Step 1: Copy message files to a backup folder

Step A: Locate the Store folder
  1. Start Outlook Express.
  2. Click Tools, and then click Options.
  3. On the Maintenance tab, click Store Folder.
  4. In the Store Location dialog box, copy the store location. To do this, follow these steps:
    1. Put the mouse pointer at one end of the box under the Your personal message store is located in the following folder box.
    2. Press and hold the left mouse button, and then drag the mouse pointer across the Your personal message store is located in the following folder box.
    3. Press CTRL+C to copy the location.
  5. Click Cancel, and then click Cancel again to close the dialog box.
Step B: Copy the contents of the Store folder
  1. Click Start, click Run, press CTRL+V, and then click OK.
  2. On the Edit menu, click Select All.
  3. On the Edit menu, click Copy, and then close the window.
Step C: Create a backup folder
  1. Right-click any empty area on your desktop, click New, and then click Folder.
  2. Type Mail Backup for the folder name, and then press ENTER.
Step D: Paste the contents of the Store folder into the backup folder
  1. Double-click the Mail Backup folder to open it.
  2. Right-click inside the Mail Backup folder window, and then click Paste.

Step 2: Export the Address Book to a .csv file

Important Make sure that you follow this step if you use multiple identities in Outlook Express.

Microsoft Outlook Express 5.x and Microsoft Outlook Express 6.0 use a Windows Address Book (.wab) file to store Address Book data. The individual data for each identity is stored in a folder by user name within the .wab file that is used.

The only way to separate the Address Book data for different identities is to export the data to a .csv file while you are logged in as a specific identity. If the .wab file becomes dissociated from the user identities, the data can be exported only as one total. In this case, the data cannot be exported folder by folder.

There is another reason to export the .wab file to a .csv file. If the .wab file not exported to a .csv file, but the .wab file is shared with Microsoft Outlook, the addresses are stored in the personal folders (.pst) file in Outlook. When you export the file to a .csv file by using the File menu in Outlook Express, the correct contacts are exported. However, if the Address Book is shared with Outlook, you cannot use the File menu option to export from the Address Book. This option is unavailable.

To export the Address Book to a .csv file, follow these steps:
  1. On the File menu, click Export, and then click Address Book.
  2. Click Text File (Comma Separated Values), and then click Export.
  3. Click Browse.
  4. Select the Mail Backup folder that you created.
  5. In the File Name box, type address book backup, and then click Save.
  6. Click Next.
  7. Click to select the check boxes for the fields that you want to export, and then click Finish.
  8. Click OK, and then click Close.

Step 3: Export the mail account to a file

  1. On the Tools menu, click Accounts.
  2. On the Mail tab, click the mail account that you want to export, and then click Export.
  3. In the Save In box, select the Mail Backup folder, and then click Save.
  4. Repeat these steps for each mail account that you want to export.
  5. Click Close.

Step 4: Export the newsgroup account to a file

  1. On the Tools menu, click Accounts.
  2. On the News tab, click the news account that you want to export, and then click Export.
  3. In the Save In box, select the Mail Backup folder, and then click Save.
  4. Repeat these steps for each news account that you want to export.
  5. Click Close.

How to restore Outlook Express items

Note To restore items when you use multiple identities in Outlook Express, you may have to re-create the identities before you follow these steps. Repeat each step as needed for each identity.

Step 1: Import messages from the backup folder

  1. On the File menu, point to Import, and then click Messages.
  2. In the Select an e-mail program to import from box, click Microsoft Outlook Express 5 or Microsoft Outlook Express 6, and then click Next.
  3. Click Import mail from an OE5 store directory or Import mail from an OE6 store directory, and then click OK.
  4. Click Browse, and then click the Mail Backup folder.
  5. Click OK, and then click Next.
  6. Click All folders, click Next, and then click Finish.

Step 2: Import the Address Book file

  1. On the File menu, click Import, and then click Other Address Book.
  2. Click Text File (Comma Separated Values), and then click Import.
  3. Click Browse.
  4. Select the Mail Backup folder, click the address book backup.csv file, and then click Open.
  5. Click Next, and then click Finish.
  6. Click OK, and then click Close.

Step 3: Import the mail account file

  1. On the Tools menu, click Accounts.
  2. On the Mail tab, click Import.
  3. In the Look In box, select the Mail Backup folder.
  4. Click the mail account that you want to import, and then click Open.
  5. Repeat these steps for each mail account that you want to import.
  6. Click Close.

Step 4: Import the newsgroup account file

  1. On the Tools menu, click Accounts.
  2. On the News tab, click Import.
  3. In the Look In box, select the Mail Backup folder.
  4. Click the news account that you want to import, and then click Open.
  5. Repeat these steps for each news account that you want to import.
  6. Click Close.

How to preserve the Blocked Senders list and other e-mail rules

For more information about how to preserve the blocked senders list and other e-mail rules, click the following article number to view the article in the Microsoft Knowledge Base:
276511  (http://support.microsoft.com/kb/276511/ ) How to back up and restore Outlook Express Blocked Senders list and other mail rules

Friday, June 1, 2012

Boot-Repair for back linux on windows installed pc






Boot-Repair is a simple tool to repair frequent boot issues you may encounter in Ubuntu like when you can't boot Ubuntu after installing Windows or another Linux distribution, or when you can't boot Windows after installing Ubuntu, or when GRUB is not displayed anymore, some upgrade breaks GRUB, etc.
Boot-Repair lets you fix these issues with a simple click, which (generally reinstalls GRUB and) restores access to the operating systems you had installed before the issue.
Boot-Repair also has advanced options to backup table partitions, backup bootsectors, create a Boot-Info-Summary (to get help by email or forum), or change the default repair parameters: configure GRUB, add kernel options (acpi=off ...), purge GRUB, change the default OS, restore a Windows-compatible MBR, repair a broken filesystem, specify the disk where GRUB should be installed, etc.
Boot-Repair is a free software, licensed under GNU-GPL. Boot-Repair should be soon included in Ubuntu official repositories, until then use it at your own risks.
http://pix.toile-libre.org/upload/original/1335260967.png

Getting Boot-Repair

1st option : get a CD including Boot-Repair

The easiest way to use Boot-Repair is to burn one of the following disks and boot on it.
  • Boot-Repair-Disk is a CD starting Boot-Repair automatically. (English only, 32&64bits compatible, based on Debian-live so Wifi drivers are not recent).
  • Boot-Repair is also included in Ubuntu-Secure-Remix (multi-languages, ok for Wifi, based on Ubuntu 12.04 LTS, run Boot-Repair from the Dash)
Remark : you can also install the ISO on a live-USB (eg via UnetBootin, LiliUSB or MultiSystem).

2nd option : install Boot-Repair in Ubuntu

Remark: this can also be performed from a live-CD or live-USB.
Either add ‘ppa:yannubuntu/boot-repair’ to your Software Sources via the Software Centre or, for speeds-sake, add it using a new Terminal session:
sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
Boot-Repair can be installed & used from any Ubuntu session (normal session, or live-CD, or live-USB). PPA packages are available for Ubuntu 10.04, 10.10, 11.04, 11.10 and 12.04.

Using Boot-Repair

  • launch Boot-Repair from either :
    • the dash (Unity)
    • System->Administration->Boot-Repair menu (Gnome)
    • by typing 'boot-repair' in a terminal
  • Then try "Recommended repair" button. When repair is finished, note the URL that appeared on a paper, then reboot and check if you recovered access to your OSs. 
If the repair did not succeed, indicate the URL to people who help you by email or forum.

Advanced options

http://pix.toile-libre.org/upload/img/1335263156.png http://pix.toile-libre.org/upload/img/1335263804.png http://pix.toile-libre.org/upload/img/1335263271.png http://pix.toile-libre.org/upload/img/1335263417.png http://pix.toile-libre.org/upload/img/1335263366.png

RecoveringUbuntuAfterInstallingWindows






This page documents how to restore or recover the boot-loader (GRUB) after installing Windows. Some reasons to repair your boot-loader might include installing Microsoft Windows after you have installed Ubuntu, adding or removing a hard drive, or changing hard drive settings.

Using the Ubuntu CD (Recommended)

The graphical way

  • Insert your Ubuntu CD, reboot your computer and set it to boot from CD in the BIOS and boot into a live session. You can also use a LiveUSB if you have created one in the past.
  • Install and run Boot-Repair
  • After this, click "Recommended repair" and apply. If you are willing to use the advanced options, make sure you leave the "Reinstall GRUB" checkbox ticked.
  • Now reboot your system. The usual GRUB boot menu should appear. If it does not, hold Left Shift while booting. You will be able to choose between Ubuntu and Windows.

The terminal way

* Open a terminal. As of Ubuntu 11.10 and 11.04, this can be done by opening the Unity Dash (you can click the Ubuntu logo in the top panel or use the Windows key on your keyboard) and typing in "Terminal", and clicking what comes up. On earlier versions, you can achieve this by going to Applications -> Accessories -> Terminal.
  • You are then presented with a standard bash prompt, type:
sudo grub-install /dev/XXX
where XXX is the device of your Ubuntu install. (eg: grub-install /dev/sdb). Hint: You can also use /dev/disk/by-label/ if the partition you installed on has a label. You can determine the /dev node for such a device by running:
ls -l /dev/disk/by-label/
This will give the output of something like:
lrwxrwxrwx 1 root root 10 Oct 16 10:27 data -> ../../sdb2
lrwxrwxrwx 1 root root 10 Oct 16 10:27 data2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct 16 10:27 fat -> ../../sda6
lrwxrwxrwx 1 root root 10 Oct 16 10:27 home -> ../../sda7
lrwxrwxrwx 1 root root 10 Oct 16 10:27 root -> ../../sda1
lrwxrwxrwx 1 root root 10 Oct 16 10:27 swap -> ../../sda5
lrwxrwxrwx 1 root root 10 Oct 16 10:27 windows -> ../../sdb1
You can also use fdisk if you do not see the /dev/disk/by-label:
$ sudo fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001bc54

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       18725   150403072   83  Linux
/dev/sda2           18725       19458     5884929    5  Extended
/dev/sda5           18725       19458     5884928   82  Linux swap / Solaris

Disk /dev/sdb: 15.1 GB, 15103033344 bytes
64 heads, 32 sectors/track, 14403 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00068852

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       14403    14748656    c  W95 FAT32 (LBA)
From here, find only the drive name, ignore the partition number, that is, for partitions labeled "root", "data2", "fat", "home" and "swap" it's all still just sda. This is due to the fact that GRUB is installed in the MBR of the drive, and not on a partition.
  • Now reboot your system. The usual GRUB boot menu should appear. If it does not, hold Left Shift while booting. You will be able to choose between Ubuntu and Windows.

Using the Ubuntu Alternate CD

  • Boot your system from the Ubuntu Alternate CD.
  • When the Ubuntu splash screen comes up with the boot: prompt, type in rescue and press enter.
  • Choose your language, location (country) and then keyboard layout as if you were doing a fresh install.
  • Enter a host name, or leave it with the default (Ubuntu).
  • At this stage you are presented with a screen where you can select which partition is your root partition (there is a list of the partitions on your hard drive, so you are required to know which partition number Ubuntu is on). This will be dev/discs/discY/partX, where the X is a partition number and Y is the number of the drive.
  • Now proceed as described in "The terminal way" above.

See also