The Windows CE 3.0 net command

In computing, net is a command in IBM OS/2 (including eComStation and ArcaOS), Microsoft Windows, and ReactOS used to manage and configure the operating system from the command-line. It is also part of the IBM PC Network Program for DOS.

Overview

The command is primarily used to manage network resources. It is an external command implemented as net.exe. When used in a batch file, the /Y or /N switches can be used to unconditionally answer Yes or No to questions returned by the command. The net command has several sub-commands that can differ from one implementation or operating system version to another.

On Windows CE .NET 4.2, Windows CE 5.0 and Windows Embedded CE 6.0, it is available as an external command stored in \Windows\net.exe. This version only supports the use and view sub-commands.

net sub-commands
NameDescriptionDOS supportOS/2 supportWindows supportReactOS supportRemarks
accessManage accessNoIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
accountsChange Netlogon service role and manage maximum user logon time, password expiration time and other account settingsNoIBM OS/2 LAN Server, OS/2 Warp 4.5Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
adminRun administrative command on a remote serverNoIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
aliasManage aliases currently defined in the domainNoIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
appManage information about application definitionsNoIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
appparmNoOS/2 Warp 4.5NoNoOS/2 Warp 4.5 and later only
auditList and clear contents of the network audit log of the serverNoIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
commList information about queues for shared serial devicesNoIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
computerAdd or delete computer from domain databaseNoNoWindows Server 2000, Windows Server 2003, Windows Server 2003 with SP1, Windows Server 2003 R2, Windows Server 2008, Windows Server 2012, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
configDisplay NetBIOS configuration informationNoIBM OS/2 LAN Server, OS/2 Warp 4.5Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
continueContinue paused servicesIBM PC Network ProgramIBM OS/2 LAN Server, OS/2 Warp 4.5Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
copyCopy and append files locally and remotelyNoIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
dasdManage and display directory limitsNoIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
deviceList statuses of shared serial devices and stop current use of a deviceNoIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
diagRun the Microsoft Network Diagnostic programNoNoWindows 95, Windows 98No
errorList and clear network error logIBM PC Network ProgramIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
fileList files opened by remote computersIBM PC Network ProgramIBM OS/2 LAN Server, OS/2 Warp 4.5Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10Unimplemented
forwardRoute incoming messages and cancel forwardingIBM PC Network ProgramIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
groupAdd, display, or modify global groups in domainsNoIBM OS/2 LAN Server, OS/2 Warp 4.5Windows Server 2000, Windows Server 2003, Windows Server 2003 with SP1, Windows Server 2003 R2, Windows Server 2008, Windows Server 2012, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
helpDisplay syntaxNoIBM OS/2 LAN Server, OS/2 Warp 4.5Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
helpmsgDisplay information on error messagesNoNoWindows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
initNoNoWindows 95, Windows 98No
localgroupAdd, display, or modify local groupsNoNoWindows Server 2008, Windows Server 2012, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
logStart/stop saving messages to a file/printer and display information about forwarding the current message logIBM PC Network ProgramIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
logoffNoNoWindows 95, Windows 98No
logonNoNoWindows 95, Windows 98No
moveMove files locally and remotelyNoIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
nameList or manage NetBIOS namesIBM PC Network ProgramIBM OS/2 LAN Server, OS/2 Warp 4.5Windows NT, Windows 2000, Windows XPUnimplemented
passwordChange passwords on a server or in a domainNoIBM OS/2 LAN Server, OS/2 Warp 4.5Windows 95, Windows 98No
pausePause servicesIBM PC Network ProgramIBM OS/2 LAN Server, OS/2 Warp 4.5Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
printDisplay printer queue information or print job information, or control print jobsIBM PC Network ProgramIBM OS/2 LAN Server, OS/2 Warp 4.5Windows Server 2008, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Server (Semi-Annual Channel), Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 8UnimplementedDeprecated in Windows 7 and Windows Server 2008 R2
riplmachNoOS/2 Warp 4.5NoNoOS/2 Warp 4.5 and later only
riplmclasNoOS/2 Warp 4.5NoNoOS/2 Warp 4.5 and later only
runNoIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
sendSend messages to other users or computersIBM PC Network ProgramIBM OS/2 LAN Server, OS/2 Warp 4.5Windows NT, Windows 2000, Windows XPUnimplemented
separatorControl whether or not a separator page is printed at the beginning of a print fileIBM PC Network ProgramNoNoNo
sessionManage server computer connectionsNoIBM OS/2 LAN Server, OS/2 Warp 4.5Windows Server 2003, Windows Server 2003 with SP1, Windows Server 2003 with SP2, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2008 R2 with SP1, Windows Server 2012, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 7 with SP1, Windows 8, Windows 10Unimplemented
shareManage shared resourcesIBM PC Network ProgramIBM OS/2 LAN Server, OS/2 Warp 4.5Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
startStart servicesIBM PC Network ProgramIBM OS/2 LAN Server, OS/2 Warp 4.5Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
statisticsDisplay and clear list of usage statistics for a workstationNoIBM OS/2 LAN Server, OS/2 Warp 4.5Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
statusList information about current network shares and server definition settingsNoIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo
stopStop servicesNoIBM OS/2 LAN Server, OS/2 Warp 4.5Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
timeDisplay remote computer's current time or sync time with remote computerNoIBM OS/2 LAN Server, OS/2 Warp 4.5Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10Unimplemented
useConnect/disconnect computer to/from shared resources, or display information about computer connectionsIBM PC Network ProgramIBM OS/2 LAN Server, OS/2 Warp 4.5Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10, Windows CE .NET 4.2, Windows CE 5.0, Windows Embedded CE 6.0ReactOS 0.4.8
userAdd or modify user accounts, or display user account informationNoIBM OS/2 LAN Server, OS/2 Warp 4.5Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2008, Windows Server 2012, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10ReactOS 0.4.8
verDisplay information about workgroup redirectorNoNoWindows 95, Windows 98No
viewDisplay list of domains, computers, or resources shared by specified computersNoIBM OS/2 LAN Server, OS/2 Warp 4.5Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10, Windows CE .NET 4.2, Windows CE 5.0, Windows Embedded CE 6.0Unimplemented
whoList uses who are logged on current or remote domains, display user logon information, and list users with sessions to a specific serverNoIBM OS/2 LAN Server, OS/2 Warp 4.5NoNo

Example

The net use command has several network-related functions.

Connecting network drive and printer

net use can control mounting ("mapping" in Microsoft terminology) drive shares and connecting shared printers in a network environment. This command makes use of the SMB (server message block) and the NetBIOS protocol on port 139 or 445. The basic Windows XP configuration enables this functionality by default. Thus users can connect to and disconnect from shared resources such as computers, printers and drives.

net use can display a list of network-connection information on shared resources.

Null session connections

net use also connects to the IPC$ (interprocess communication share). This is the so-called null session connection, which allows unauthenticated users. The basic syntax for connecting anonymously is:

For example, typing at the command prompt:

attempts to connect to the share IPC$ of the network 192.168.1.101 as an anonymous user with blank password. If successfully connected to the target machine, a lot of information can be gathered such as shares, users, groups, registry keys and more. This would provide a hacker with a lot of information about a remote user. This has changed in Windows NT 4.0 SP6 already. In Windows 2000 "null session connections" could have been enabled after changes of the system-configuration.

Similar commands in other OSes

See also

Further reading

  • David Moskowitz; David Kerr (1993). OS/2 2.1 Unleashed. Sams Publishing. ISBN978-0672302404.
  • Stanek, William R. (2008). Windows Command-Line Administrator's Pocket Consultant, 2nd Edition. Microsoft Press. ISBN978-0735622623.
  • John Paul Mueller (2007). Windows Administration at the Command Line for Windows Vista, Windows 2003, Windows XP, and Windows 2000. John Wiley & Sons. ISBN978-0470165799.

External links

  • . poftut. Archived from on 2019-04-19.