search results

Devel(UP) Your Skills

Tuesday, March 25, 2008

Net command help

NET.exe
The NET Command is used to manage File Shares, Printer Shares and sessions as follows: Display a local shareNET SHARE sharenameDisplay a list of computers in the current domain. NET VIEWTo see a list of shares on a remote computer NET VIEW \\ComputerNameTo see a list of all shares in the domain:NET VIEW /DOMAINTo see a list of shares on a different domainNET VIEW /DOMAIN:domainnameTo see a list of shares on a remote Netware computer NET VIEW /NETWORK:NW [\\ComputerName]Create a new local file shareNET SHARE sharename=drive:path /REMARK:"text" [/CACHE:Manual Automatic No ]Limit the number of users who can connect to a shareNET SHARE sharename /USERS:number /REMARK:"text"Remove any limit on the number of users who can connect to a shareNET SHARE sharename /UNLIMITED /REMARK:"text"Delete a shareNET SHARE {sharename devicename drive:path} /DELETEDelete all shares that apply to a given deviceNET SHARE devicename /DELETEIn this case the devicename can be a printer (Lpt1) or a pathname (C:\Docs\)Join a file share (Drive MAP)NET USE Display all the open shared files on a server and the lock-idNET FILEClose a shared file (disconnect other users and remove file locks)NET FILE id /CLOSEList all sessions connected to this machineNET SESSIONList sessions from a given machineNET SESSION \\ComputerNameDisconnect all sessions connected to this machineNET SESSION /DELETEDisconnect all sessions connected to this machine (without any prompts)NET SESSION /DELETE /yDisconnect sessions from a given machineNET SESSION \\ComputerName /DELETENotes:NET SESSION displays incoming connections only, in other words it must be run on the machine that is acting as the server.
To create file shares the SERVER service must be running, which in turn requires 'File and Print Sharing' to be installed.
"Don't worry about people stealing an idea. If it's original, you will have to ram it down their throats" - Howard Aiken
ARP Address Resolution ProtocolASSOC Change file extension associationsASSOCIAT One step file associationAT Schedule a command to run at a later timeATTRIB Change file attributes BOOTCFG Edit Windows boot settingsBROWSTAT Get domain, browser and PDC info CACLS Change file permissionsCALL Call one batch program from anotherCD Change Directory - move to a specific FolderCHANGE Change Terminal Server Session propertiesCHKDSK Check Disk - check and repair disk problemsCHKNTFS Check the NTFS file systemCHOICE Accept keyboard input to a batch fileCIPHER Encrypt or Decrypt files/foldersCleanMgr Automated cleanup of Temp files, recycle binCLEARMEM Clear memory leaksCLIP Copy STDIN to the Windows clipboard.CLS Clear the screenCLUSTER Windows ClusteringCMD Start a new CMD shellCOLOR Change colors of the CMD windowCOMP Compare the contents of two files or sets of filesCOMPACT Compress files or folders on an NTFS partitionCOMPRESS Compress individual files on an NTFS partitionCON2PRT Connect or disconnect a PrinterCONVERT Convert a FAT drive to NTFS.COPY Copy one or more files to another locationCSCcmd Client-side caching (Offline Files)CSVDE Import or Export Active Directory data DATE Display or set the dateDcomcnfg DCOM Configuration UtilityDEFRAG Defragment hard driveDEL Delete one or more filesDELPROF Delete NT user profilesDELTREE Delete a folder and all subfoldersDevCon Device Manager Command Line Utility DIR Display a list of files and foldersDIRUSE Display disk usageDISKCOMP Compare the contents of two floppy disksDISKCOPY Copy the contents of one floppy disk to anotherDNSSTAT DNS StatisticsDOSKEY Edit command line, recall commands, and create macrosDSADD Add user (computer, group..) to active directory
DSQUERY List items in active directoryDSMOD Modify user (computer, group..) in active directory ECHO Display message on screenENDLOCAL End localisation of environment changes in a batch fileERASE Delete one or more filesEXIT Quit the CMD shellEXPAND Uncompress filesEXTRACT Uncompress CAB files FC Compare two filesFDISK Disk Format and partitionFIND Search for a text string in a fileFINDSTR Search for strings in filesFOR /F Loop command: against a set of filesFOR /F Loop command: against the results of another commandFOR Loop command: all options Files, Directory, ListFORFILES Batch process multiple filesFORMAT Format a diskFREEDISK Check free disk space (in bytes)FSUTIL File and Volume utilitiesFTP File Transfer ProtocolFTYPE Display or modify file types used in file extension associations GLOBAL Display membership of global groupsGOTO Direct a batch program to jump to a labelled line HELP Online HelpHFNETCHK Network Security Hotfix Checker IF Conditionally perform a commandIFMEMBER Is the current user in an NT WorkgroupIPCONFIG Configure IP KILL Remove a program from memory LABEL Edit a disk labelLOCAL Display membership of local groupsLOGEVENT Write text to the NT event viewer.LOGOFF Log a user offLOGTIME Log the date and time in a file MAPISEND Send email from the command lineMEM Display memory usageMD Create new foldersMKLINK Create a symbolic link (linkd)MODE Configure a system deviceMORE Display output, one screen at a timeMOUNTVOL Manage a volume mount pointMOVE Move files from one folder to anotherMOVEUSER Move a user from one domain to anotherMSG Send a messageMSIEXEC Microsoft Windows InstallerMSINFO Windows NT diagnosticsMSTSC Terminal Server Connection (Remote Desktop Protocol)MUNGE Find and Replace text within file(s)MV Copy in-use files NET Manage network resourcesNETDOM Domain ManagerNETSH Configure network protocolsNETSVC Command-line Service ControllerNBTSTAT Display networking statistics (NetBIOS over TCP/IP)NETSTAT Display networking statistics (TCP/IP)NOW Display the current Date and Time NSLOOKUP Name server lookupNTBACKUP Backup folders to tapeNTRIGHTS Edit user account rights PATH Display or set a search path for executable filesPATHPING Trace route plus network latency and packet lossPAUSE Suspend processing of a batch file and display a messagePERMS Show permissions for a userPERFMON Performance MonitorPING Test a network connectionPOPD Restore the previous value of the current directory saved by PUSHDPORTQRY Display the status of ports and servicesPRINT Print a text filePRNCNFG Display, configure or rename a printerPRNMNGR Add, delete, list printers set the default printerPROMPT Change the command promptPsExec Execute process remotelyPsFile Show files opened remotelyPsGetSid Display the SID of a computer or a userPsInfo List information about a systemPsKill Kill processes by name or process IDPsList List detailed information about processesPsLoggedOn Who's logged on (locally or via resource sharing)PsLogList Event log recordsPsPasswd Change account passwordPsService View and control servicesPsShutdown Shutdown or reboot a computerPsSuspend Suspend processesPUSHD Save and then change the current directory QGREP Search file(s) for lines that match a given pattern. RASDIAL Manage RAS connectionsRASPHONE Manage RAS connectionsRECOVER Recover a damaged file from a defective disk.REG Registry: Read, Set, Export, Delete keys and valuesREGEDIT Import or export registry settingsREGSVR32 Register or unregister a DLLREGINI Change Registry PermissionsREM Record comments (remarks) in a batch fileREN Rename a file or files.REPLACE Replace or update one file with anotherRD Delete folder(s)RDISK Create a Recovery DiskRMTSHARE Share a folder or a printerROBOCOPY Robust File and Folder CopyROUTE Manipulate network routing tablesRUNAS Execute a program under a different user accountRUNDLL32 Run a DLL command (add/remove print connections) SC Service ControlSCHTASKS Create or Edit Scheduled Tasks SCLIST Display NT ServicesScriptIt Control GUI applicationsSET Display, set, or remove environment variablesSETLOCAL Control the visibility of environment variablesSETX Set environment variables permanently SHARE List or edit a file share or print shareSHIFT Shift the position of replaceable parameters in a batch fileSHORTCUT Create a windows shortcut (.LNK file)SHOWGRPS List the NT Workgroups a user has joinedSHOWMBRS List the Users who are members of a WorkgroupSHUTDOWN Shutdown the computerSLEEP Wait for x secondsSOON Schedule a command to run in the near futureSORT Sort inputSTART Start a separate window to run a specified program or commandSU Switch UserSUBINACL Edit file and folder Permissions, Ownership and DomainSUBST Associate a path with a drive letterSYSTEMINFO List system configuration TASKLIST List running applications and servicesTIME Display or set the system timeTIMEOUT Delay processing of a batch fileTITLE Set the window title for a CMD.EXE sessionTOUCH Change file timestamps TRACERT Trace route to a remote hostTREE Graphical display of folder structureTYPE Display the contents of a text file USRSTAT List domain usernames and last login VER Display version informationVERIFY Verify that files have been savedVOL Display a disk label WHERE Locate and display files in a directory treeWHOAMI Output the current UserName and domainWINDIFF Compare the contents of two files or sets of filesWINMSD Windows system diagnosticsWINMSDP Windows system diagnostics II
WMIC WMI Commands XCACLS Change file permissionsXCOPY Copy files and folders

ADDUSERS Add or list users to/from a CSV file

The NET Command is used to manage network resources as follows: Manage ServicesNET START, STOP, PAUSE, CONTINUEConnect to a file/print Share (Drive Map) NET USE
Create/view file/printer SharesNET SHARE, VIEW, FILE, SESSIONSManage Network Print jobs and Network TimeNET TIME, PRINTSecurityNET ACCOUNTS, USER, GROUP, LOCALGROUPNetwork MessagingNET NAME, SENDHelpNET HELP, HELPMSGNetwork configurationNET COMPUTER, CONFIG_WORKSTATION, CONFIG_SERVER, STATISTICS_WORKSTATION, STATISTICS_SERVERWhen you use NET commands in a batch file, you can use the Y or N switch to unconditionally answer Yes or No to questions returned by the Net command"The white man knows how to make everything but he does not know how to distribute it" - Sitting Bull
The NET Command is used to manage services as follows: Syntax NET START [service] NET STOP [service] NET PAUSE [service] NET CONTINUE [service] Key service : The service name as shown in Control Panel, Services
To list the basic NT Services:
NET HELP SERVICES
To list the running NT Services:
NET START
If you try to start a service that is already running you will get this error message:"The requested service has already been started. More help is available by typing NET HELPMSG 2182"You can redirect and FIND this type of error as follows:NET START alerter 2>&1FIND "2182" IF errorlevel 1 goto :s_started
The NET Command is used to connect to a File/Printer Share as follows:
Join a file share (Drive MAP) - Win 2K / XP / 2003 NET USE [driveletter:] \\ComputerName\ShareName\folder1\folder2 /PERSISTENT:No
The commands below work in NT 4 or greater -Make all future connections persistent (auto-reconnect at login)NET USE /Persistent:Yesor NET USE /P:Yes
Make all future connections non-persistent (reconnect with login script)NET USE /Persistent:NoorNET USE /P:No
Join a file share (Drive MAP)NET USE [driveletter:] \\ComputerName\ShareName /PERSISTENT:YES
Join a file share (Drive MAP) - with a "long" share nameNET USE [driveletter:] "\\ComputerName\ShareName"
Connect a user to their HOME directoryNET USE [devicename *] [password *]] [/HOME]This requires the users Home server/folder to be defined in ADUCJoin a password protected file share (Drive MAP)NET USE [driveletter:] \\ComputerName\ShareName[\volume] [password *][/USER:[domainname\]username] [/PERSISTENT:No]In the above command /USER can also be specified as:[/USER:[dotted domain name\]username][/USER:[username@dotted domain name] In a script, to map a drive and wait until the mapping has completed before continuing:START /wait NET USE [driveletter:] \\ComputerName\ShareNameThis will be a little slower, but ensures that files can be read from the mapped drive immediately.Join a Printer ShareNET USE [LPTx:] \\ComputerName\printer_share /PERSISTENT:YESJoin a Printer Share - with a "long" share nameNET USE [LPTx:] "\\ComputerName\printer_share"Disconnect from a shareNET USE [driveletter:] /DELETE
Examples
NET USE H: /HomeNET USE H: \\MainServer\Users\%Username%NET USE W: \\MainServer\GroupShare /Persistent:NoNET USE \\MainServer\SharedPrinterNotes:NET USE command can map a network printer to an LPT port (for DOS type applications that print to a port.) but this does not add the printer to Control Panel - Printers.
By default all mapped drives have a 15 minute idle session timeout, you can modify this with the NET CONFIG command. This timeout does affect NT and 2000 but actually became visible in the XP GUI, this behaviour is to improve the overall performance.
Alternatives
Windows Scripting Host (WSH) provides alternative and arguably better commands, for XP and 2003 this is the way to go:Wsh.MapNetworkDrive [ example script ]Wsh.AddWindowsPrinterConnection [Examples]
Drive Descriptions
Recent versions of Windows display a drive description, this can be edited in the Explorer GUI. The text is stored in the registry.Win 2K stores a description for each drive letter, XP stores a description for each share.Win XP registryHKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\##ComputerName#ShareName_LabelFromReg= (string REG_SZ) Windows 2000 registryHKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\DriveLetter\_LabelFromRegCache = (REG_BINARY data type)
"Two roads diverged in a wood, and I-I took the one less traveled by,And that has made all the difference - Robert Frost
The NET Command is used to manage Network Print jobs and Network Time as follows: The NET TIME command requires the `server' service to be running on the machine that is serving the time.Display the time at this computer plus the DATE in US FormatNET TIME \\%ComputerName%Display the date and time from another computerNET TIME \\machinenameDisplay the date and time from the logonserverNET TIME %LOGONSERVER%Display the time from the domain timeserverNET TIME /DOMAINDisplay the time from another domainNET TIME /DOMAIN:domainname
Define the time server for your domainNET TIME /setsntp:ServerName.DomainName.com
List the time server(s) for your domainNET TIME /querysntp
Synchronise the computer's clock with that of the domain. NET TIME /DOMAIN /SET /YSynchronise the computer's clock with a different domain. NET TIME /DOMAIN:domainname /SETSynchronise the computer's clock with that of another computerNET TIME \\servername /SET /YESUnder Windows 2000 - you can also use the "w32tm" commandSynchronise the computer's clock with a time server in a different domain. NET TIME /RTSDOMAIN:domainname /SETDisplay the job# of current print jobsNET PRINT \\ComputerName\ShareNameHold a print job waiting in the printer queueNET PRINT [\\ComputerName] job# /HOLD Release a print job that has been held.NET PRINT [\\ComputerName] job# /RELEASEDelete a print job from a printer queue.NET PRINT [\\ComputerName] job# /DELETE
List all available printers NET VIEW \\MyServer find "Print"
The NET Command is used to manage network security resources as follows:View user account password and logon requirements (also displays the machine type - NT Server or NT workstation)NET ACCOUNTSView password and logon requirements for the network domain.NET ACCOUNTS /DOMAINSet the number of minutes a user has before being forced to log off when the account expires or valid logon hours expireNET ACCOUNTS /FORCELOGOFF:minutes /DOMAINPrevent forced logoff when user accounts expireNET ACCOUNTS /FORCELOGOFF:NO /DOMAINSet the minimum number of characters for a password. NET ACCOUNTS /MINPWLEN:c /DOMAINThe range is 0-14 characters; the default is 6 characters.Set the maximum number of days that a password is valid.NET ACCOUNTS /MAXPWAGE:dd /DOMAINThe range is 1-49710; the default is 90 days.Set passwords to never expire.NET ACCOUNTS /MAXPWAGE:UNLIMITED /DOMAINSet a minimum number of days that must pass before a user can change a password (default = 0)NET ACCOUNTS /MINPWAGE:dd /DOMAINRequire that new passwords be different from 'x' number of previous passwordsNET ACCOUNTS /UNIQUEPW:x /DOMAINThe range for 'x' is 1-24Synchoronise the user accounts database (PDC and BDC)NET ACCOUNTS /SYNC /DOMAINView user account detailsNET USER [/DOMAIN]Add a user account.NET USER username {password *} /ADD [options] [/DOMAIN]Modify a user account. NET USER [username [password *] [options]] [/DOMAIN]Delete a usernameNET USER username [/DELETE] [/DOMAIN]Add a WorkgroupNET GROUP groupname /ADD [/COMMENT:"text"] [/DOMAIN]Edit a workgroupNET GROUP [groupname [/COMMENT:"text"]] [/DOMAIN]Delete a groupNET GROUP groupname /DELETE [/DOMAIN]Add a user to a groupNET GROUP groupname username [...] /ADD [/DOMAIN]Delete a user from a groupNET GROUP groupname username [...] /DELETE [/DOMAIN]To View, Add or modify a local workgroup replace GROUP in the commands above with LOCALGROUP.
Example
Create a group
C:\>NET LOCALGROUP spud /addThe command completed successfully.
Add to guests
C:\>NET LOCALGROUP guests spud /addThe command completed successfully.
Then remove
C:\>NET LOCALGROUP guests spud /deleteThe command completed successfully.
C:\>NET LOCALGROUP spud /deleteThe command completed successfully.
The NET Command is used to send network messages as follows:Network broadcast messages use "messaging names". A messaging name can be the ComputerName, your UserName or any other name you add as part of the NET NAME command line. To add an additional messaging name for receiving messages. NET NAME extraname /ADDTo remove a messaging nameNET NAME extraname /DELETEIt is not possible to remove the ComputerName with this commandTo send a broadcast message to another userNET SEND j_smith Meeting changed to 3 p.mTo send a broadcast message to another machineNET SEND mc_144 Meeting changed to 3 p.mTo send a message to all users who have a session with the serverNET SEND /USERS This server will shut down in 5 minutes. To send a broadcast message to the whole domainNET SEND * This server will shut down in 5 minutes.To send a broadcast message to another domainNET SEND /DOMAIN[:other domainname] This server will shut down in 5 minutes.To use NET SEND the Messenger service must be running
The NET Command is used to display help as follows: The syntax for displaying help differs from other NT commands:Provide brief help with any NET command
NET option suboption /?e.g. NET CONFIG SERVER /?
Provide detailed help with any NET command
NET option suboption /HELP orNET HELP option suboptione.g. NET CONFIG SERVER /HELPNET HELP CONFIG SERVER
To provide help with a Windows error message (Typically the 4 digit number from the Event Viewer system log)
NET HELPMSG message#e.g.NET HELPMSG 2184
Explanation of how to read NET HELP screens.
NET HELP SYNTAX
To display NET Help one screen at a time:
NET HELP option MORE
The NET Command is used to manage network resources as follows: Managing Network configurationTo add a computer to the domainNET COMPUTER \\ComputerName /ADDThis command is only available from the Server and is best run from the Primary Domain Controller (PDC)To remove a computer from the domainNET COMPUTER \\ComputerName /DELThis command is only available from the Server and is best run from the Primary Domain Controller (PDC)Change the idle session timeout (default = 15 minutes)NET CONFIG SERVER /Autodisconnect:mmTo disable idle timeouts altogetherNET CONFIG SERVER /Autodisconnect:-1Note this may reduce overall performance - see related KBase articles below.To remove a machine from Network NeighbourhoodNET CONFIG SERVER /hidden:yesBefore using the /hidden option see Q128167
Change the comment displayed in My Computer (detail view)NET CONFIG SERVER /Srvcomment:"YourText"Display or change the Workstation Service communication device settingsNET CONFIG WORKSTATION /?Display statistics for the local Workstation serviceNET STATISTICS WORKSTATIONDisplay statistics for the local Server serviceNET STATISTICS SERVER
Mode is an all purpose configuration command, used without parameters, MODE displays the status of all devices installed on your system. Devices Show the status of all devices: (Typically COM1, COM2, LPT1, CON)MODE Show the status of a specific device:MODE [device] To additionally show the status of any redirected parallel printer:MODE [device] [/STATUS] CMD Prompt window size Change the CMD prompt screen size/buffer Number of cols(characters) wide and Number of lines deepMODE CON[:] [COLS=c] [LINES=n]KeyboardSet the keyboard typematic rate, the rate at which a character is repeated when you hold down the key. MODE CON[:] [RATE=r DELAY=d] Printing To redirect output from a parallel port (PRN, LPT1, LPT2, or LPT3) to a serial port(COM1, COM2, COM3, etc). You must be a member of the Administrators group to redirect printing. To configure a parallel printer port (PRN, LPT1, LPT2, or LPT3): MODE LPTn[:]=COMm[:]To setup the parameters for a serial port (* see Start, Help, Commands for more on this). MODE COMm [options*]Configure a printer connected to a parallel printer port. mode LPTn[:] [c][,[l][,r]] mode LPTn[:] [cols=c] [lines=l]This allows you to configure a line printer connected to a parallel printer port. International SettingsChange the current code page: MODE CON[:] CP SELECT=yyyDisplay the current Code page: MODE CON[:] CP [/STATUS]
Examples:
MODE CON:cols=80 lines=25
"The dogma of the ghost in the machine" - Gilbert Ryle
SUMMARY
loadTOCNode(1, 'summary');
This article describes how to use the net user command to change the user password at a Windows command prompt. Only administrators can change domain passwords at the Windows command prompt.
MORE INFORMATION
loadTOCNode(1, 'moreinformation');
To change a user's password at the command prompt, log on as an administrator and type:
net user user_name * /domain
When you are prompted to type a password for the user, type the new password, not the existing password. After you type the new password, the system prompts you to retype the password to confirm. The password is now changed. Alternatively, you can type the following command:
net user user_name new_password
When you do so, the password changes without prompting you again. This command also enables you to change passwords in a batch file. Non-administrators receive a "System error 5 has occurred. Access is denied" error message when they attempt to change the password.
ram
ram disk device
Ram is a block device to access the ram disk in raw mode.It is typically created by: mknod -m 660 /dev/ram b 1 1 chown root:disk /dev/ram
FILES /dev/ram
"All your life you live so close to truth it becomes a permanent blur in the corner of your eye. And when something nudges it into outline, it's like being ambushed by a grotesque." Tom Stoppard, Rosencrantz and Guildenstern are Dead

No comments:

Country calling code