Pages

Showing posts with label WINDOWS. Show all posts
Showing posts with label WINDOWS. Show all posts

Wednesday, June 11, 2014

Putty + Remote tunnel + RDP

Installing Putty and Configuring SSH Tunnel and Remote Desktop

On the CLIENT computer we are connecting from, we will need to install Putty and configure it to connect RDP over SSH (ie create the tunnel).

1. To install putty, just extract the Zip for to your C:\Putty folder.  The Putty folder should contain several .exe programs.

2. To run putty, we will just run the Putty.exe in the C:\Putty folder.  To make it easier to launch, you can create a shortcut to Putty.exe and put it on your desktop or in your Start Menu.

3. Under the Session section (on left pane), type in the host name of the pc we are connecting to (in our example on our local network). 10.0.1.5 and leave the port at 22.  Also you can go under the Saved Session box and enter a name to save the profile as for easy connection (more later on this).

Under the Connection > SSH Tunnels tab, under Source Port, enter in a local port to connect to as our tunnel (i use a very high port in the 40000 range, we’ll use 40000), in the Destination box, we can put in the ip address of the remote computer we have running Copssh/SSH, 10.0.1.5 in my example.




Go back to the Sessions section and click the Save button under the Saved Sessions box and then hit the Open button.

4. You should get a prompt to accept a key the first time we connect, click Yes.

5.  We now should get a command window like interface asking for a user.  Enter your remote computers login username and password.  Once you connect, the command window will change to a local window.

Connecting via Remote Desktop over the SSH Tunnel

1. On the laptop/client computer, open Remote Desktop Connection (Start Menu > All Programs > Accessories > Remote Desktop Connection)

2. Enter in 127.0.0.1:40000 for the computer to connect to.

127.0.0.1 = the local tcp/ip stack loopback address and 40000 = port to connect over.  This in turn forces our remote desktop client to use the SSH tunnel we created at 40000 to connect to our remote pc at the 22 port.

Saturday, May 17, 2014

Enable up/Down arrow in powershell

For this, you need PSReadline. First, install PsGet if you don’t have it:To install it just run the following URL in powershell.

(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1 ' ') | iex
Then, install PSReadline:

install-module PSReadline
Import PSReadline after loading the persistent history:

Import-Module PSReadLine
And you will be able to recall previous commands with up arrow key. Add the following to have partial history search with up/down arrow key:

Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
Lastly, to enable bash style completion:

Set-PSReadlineKeyHandler -Key Tab -Function Complete

History Command in PowerShell

To add the a command to a new or existing profile
On the computer that hosts the data warehouse management server,

click Start, point to Programs, point to Windows PowerShell 1.0, right-click Windows PowerShell, and then click Run as administrator.
At the Windows PowerShell prompt, type the following command, and then press ENTER:
>>Test-path $profile
If the results of the previous command are false, go to step 4. If the results are true, go to step 5.
Type the following command, and then press ENTER.
New-item –type file –force $profile
Type the following command, and then press ENTER.
Notepad $profile

Add the following Content into profile file.

===================

Set-Location C:\
$a = Get-Date
“Date: ” + $a.ToShortDateString()
“Time: ” + $a.ToShortTimeString()
$MaximumHistoryCount = 1KB

if (!(Test-Path ~\PowerShell -PathType Container))
{ New-Item ~\PowerShell -ItemType Directory
}

function bye
{ Get-History -Count 1KB |Export-CSV ~\PowerShell\history.csv
exit
}

if (Test-path ~\PowerShell\History.csv)
{ Import-CSV ~\PowerShell\History.csv |Add-History
}

====================


 

PS> Get-History |Get-Member -MemberType Property
TypeName: Microsoft.PowerShell.Commands.HistoryInfo

Name MemberType Definition
---- ---------- ----------
CommandLine Property System.String CommandLine {get;}
EndExecutionTime Property System.DateTime EndExecutionTime {get;}
ExecutionStatus Property System.Management.Automation.Runspaces.Pip...
Id Property System.Int64 Id {get;}
StartExecutionTime Property System.DateTime StartExecutionTime {get;}

This means that you can find out when something was executed (e.g. which session it happened in) using the following command:

PS> ghy |ft id,endexecutiontime,commandline -auto

Id EndExecutionTime CommandLine
-- ---------------- -----------
612 6/29/2006 5:39:34 AM gcm export-csv |fl *
613 6/30/2006 6:51:16 PM ipconfig
614 6/30/2006 8:51:38 PM cd C:\kits

 

Friday, May 16, 2014

Create a Windows PowerShell Profile

To add the a command to a new or existing profile
On the computer that hosts the data warehouse management server, click Start, point to Programs, point to Windows PowerShell 1.0, right-click Windows PowerShell, and then click Run as administrator.
At the Windows PowerShell prompt, type the following command, and then press ENTER:
Test-path $profile
If the results of the previous command are false, go to step 4. If the results are true, go to step 5.
Type the following command, and then press ENTER.
New-item –type file –force $profile
Type the following command, and then press ENTER.
Notepad $profile
In the profile, type the command you need ,If you are adding this command to an existing profile, add it on a new line at the end of the profile.
On the menu bar, click File, and then click Exit.
In Notepad, click Save.
Type the following commands, and then press ENTER after each command.
Set-ExecutionPolicy RemoteSigned
. $profile

Thursday, April 24, 2014

Flush Your Local DNS Cache

 

Windows Vista/Windows 7:
ipconfig /flushdns
Successfully flushed the DNS Resolver Cache.

Windows XP
ipconfig /flushdns
Successfully flushed the DNS Resolver Cache.

Mac OS X 10.5.2 and above
dscacheutil -flushcache

Mac OS X 10.5.1 and below
Click on the Finder icon in your dock. Open your Applications folder.
Inside the Applications folder, click on Utilities and then Terminal.
Type the following command in the Terminal window and press Enter:
lookupd -flushcache

Linux

nscd -i hosts
– Clear local DNS cache for current user.
nscd -I hosts
– Clear local DNS cache for all users.

Tuesday, February 19, 2013

Connecting wireless through command line

The first command you need to use is ifconfig. With this command you are going to enable your wireless device. Most likely your device will be called wlan0. So in order to enable this you would enter the command (as root):

ifconfig wlan0 up

You won’t see any feedback unless there is a problem.

The next step is to scan for your wireless network to make sure it is available. Do this with the following command:

iwlist wlan0 scan

With this command you will see output like the following:

Cell 01 - Address: 00:21:43:4E:9B:F0
ESSID:"HAIR STROBEL"
Mode:Master
Channel:5
Frequency:2.432 GHz (Channel 5)
Quality=100/100? Signal level:-45 dBm? Noise level=-95 dBm
Encryption key:on
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 22 Mb/s
6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
36 Mb/s; 48 Mb/s; 54 Mb/s
Extra:tsf=000002f1d9be01b7


So you know this network is available. From the above output you can also see this network is employing WPA2, so you will need a passkey. If you don’t know that passkey, you are out of luck (which would be the case no matter if you were using a front end in Linux, Windows, or Mac.)

Now it’s time to configure your connection. To do this issue the command:

iwconfig wlan0 essid NETWORK_ID key WIRELESS_KEY

Where NETWORK_ID is the ESSID of the network with which you want to connect and WIRELESS_KEY is the security key needed to connect to the wireless access point.

Note: iwconfig defaults to using a HEX key. If you want to use an ascii key you will have to add the “s:” prefix to your key like so:

iwconfig wlan0 essid NETWORK_ID key s:WIRELESS_KEY

Now that you have your configuration set, it’s time to get an IP address with the help of dhclient. Issue the command:

dhclient wlan0

If no output is reported there are no errors. You should now be up and running.

Make it a script

Of course who wants to type out all of those commands. Instead of doing this you could create a script for this like so:

#! /bin/bash
ifconfig wlan0
iwconfig wlan0 essid NETWORK_ID key WIRELESS_KEY
dhclient wlan0


Where NETWORK_ID is the actually essid of the network and WIRELESS_KEY is the security key for that network. Save this script with the filename wireless_up.sh and then make this script executable with the command:

chmod u+x wireless_up.sh

You can make this a global command by placing this script in /usr/local/bin. You can now issue the command wireless_up.sh from anywhere in your directory structure and it will run, connecting you to the configured wireless access point.

 
sudo iwconfig wlan0 freq 2.422G

Or by running:
sudo iwconfig wlan0 channel 3

ifconfig wlan0 down
iwconfig wlan0 mode managed
ifconfig wlan0 up
iwconfig wlan0 channel 3
iwconfig wlan0 key xxxxxxxxxx
iwconfig wlan0 key restricted
iwconfig wlan0 essid "Blah Blah Foo Bar"
iwconfig wlan0 ap xx:yy:zz:aa:bb:cc
sleep 5
dhcpcd -d wlan0



Hosts file in linux and windows

The hosts file is a computer file used by an operating system to map hostnames to IP addresses. The hosts file is a plain text file, and is conventionally named hosts.

The hosts file is one of several system facilities that assists in addressing network nodes in a computer network. It is a common part of an operating system's Internet Protocol (IP) implementation, and serves the function of translating human-friendly hostnames into numeric protocol addresses, called IP addresses, that identify and locate a host in an IP network.

In some operating systems, the hosts file's content is used preferentially to other methods, such as the Domain Name System (DNS), but many systems implement name service switches (e.g., nsswitch.conf for Linux and Unix) to provide customization. Unlike the DNS, the hosts file is under the direct control of the local computer's administrator

 
















































































































Operating SystemVersion(s)Location
Unix, Unix-like, POSIX/etc/hosts[2]
Microsoft Windows3.1%WinDir%\HOSTS
95, 98/98SE, Me%WinDir%\hosts[3]
NT, 2000, XP (x86 & x64),[4] 2003, Vista, 7 and 8%SystemRoot%\system32\drivers\etc\hosts [5]
Windows MobileRegistry key under HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts
Apple Macintosh9 and earlier
Mac OS X 10.0 – 10.1.5 [6](Added through NetInfo or niload)
Mac OS X 10.2 and newer/etc/hosts (a symbolic link to /private/etc/hosts)[6]
Novell NetWareSYS:etc\hosts
OS/2 & eComStation"bootdrive":\mptn\etc\
SymbianSymbian OS 6.1–9.0C:\system\data\hosts
Symbian OS 9.1+C:\private\10000882\hosts
MorphOSNetStackENVARC:sys/net/hosts
AmigaOS4DEVS:Internet/hosts
Android/etc/hosts (a symbolic link to /system/etc/hosts)
iOSiOS 2.0 and newer/etc/hosts (a symbolic link to /private/etc/hosts)
TOPS-20
Plan 9/lib/ndb/hosts
BeOS/boot/beos/etc/hosts[7]
Haiku/boot/common/settings/network/hosts[7]
OpenVMSUCXUCX$HOST
TCPwareTCPIP$HOST

 

Tuesday, June 19, 2012

Gcc for windows-Install the MinGW (GCC) Compiler Suite and Cygwin prompt

This Gcc compiler doesn't exactly replaces the normal Linux gcc compiler .First download the file from following link and run it to install MinGW (Minimalist GNU for Windows).We need net connection to install this

http://sourceforge.net/projects/mingw/files/MinGW/





in latest MinGW you will have c compiler in the list .Select the needed components and select the path to which you need to install it.After the installation we need to set the environment .

Create a directory (e.g. C:\MinGW), download all packages to C:\MinGW, extract the files from each package, and add C:\MinGW\bin; to your PATH environment variable using C:\> set PATH=C:\MinGW\bin;%PATH%" .or set it normally with properties of mycomputer>Environment variables.

To get more linux effect in windows install Cygwin from http://www.cygwin.com/install.html to get a terminal effect.and install needed packages as needed in cygwin.to install cygwin also we need internet connection

http://www.eecg.utoronto.ca/~aamodt/ece242/cygwin.html


Monday, May 21, 2012

Connecting to ur computer through ssh and No-IP form mobile or computer

Normally we use ssh for connecting to ur system over internet form other computer or mobile.When using ssh we will be having the ip address of the computer to which we need to connect .we set up a ssh server and we will be able to connect to this server using the ip to get a prompt to use.The main problem when u connect ur computer over internet is the dynamic ip problem.that is when the connection at ur computer is lost and reconnected u get another ip address and u don't know that one.

Solution

Using No-ip to get an static ip for the computer

Actually No-ip doesn't provide any static ip but binds our current ip to a host name so that when ever the ip is changed it automatically gets assigned to the host .thus by using the host name we a access the computer.

step1. Download the no-ip software form there site and install it-->> https://www.no-ip.com/downloads.php

step2.Make an account in the No-ip site and create a host name(which is free)

step3. now add the host name into the No-ip software in ur computer.First u need to use ur login id and password in the software then it will show ur host name .u can just select it.

 

Setting up ssh in windows

we can use freesshd for ssh services in windows.

  just download it from www.freesshd.com and install it.setup an ssh server.set the listen interface to all.and create a user account .with authorization "password stored as sha1"and give the password. and turn up the ssh server

its done now we can use putty to check whether its working or not ..In putty give the host name as host name u registered in no ip and connect

to connect from mobile putty is available for android and Symbian also.in mobile putty we can give the host name and username which we have created.

 

Thursday, May 17, 2012

removing Recycler virus

the recycler virus particularly come from pendrives,ipods,mp3 players etc.....which effects our folder's hidden and read only options....so to remove this virus I've got a lengthy,yet a very effective process..

1>restart your PC in safe mode {by pressing the F8 key constantly when the PC is restarted}

2>then run an anti-spyware check...for eg.download MALWAREBYTES ANTIMALWARE [its free]

3>run a complete anti-virus scan

4>clean up your system registry by downloading-- REG SEEKER

5>restart.....

[NOTE]:AFTER THIS PROCESS NEVER OPEN YOUR PENDRIVES OR ANY REMOVAL DRIVE,INSTEAD FORMAT THEM AND THEN OPEN......

Removing the Recycler.exe virus please follow the steps below…

Reboot your computer into Safe Mode, this is important as this is a memory resident virus. Do this by pressing F8 as the machine boots up and select safe mode from the DOS menu. Once in Safe Mode, press enter to stay in safe mode, you don't want to go to Recovery.

1. Open up windows explorer, Start>Programs>Accessories>Explorer

2. Go to (In Vista press ALT to display menus) Tools>Folder Options>View>uncheck the items below: 1>display the contents of system folders

2>hide extensions for known file types

3>hide protected operating system files(Recommended) Leave the other items as they are.

3. Press Apply>OK.

4. Leaving windows explorer open,

navigate to the root of the C:\ drive and remove AUTORUN.INF and any files that end in *.CMD and *.BAT excepting for AUTORUN.BAT and COMMAND.COM which are legacy files you may or may not have. Now go to C:\Recycler and remove anything located in the folders that look like recycle bins, if you are on a network there will be more than one.

5. Delete all instances of the virus on your disk. There are two or three variants of this virus, some put a file in the windows directory named SVHOSTE which is a hidden file - search for this and delete it.

 

6. Remove from Registry. Open Registry Editor.

Click Start>Run, type REGEDIT, then press Enter. In the left panel,

double-click the following: HKEY_LOCAL_MACHINE>SOFTWARE>Microsoft>Active Setup>Installed Components

In the left panel, locate and delete the key: {08B0E5C0-4FCB-11CF-AAX5-90401C608512} Close REGEDIT and click on Start>Run or on Vista just type in the search box MSCONFIG and press enter.

Click the startup tab and uncheck any misspelt entries such as Microssoft and Norrton, also take into account the command of this startup entry, navigate to where these files are located and delete them from your disk. Format any memory sticks you have used with this machine by going into explorer, right click on the disk and clicking format. Once Formatted reboot your virus free machine.

Wednesday, May 16, 2012

Tweak Windows Explorer to make the command window always available

The default behavior for Windows Explorer in Windows 7 and Vista is to display a context menu when you right-click a folder (Figure A). If you hold the Shift key down and right-click a folder, you will get more menu options on the list (Figure B).

Figure A



Context Menu

Figure B



Shifted Context Menu

This behavior is all well and good, but what if you want to have access to the Open Command Window Here command with just a right-click versus the Shift-right-click it requires by default? The answer involves a Windows Registry file edit.

Registry edit


Standard disclaimer: The Windows Registry File is vitally important to the proper operation of the Windows operating system. Please back up the file before you make any registry edits.

In Windows 7, click on the Start button and type regedit in the search box. Click on the regedit.exe file in the list of items and answer the UAC prompt. Once in the registry editor (Figure C), navigate to this key:

HKEY_CLASSES_ROOT\Drive\shell\cmd

Figure C



Registry editor

In the right-hand pane, right-click the Extended key to rename it to anything besides Extended (Figure D). Or you can simply delete the key, but doing so will make it more difficult to return to the default settings. This change adds the feature to drive icons in Windows Explorer.

Figure D



The Extended key

To add the Open Command Window Here feature to folders displayed in Windows Explorer, navigate to this key in the registry editor:

HKEY_CLASSES_ROOT\Directory\shell\cmd

Once again, in the right-hand pane, right-click the Extended key (Figure E) and change the name or delete it completely if you are so inclined.

Figure E



An alternate access to the Extended key

Close the registry editor, and from now on, when you right-click a drive or a folder from within Windows Explorer you will see Open Command Window Here as one of your available options (Figure G).

Figure G



The now-available Open Command Window Here option


Thursday, March 1, 2012

Manually Remove Viruses from Your Windows

Most viruses launch when you log into Windows — they typically call an executable from the registry. In fact, that call will tell you exactly where the virus resides.

Start in the registry.

  • Click Start. Click Run and type: regedit.exe

  • Registry Editor opens. Expand HKEY_CURRENT_USER

  • Then expand Software. Next expand Microsoft.

  • Now expand Windows.

  • Then expand CurrentVersion.

  • Click on the Run folder.


Here you’ll find some of the programs that launch on startup. A rule of thumb: a virus is a randomly generated string that makes no sense.

The real giveaway that this is a virus is the location of the application it’s calling. It’s in the Application Data folder. It launches every time you log in. So no matter how many times you reboot, it comes right back.

Write down where the virus resides. In this case, it’s in the All Users Application Data folder. Then simply right-click the registry key and delete it. Now you haven’t actually deleted the virus, you’ve only deleted the call that launches it, which is doing the minimum. A virus is just a program, after all, so if the virus doesn’t launch it does no harm. But delete the file system anyway.

Now it’s time to go to the Application Data Folder. There is more than one — follow the path exactly as you wrote it down.

if its a VIRUS try the step in SAFEMODE

 

Access Ext2 file system in windows

The software provides Windows NT4.0/2000/XP/2003/Vista/2008 with full access to Linux Ext2 volumes (read access and write access). This may be useful if you have installed both Windows and Linux as a dual boot environment on your computer

If you currently have Windows running and you realize that you need some files for your work which you have stored on an Ext2 volume of your Linux installation, you no longer have to shut down Windows and boot Linux!

Furthermore, Windows will now be able to handle floppy disks which have been formatted with an Ext2 file system.

how it works

It installs a pure kernel mode file system driver Ext2fs.sys, which actually extends the Windows operating system to include the Ext2 file system. Since it is executed on the same software layer at the Windows NT operating system core like all of the native file system drivers of Windows (for instance NTFS, FASTFAT, or CDFS for Joliet/ISO CD-ROMs), all applications can access directly to Ext2 volumes. Ext2 volumes get drive letters (for instance O:). Files, and directories of an Ext2 volume appear in file dialogs of all applications. There is no need to copy files from or to Ext2 volumes in order to work with them.

Download it here

http://dl.dropbox.com/u/30579529/Ext2IFS_1_11a.exe

Sunday, February 26, 2012

BYPASS WINDOWS PASSWORD

Here we will see two type of password bypassing for windows

1.using ubuntu live cd and chntpw command

2. using offline nt password recovery cd or usb

  1. Use chntpw to delete a Windows password : With chntpw utility, you can erase the password of      any Windows account, freeing access.first load the ubuntu live cd and linstall chntpw .



  • Open a Terminal window by clicking on the Ubuntu menu, click Accessories, then Terminal.

  • Enter the command cd / media and confirm with Enter.

  • Enter the ls command and confirm with Enter. The list of hard disk drives is displayed. You should see the reference noted above.

  • Then enter the command cd followed by the reference hard drive containing Windows. In our case, the command is cd FAC4AC2BC4ABE7D9. Confirm with Enter.

  • Then type the command cd WINDOWS/system32/config to access the Windows system folder where are saved passwords. Press Enter.

  • Then enter the command sudo-i chntpw Sat and confirm by pressing Enter.

  • Press the button 1 and press Enter.

  • SAM is the file that contains the Windows registry. The list of users on your system is displayed. Enter the code located in the RID column beside the name of the user you want to reset the password to zero code preceded by 0x and press Enter. For RID 03E8, the command becomes 0x03e8 here.

  • Then press the 1 key to erase the password for the selected account and confirm by pressing Enter.

  • The password is then deleted as you said the message Password cleared. Press! And press Enter to exit from the menu.

  • Then press the q key, validate and confirm the registration of the change by pressing ahead. Confirm with Enter.

  • Then close the Terminal window and restart your computer by clicking the Stop button and then click Restart. Confirm the operation and remove the Ubuntu CD in your drive when you are asked. Press Enter.


2. Offlint nt password recovery(http://pogostick.net/~pnh/ntpasswd/)

first download the cd or usb zip files form below and follow the steps

http://pogostick.net/~pnh/ntpasswd/cd110511.zip

http://pogostick.net/~pnh/ntpasswd/usb110511.zip

cd...if u r using a cd then simply  download the iso and burn it in the cd and use it

usb...

  • Copy all the files that is inside the usbXXXXXX.zip or on the CD onto an usb drive, directly on the drive, not inside any directory/folder.

  • It is OK if there are other files on the USB drive from before, they will not be removed.

  • Install bootloader on the USB drive, from command prompt in windows (start the command line with "run as administrator" if possible)Replace X: with the drive letter the USB drive shows up as (DO NOT USE C:)

    • X:syslinux.exe -ma X:




  • If it seems like nothing happened, it is usually done.

  • However, a file named ldlinux.sys may appear on the USB drive, that is normal.

  • It should now in theory be bootable.


now use the cd or usb to reset the password use the walkthrough if needed http://pogostick.net/~pnh/ntpasswd/

Wednesday, December 21, 2011

Using Grub4DOS to Create a Bootable USB Drive From ISO

Grub4dos is mainly a boot manager which can be installed in a pen drive or portable hard disk to use as a parallel grub if ur on board grub is down.this can be also used to install certain linux os directly from the iso in the hard disk.This mainly work for ubuntu linux mint and puppy iso's.tthe grub can be also used to log in to the xp and windows 7 if the bootloader is lost.

first we need to install the grub4dos into the pendrive.get the grub4dos from following link

http://dl.dropbox.com/u/30579529/grubinst-1.1-bin-w32-2008-01-01.zip

and unzip to get grubinst_gui.exe and run it..

Once the program is started, select the Disk option, then click the Disk Refresh button and then select your flashdrive from the dropdown box

You should be able to tell which disk is your flashdrive by the size shown for each drive.

Now click the Part List Refresh button, then the dropdown box and finally select the Whole disk (MBR) option.

Check the Don't search floppy option, leave all the other options unchecked and cleared and then click the Install button to install Grub4DOS to the MBR of the flashdrive.

and grub is installed .....

now copy the grldr and menu.lst files from the downloaded and put it in the hard disk

edit the menu.lst to boot iso...'

my menu is as below i put my iso's in a folder named ISO in the drive and each iso has its own corresponding folders

color blue/green yellow/red white/magenta white/magenta
timeout 30
default /default

title Fedora 15 LiveCD - extracted
root (hd0,0)
kernel /ISO/fedora/vmlinuz0 rootfs=auto root=UUID= liveimg live_dir=/LiveCD/LiveOS/ ro quiet rhgb
initrd /ISO/fedora/initrd0.img

title Fedora 14 Live CD
root (hd0,0)
kernel (hd0,0)/vmlinuz0 linux askmethod
initrd (hd0,0)/initrd.img
boot

title FIND AND BOOT NT/2K/XP
fallback 1
find --set-root --ignore-floppies /ntldr
chainloader /ntldr
savedefault --wait=2

title FIND AND BOOT BOOTMGR of Windows VISTA/7
fallback 2
find --set-root --ignore-floppies /bootmgr
chainloader /bootmgr
savedefault --wait=2

title find and boot RedHat/Centos/Fedora Linux with menu.lst already installed
fallback 5
find --set-root /grub/menu.lst
savedefault --wait=2
configfile /grub/menu.lst

title Puppy Linux
find --set-root --ignore-floppies /ISO/puppy/initrd.gz
kernel /ISO/puppy/vmlinuz pmedia=usbflash psubdir=ISO/puppy
initrd /ISO/puppy/initrd.gz

title Linux Mint 12
find --set-root --ignore-floppies /ISO/mint/initrd.lz
kernel /ISO/mint/vmlinuz iso-scan/filename=/ISO/mint/linuxmint-12.iso file=/cdrom/preseed/mint.seed boot=casper noprompt
initrd /ISO/mint/initrd.lz

title Ubuntu 11
find --set-root --ignore-floppies /ISO/ubuntu/initrd.lz
kernel /ISO/ubuntu/vmlinuz iso-scan/filename=/ISO/ubuntu/ubuntu-11.iso file=/cdrom/preseed/ubuntu.seed boot=casper noprompt
initrd /ISO/ubuntu/initrd.lz

title commandline
commandline

title reboot
reboot

title Shutdown
halt

for windows 7 just unzip the iso into the root directory of the drive and use the code above

for ubuntu and linux mint we must unzip the files for vmlinux and initrd and put in same folder as in ISO

For fedora first we need to extract the LiveOS folder to the root of our pendrive and also extract vmlinuz and initrd.img to the LiveOS folder form isolinux folder and the following to the menu.lst

title Fedora default
find --set-root /LiveOS/vmlinuz0
kernel /LiveOS/vmlinuz0  root=live:CDLABEL=BOOT  rootfstype=auto ro liveimg quiet rhgb rd.luks=0 rd.md=0 rd.dm=0
initrd /LiveOS/initrd0.img

here in the code CDLABEL =BOOT  ,BOOT must be your usb name given to usb

for Redhat first we need to copy the image folder into the root folder and give the code as below as per your path to vmlinuz and initrd.img

title RedHat6.2 default
find --set-root /ISO/redhat6.2/isolinux/vmlinuz
kernel /ISO/redhat6.2/isolinux/vmlinuz  root=live:CDLABEL=BOOT  rootfstype=auto ro liveimg quiet rhgb rd.luks=0 rd.md=0 rd.dm=0
initrd /ISO/redhat6.2/isolinux/initrd.img

and duirng installation select the iso form hard disk or pendrive where you have extracted the image folder

example for menu.lst https://dl.dropbox.com/u/30579529/menu.lst

Sunday, December 11, 2011

Remove Grub loader and get windows 7 boot loader back (uninstalling Linux)

1.Put the Windows 7 installation/Upgrade disc in the disc drive, and then start the computer (set to boot from CD in BIOS).

2. Press a key when you are prompted.

3. Select a language, a time, a currency, a keyboard or an input method, and then click Next.

4. Click Repair your computer.

5. Click the operating system that you want to repair (Windows 7 in this case), and then click Next.

6. In the System Recovery Options dialog box, click Command Prompt.

7. Once in the command prompt, type exactly Bootrec.exe /FixMbr and then press ENTER. You will see "operation completed successfully." (Doesnt even take a second. Dont be alarmed )

8. Reboot and set BIOS to boot from the HDD again.

GRUB will be overwritten in step 7 and Windows boot loader will once again take control of loading your OS(s).

Bootrec.exe /FixMbr


// The /FixMbr option writes a Windows 7 or Windows Vista-compatible MBR to the system partition. This option does not overwrite the existing partition table. Use this option when you must resolve MBR corruption issues, or when you have to remove non-standard code from the MBR.

Saturday, December 3, 2011

Bootable windows 7 on usb drive

Download windows 7 usb dvd tool from link given below


http://images2.store.microsoft.com/prod/clustera/framework/w7udt/1.0/en-us/Windows7-USB-DVD-tool.exe


Run it.


browse to the source of windows 7 iso image
click next and then specify the destination drive.
it’ll ask to format, just accept everything and then proceed.
Finally your windows 7 bootable usb pendrive will be ready.