Net (command)

From HandWiki - Reading time: 9 min

net
ReactOS-0.4.13 net command 667x610.png
The ReactOS net command
Developer(s)Microsoft, IBM, ReactOS Contributors, Greentea OS Contributors
Initial releaseApril 2, 1985; 39 years ago (1985-04-02)
Operating systemMS-Net, DOS, OS/2, Windows, ReactOS, eComStation, ArcaOS, Greentea OS
PlatformCross-platform
TypeCommand
LicenseMS-Net, OS/2, Windows, eComStation, ArcaOS: Proprietary commercial software

ReactOS: GNU General Public License

Greentea OS: GNU Lesser General Public License
Websitedocs.microsoft.com/en-gb/previous-versions/windows/it-pro/windows-xp/bb490948(v%3dtechnet.10)
The Windows CE 3.0 net command

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

Overview

The command is primarily used to manage network resources.[2] It is an external command implemented as net.exe.[3] 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.[2] 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,[4] Windows CE 5.0[5] and Windows Embedded CE 6.0,[6] 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
Name Description DOS support OS/2 support Windows support ReactOS support Remarks
access Manage access No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
accounts Change Netlogon service role and manage maximum user logon time, password expiration time and other account settings No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10[8][3][9] ReactOS 0.4.8[10]
admin Run administrative command on a remote server No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
alias Manage aliases currently defined in the domain No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
app Manage information about application definitions No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
appparm No OS/2 Warp 4.5[7] No No OS/2 Warp 4.5 and later only
audit List and clear contents of the network audit log of the server No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
comm List information about queues for shared serial devices No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
computer Add or delete computer from domain database No No Windows 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 10[8][3][9][11][12] ReactOS 0.4.8[13]
config Display NetBIOS configuration information No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10[8][3][9] ReactOS 0.4.8[14]
continue Continue paused services IBM PC Network Program[1] IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10[8][3][9] ReactOS 0.4.8[15]
copy Copy and append files locally and remotely No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
dasd Manage and display directory limits No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
device List statuses of shared serial devices and stop current use of a device No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
diag Run the Microsoft Network Diagnostic program No No Windows 95, Windows 98[8] No
error List and clear network error log IBM PC Network Program[1] IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
file List files opened by remote computers IBM PC Network Program[1] IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10[8][3][9] Unimplemented[16]
forward Route incoming messages and cancel forwarding IBM PC Network Program[1] IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
group Add, display, or modify global groups in domains No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows 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 10[8][3][9][17][18] ReactOS 0.4.8[19]
help Display syntax No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10[8][3][9] ReactOS 0.4.8[20]
helpmsg Display information on error messages No No Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10[8][3][9] ReactOS 0.4.8[21]
init No No Windows 95, Windows 98[8] No
localgroup Add, display, or modify local groups No No Windows Server 2008, Windows Server 2012, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10[8][3][9][22][23] ReactOS 0.4.8[24]
log Start/stop saving messages to a file/printer and display information about forwarding the current message log IBM PC Network Program[1] IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
logoff No No Windows 95, Windows 98[8] No
logon No No Windows 95, Windows 98[8] No
move Move files locally and remotely No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
name List or manage NetBIOS names IBM PC Network Program[1] IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows NT, Windows 2000, Windows XP[8][9] Unimplemented[16]
password Change passwords on a server or in a domain No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows 95, Windows 98[8] No
pause Pause services IBM PC Network Program[1] IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10[8][3][9] ReactOS 0.4.8[25]
print Display printer queue information or print job information, or control print jobs IBM PC Network Program[1] IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows 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 8[8][9][26][27][28] Unimplemented[16] Deprecated in Windows 7 and Windows Server 2008 R2
riplmach No OS/2 Warp 4.5[7] No No OS/2 Warp 4.5 and later only
riplmclas No OS/2 Warp 4.5[7] No No OS/2 Warp 4.5 and later only
run No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
send Send messages to other users or computers IBM PC Network Program[1] IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows NT, Windows 2000, Windows XP[8][9] Unimplemented[16]
separator Control whether or not a separator page is printed at the beginning of a print file IBM PC Network Program[1] No No No
session Manage server computer connections No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows 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 10[8][9][3][29][30] Unimplemented[16]
share Manage shared resources IBM PC Network Program[1] IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10[8][3][9][31][32] ReactOS 0.4.8[33]
start Start services IBM PC Network Program[1] IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10[8][3][9] ReactOS 0.4.8[34]
statistics Display and clear list of usage statistics for a workstation No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10[8][3][9] ReactOS 0.4.8[35]
status List information about current network shares and server definition settings No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No
stop Stop services No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10[8][3][9] ReactOS 0.4.8[36]
time Display remote computer's current time or sync time with remote computer No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows 95, Windows 98, Windows NT, Windows 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10[8][3][9] Unimplemented[16]
use Connect/disconnect computer to/from shared resources, or display information about computer connections IBM PC Network Program[1] IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows 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.0[8][3][9][37][38][4][5][6] ReactOS 0.4.8[39]
user Add or modify user accounts, or display user account information No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows 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 10[8][3][9][40][41] ReactOS 0.4.8[42]
ver Display information about workgroup redirector No No Windows 95, Windows 98[8] No
view Display list of domains, computers, or resources shared by specified computers No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] Windows 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.0[8][3][9][43][44][4][5][6] Unimplemented[16]
who List uses who are logged on current or remote domains, display user logon information, and list users with sessions to a specific server No IBM OS/2 LAN Server, OS/2 Warp 4.5[7] No No

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:

net use \\IP address\IPC$ "" /u:""

For example, typing at the command prompt:

net use \\192.168.1.101\IPC$ "" /u:""

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

  • Novell NetWare
    • map for mapping volumes (network drives) to drive letters
    • capture for capturing print queues to LPT ports

See also

References

  1. 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 IBM PC Network Program 1.0 Users Guide
  2. 2.0 2.1 Net - Services, File/Print shares, Permissions - Windows CMD - SS64.com
  3. 3.00 3.01 3.02 3.03 3.04 3.05 3.06 3.07 3.08 3.09 3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18 3.19 MS-DOS and Windows command line net command
  4. 4.0 4.1 4.2 "net (Windows CE .NET 4.2)". https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms879835%28v%3dmsdn.10%29. 
  5. 5.0 5.1 5.2 "net (Windows CE 5.0)". https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms931463%28v%3dmsdn.10%29. 
  6. 6.0 6.1 6.2 "net (Windows Embedded CE 6.0)". https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ee504152%28v%3dwinembedded.60%29. 
  7. 7.00 7.01 7.02 7.03 7.04 7.05 7.06 7.07 7.08 7.09 7.10 7.11 7.12 7.13 7.14 7.15 7.16 7.17 7.18 7.19 7.20 7.21 7.22 7.23 7.24 7.25 7.26 7.27 7.28 7.29 7.30 7.31 7.32 7.33 7.34 7.35 7.36 7.37 7.38 Batch files - The NET command
  8. 8.00 8.01 8.02 8.03 8.04 8.05 8.06 8.07 8.08 8.09 8.10 8.11 8.12 8.13 8.14 8.15 8.16 8.17 8.18 8.19 8.20 8.21 8.22 8.23 8.24 8.25 8.26 8.27 net commands in The Network Encyclopedia
  9. 9.00 9.01 9.02 9.03 9.04 9.05 9.06 9.07 9.08 9.09 9.10 9.11 9.12 9.13 9.14 9.15 9.16 9.17 9.18 9.19 9.20 9.21 "Net services commands". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb490949%28v%3dtechnet.10%29. 
  10. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdAccounts.c. 
  11. "Net computer". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc730899(v%3dws.10). 
  12. "Net computer". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc730899(v%3dws.11). 
  13. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdComputer.c. 
  14. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdConfig.c. 
  15. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdContinue.c. 
  16. 16.0 16.1 16.2 16.3 16.4 16.5 16.6 "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/main.c. 
  17. "Net group". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc754051(v%3dws.10). 
  18. "Net group". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc754051(v%3dws.11). 
  19. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdGroup.c. 
  20. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdHelp.c. 
  21. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdHelpMsg.c. 
  22. "Net localgroup". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc725622(v%3dws.10). 
  23. "Net localgroup". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc725622(v%3dws.11). 
  24. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdLocalGroup.c. 
  25. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdPause.c. 
  26. "Net print". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc772297(v%3dws.10). 
  27. "Net print". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc772297(v%3dws.11). 
  28. "Net print". 3 February 2023. https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/net-print. 
  29. "Net session". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/hh750729(v%3dws.10). 
  30. "Net session". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh750729(v%3dws.11). 
  31. "Net share". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/hh750728(v%3dws.10). 
  32. "Net share". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh750728(v%3dws.11). 
  33. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdShare.c. 
  34. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdStart.c. 
  35. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdStatistics.c. 
  36. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdStop.c. 
  37. "Net use". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/gg651155(v%3dws.10). 
  38. "Net use". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/gg651155(v%3dws.11). 
  39. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdUse.c. 
  40. "Net user". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc771865(v%3dws.10). 
  41. "Net user". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc771865(v%3dws.11). 
  42. "Reactos/Reactos". 3 November 2021. https://github.com/reactos/reactos/blob/master/base/applications/network/net/cmdUser.c. 
  43. "Net view". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/hh875576(v%3dws.10). 
  44. "Net view". https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh875576(v%3dws.11). 

Further reading

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

External links




Licensed under CC BY-SA 3.0 | Source: https://handwiki.org/wiki/Software:Net_(command)
5 views | Status: cached on July 17 2024 10:04:01
↧ Download this article as ZWI file
Encyclosphere.org EncycloReader is supported by the EncyclosphereKSF