Although I am a lazy bastard, I feel the need to share the solution with community.
In this example my ArduinoISP is on port 4 and I am using Arduino uno (atmega328pu) and I am trying to program atmega1284p
1) Download avrdude and extract.
http://mirror6.layerjet.com/nongnu//avrdude/avrdude-5.11-Patch7610-win32.zip2) make a new folder on your C: drive called "avrdude"
3) Copy the extracted files in step 1 to that folder
4) Download/copy the bootloader file to the avrdude folder created in step2. (DualOptiboot_V5.0_atmega1284p_BlinkD15.hex in my case hardware\MoteinoMEGA_Core\bootloaders\MoteinoMEGA)
5) Rename the .hex file to boot.hex
4) Connect your ArduinoISP, check on which port it is.
5) Open cmd, start->cmd
6) write "cd C:\avrdude"
7) write "avrdude -c arduino -p m1284p -P \\.\COM4 -b 19200 -v"
All the information about the chip should show up. If not, check your power supply and wiring. You are good to go to step 8
8 ) write "avrdude -c arduino -p m1284p -P \\.\COM4 -b 19200 -U flash:w:boot.hex:i -U efuse:w:0xFD:m -U hfuse:w:0xDE:m -U lfuse:w:0xDE:m"
9) should take a minute or so and if no error, just upload the code through Arduino IDE
References:
http://heliosoph.mit-links.info/arduinoisp-reading-writing-fuses-atmega328p/P.S. Saved 50 pounds and spent 2 hours googling, thats 3 times my wage per hour there.