i have one desktop at home, and laptop at office, now my laptop lost cd drive connection, and i need to format and reinstall os to laptop, please tell me how to connect them, and whether it is possible to format through this way.
You can connect two computers by ethernet cable via their network ports -- usually need a crossover version of the ethernet cable (which you can also make out of a spare if you Google for a wiring diagram and can wield a soldering iron).
Actually networking the computers requires Windows already to be running on both -- so installing an OS by the means you propose is not for the layman.
May be simpler to see if the laptop's capable of supporting a USB CD drive at the BIOS level or try to replace the faulty CD drive.
Other possibilities, you might try installing Windows with the laptop's hard drive in the desktop (in place of existing desktop drive) then transfer the drive back to the laptop (may trigger Windows copy protection but you can explain the necessity to Microsoft's help line and see if they can realease it).
None of this is really satisfactory in the long run when you'll really want a CD drive that works -- so repair may be your best option.