Z:USERSAdministrator>net statistics workstation
Workstation Statistics for \TITANIUM
Statistics since 12/1/00 6:27 AM
Bytes received 4885909
Server Message Blocks (SMBs) received 51520
Bytes transmitted 6101020
Server Message Blocks (SMBs) transmitted 51523
Read operations 23
Write operations 1199
Raw reads denied 0
Raw writes denied 0
Network errors 0
Connections made 2433
Reconnections made 1
Server disconnects 6
Sessions started 2824
Hung sessions 0
Failed sessions 0
Failed operations 3
Use count 3212
Failed use count 285
The command completed successfully.
Net Stop
========
This command is the opposite of Net Start. As you can probably guess, it stops services from running on your server.
Net Time
========
One of the commands I've found very useful is the Net Time command. The Net Time command is used to synchronize the time on a workstation with the time on a server. Here's the syntax for the Net Time command:
net time [\computer | /WORKGROUP:wgname] [/SET] [/YES]
-computer—Specifies the name of the computer (time server)whose time you want to check or synchronize your computer's clock with
-/WORKGROUP—Specifies that you want to use the clock on a computer (time server) in another workgroup
-wgname—Specifies the name of the workgroup containing a computer whose clock you want to check or synchronize your computer's clock with; if there are multiple time servers in that workgroup, Net Time uses the first one it finds
-/SET—Synchronizes your computer's clock with the clock on the computer or workgroup you specify
-/YES—Carries out the Net Time command without first prompting you to provide information or confirm actions
Net Use
=======
Without a doubt, the most powerful Net command in any version of Windows is the Net Use command. This command lets you attach to resources such as network shares or printers. For example, to map the Q: drive to a share called Articles on a server called Tazmania, you could enter the following command:
net use Q: \TazmaniaArticles
Likewise, you could map LPT1 to a network printer that's attached to a server called Scooby and shared as HP by entering the following command:
net use LPT1: \ScoobyHP
The Net Use command also provides mechanisms for removing connections that you've made and for entering passwords.
To list all of your connections, type Net Use without options. To see this information one screen at a time, type the following at the command prompt:
net use /? | MORE
or
net help use | MORE
Here's a full summary of the Net Use syntax.
Summary of Net Use syntax
C:WINDOWS>net use /?
Connects or disconnects your computer from a shared
resource or displays information about your connections.
NET USE [drive: | *] [\computerdirectory [password | ?]]
[/SAVEPW:NO] [/YES] [/NO]
NET USE [port:] [\computerprinter [password | ?]]
[/SAVEPW:NO] [/YES] [/NO]
NET USE drive: | \computerdirectory /DELETE [/YES]
NET USE port: | \computerprinter /DELETE [/YES]
NET USE * /DELETE [/YES]
NET USE drive: | * /HOME
drive Specifies the drive letter you assign to a
shared directory.
* Specifies the next available drive letter.
If used with /DELETE, specifies to
disconnect all of your connections.
port Specifies the parallel (LPT) port name you
assign to a shared printer.
computer Specifies the name of the computer sharing
the resource.
directory Specifies the name of the shared directory.
printer Specifies the name of the shared printer.
password Specifies the password for the shared
resource, if any.
? Specifies that you want to be prompted for the
password of the shared resource. You don't
need to use this option unless the password is
optional.
/SAVEPW:NO Specifies that the password you type
should not be saved in your password-list
file. You need to retype the password the
next time you connect to this resource.
/YES Carries out the NET USE command without
first prompting you to provide information or
confirm actions.
/DELETE Breaks the specified connection to a shared
resource.
/NO Carries out the NET USE command, responding
with NO automatically when you are prompted
to confirm actions.
/HOME Makes a connection to your HOME directory if
one is specified in your LAN Manager or
Windows NT user account.
Net User
========
Another use for the Net command is viewing all of the user accounts that exist on a given machine. To do so, simply enter the Net User command, as shown here Sample of Net User command
Z:USERSAdministrator>net userUser accounts for \TITANIUM
---------------------------------------------------------------
Admin Administrator Billy_Brown
Brien Brien_Posey Guest
IUSR_SCOOBY IUSR_TALAINIA IUSR_TITANIUM
IWAM_SCOOBY IWAM_TALAINIA IWAM_TITANIUM
Jeremy_Broyles Kendall_Hensley Migrate
Normal Rep Shamir
Shamir_Dasgupta Talainia_Posey Taz
Test
The command completed successfully.
Net View
========
This command displays the other computers that are visible on the network. You can see a sample of Net View's output here
Sample of Net View command
Z:USERSAdministrator>net view
Server Name Remark
------------------------------------------
\SCOOBY
\TALAINIA
\TAZ BRIEN
\TAZMANIA
\TITANIUM
The command completed successfully.
Net Print
=========
I can't count the number of times I've needed to add printing capabilities to a batch file. In older versions of Windows, network printing from a batch file usually meant using the Net Use command to capture a printer port and then printing to the captured port. Unfortunately, this technique can cause confusion for end users the next time they try to print because they may have already been using the printer port that the batch file reassigned. If your users are working in a Windows 98, Me, or NT environment, the Net Print command is a good alternative to traditional batch-file printing. The Net Print command allows you to send print jobs to a network printer without capturing an LPT port.
Syntax for Net Print command
Z:USERSAdministrator>net print
The syntax of this command is:
NET PRINT \computernamesharename
[\computername] job# [/HOLD | /RELEASE | /DELETE]
Net Send
========
You can use the Net Send command to send a pop-up message to network users. Just enter the username and the message. The command also offers the capability to send messages to users in another domain.
Sample of Net Send command
Z:USERSAdministrator>net send
The syntax of this command is:
NET SEND {name | * | /DOMAIN[:name] | /USERS} message
Z:USERSAdministrator>net send Administrator This is a test
The message was successfully sent to ADMINISTRATOR.
Net Session
===========
The Net command can even be used to see which computers are attached to your computer. Simply enter the Net Session command, and you'll see a summary, similar to this one.
Sample of Net Session command
Z:USERSAdministrator>net session
Computer User name Client Type Opens Idle time
--------------------------------------------------------------------
\TAZMANIA Windows 2000 21951 01D 10H 46M
\TITANIUM Windows NT 1381 0 11D 00H 42M
\TITANIUM Administrator Windows NT 1381 2 00:00:00
The command completed successfully.
Net Share
=========
If you'd like to see which shares exist on a PC, you can do so by using the Net Share command. Sample of Net Share command
Net Start
=========
This command starts any of the various services that are running. You can use the Net Pause or Net Continue command to pause or resume services.
Net Statistics
==============
Perhaps one of the most useful Net commands is Net Statistics. The Net Statistics command provides some hard-core statistics on how a server or workstation is communicating across the network. This command merely requires you to follow the Net Statistics command with the word Server or Workstation, as shown below:
C:\>assoc /?
Displays or modifies file extension associations
ASSOC [.ext[=[fileType]]]
.ext Specifies the file extension to associate the file type with
fileType Specifies the file type to associate with the file extension
Type ASSOC without parameters to display the current file associations.
If ASSOC is invoked with just a file extension, it displays the current
file association for that file extension. Specify nothing for the file
type and the command will delete the association for the file extension.
C:\>help
For more information on a specific command, type HELP command-name
ASSOC Displays or modifies file extension associations.
AT Schedules commands and programs to run on a computer.
ATTRIB Displays or changes file attributes.
BREAK Sets or clears extended CTRL+C checking.
CACLS Displays or modifies access control lists (ACLs) of files.
CALL Calls one batch program from another.
CD Displays the name of or changes the current directory.
CHCP Displays or sets the active code page number.
CHDIR Displays the name of or changes the current directory.
CHKDSK Checks a disk and displays a status report.
CHKNTFS Displays or modifies the checking of disk at boot time.
CLS Clears the screen.
CMD Starts a new instance of the Windows command interpreter.
COLOR Sets the default console foreground and background colors.
COMP Compares the contents of two files or sets of files.
COMPACT Displays or alters the compression of files on NTFS partitions.
CONVERT Converts FAT volumes to NTFS. You cannot convert the
current drive.
COPY Copies one or more files to another location.
DATE Displays or sets the date.
DEL Deletes one or more files.
DIR Displays a list of files and subdirectories in a directory.
DISKCOMP Compares the contents of two floppy disks.
DISKCOPY Copies the contents of one floppy disk to another.
DOSKEY Edits command lines, recalls Windows commands, and creates macros.
ECHO Displays messages, or turns command echoing on or off.
ENDLOCAL Ends localization of environment changes in a batch file.
ERASE Deletes one or more files.
EXIT Quits the CMD.EXE program (command interpreter).
FC Compares two files or sets of files, and displays the differences
between them.
FIND Searches for a text string in a file or files.
FINDSTR Searches for strings in files.
FOR Runs a specified command for each file in a set of files.
FORMAT Formats a disk for use with Windows.
FTYPE Displays or modifies file types used in file extension associations.
GOTO Directs the Windows command interpreter to a labeled line in a
batch program.
GRAFTABL Enables Windows to display an extended character set in graphics
mode.
HELP Provides Help information for Windows commands.
IF Performs conditional processing in batch programs.
LABEL Creates, changes, or deletes the volume label of a disk.
MD Creates a directory.
MKDIR Creates a directory.
MODE Configures a system device.
MORE Displays output one screen at a time.
MOVE Moves one or more files from one directory to another directory.
PATH Displays or sets a search path for executable files.
PAUSE Suspends processing of a batch file and displays a message.
POPD Restores the previous value of the current directory saved by PUSHD.
PRINT Prints a text file.
PROMPT Changes the Windows command prompt.
PUSHD Saves the current directory then changes it.
RD Removes a directory.
RECOVER Recovers readable information from a bad or defective disk.
REM Records comments (remarks) in batch files or CONFIG.SYS.
REN Renames a file or files.
RENAME Renames a file or files.
REPLACE Replaces files.
RMDIR Removes a directory.
SET Displays, sets, or removes Windows environment variables.
SETLOCAL Begins localization of environment changes in a batch file.
SHIFT Shifts the position of replaceable parameters in batch files.
SORT Sorts input.
START Starts a separate window to run a specified program or command.
SUBST Associates a path with a drive letter.
TIME Displays or sets the system time.
TITLE Sets the window title for a CMD.EXE session.
TREE Graphically displays the directory structure of a drive or path.
TYPE Displays the contents of a text file.
VER Displays the Windows version.
VERIFY Tells Windows whether to verify that your files are written
correctly to a disk.
VOL Displays a disk volume label and serial number.
XCOPY Copies files and directory trees.