Microsoft Windows operating systems (all versions) ship with functionality to share files and printers over a network. Sharing files and printers though the Windows 7 or Vista interface is straightforward. By right-clicking on a file, selecting the "Share" option, and choosing users with whom to share the file, sharing may be enabled for any file or folder. For printers, the process is similar. Right-click on the printer to share in the Control Panel Printers interface, and select "Sharing." Check the checkbox to "Share the Printer" and click "OK." However, occasions may arise when file and printer sharing must be configured from the command line. Fortunately, Microsoft provides command-line functionality for the file and printer sharing components, as well.
- Skill level:
- Moderately Easy
Other People Are Reading
Things you need
- Computer running a Windows operating system
- LAN (local area network)
Open Windows Explorer by right-clicking on "Start" and selecting "Explore."
Create a folder that will be easily accessible from the command line. For example, create a new folder named Shared directly on the root of the C: drive. The path to the folder would be "C:\Shared."
Drag all files that will be shared into the new "Shared" folder.
Click the "Start" button and select "Run" in Windows XP, 2003 and 2000. Click the "Start" button in Vista and Windows 7 to show the "Search" input box.
Type "cmd" and press the "Enter" key on the keyboard. The command prompt window will open.
Type the following command, without quotes, at the command prompt (c: prompt):
"net share Shared=c:\Shared"
Press the "Enter" key. A new network share is created and named "Shared."
Open "Network" in the Windows Start menu to view the "Shared" folder. If the folder is visible in the Network interface, the folder and files have been successfully shared.
Install File Sharing from the Command Line
Determine the name of the network printer and server that hosts the printer. For this example, "Server" will be the server, and "Printer" will be the printer.
Click the Windows "Start" button, type "cmd" in the Search input box and press "Enter" in Windows 7 and Vista. In XP and other versions of Windows, click "Start" and then click "Run" from the Start menu. Type "cmd" into the "Run" input box and click the "Open" button. The command prompt window will launch.
Type the following command, without quotes, at the C: prompt and press "Enter":
"net use lpt1: \Server\Printer"
LPT1 is the first printer port utilised in Windows. If a printer is already installed on "LPT1," enter "LPT2".
Test the newly installed printer by printing a document to the shared printer.
Install Printer Sharing from the Command Line
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for