Ensure that your wireless card and router are on and that your laptop is plugged in. If your computer runs OS X, skip to Step 3. Insert the HP installation CD. When the CD menu appears, click "Install Network/Wireless Device" and follow the on-screen prompts.
Let the computer search for the printer on the network, then click "Next." Connect the USB cable to the computer and printer when the computer prompts you. Follow on-screen prompts. Skip to Step 4.
Connect the USB cable. Open the HP installation CD, then double-click on the "HP Installer" icon. Follow the on-screen prompts.
Disconnect the USB cable when the computer prompts you, then open a document and print a test page.
Make sure your computer's wireless signal and your printer are on. An ad hoc network is a direct connection between your computer and the printer, using the printer's built-in wireless transmitter, so no wireless router is required when using this method.
Open your computer's list of available wireless networks. On a laptop running Windows 7, this list is available by clicking on the "bars" on the righthand side of the taskbar.
Select and connect to the network named "hpsetup." Open a document and print a test page.