Anda di halaman 1dari 9

ADDUSERS Add or list users to/from a CSV file ARP Address Resolution Protocol ASSOC Change file extension

associations ASSOCIAT One step file association ATTRIB Change file attributes b BCDBOOT Create or repair a system partition BOOTCFG Edit Windows boot settings BROWSTAT Get domain, browser and PDC info c CACLS Change file permissions CALL Call one batch program from another CD Change Directory - move to a specific Folder CHANGE Change Terminal Server Session properties CHKDSK Check Disk - check and repair disk problems CHKNTFS Check the NTFS file system CHOICE Accept keyboard input to a batch file CIPHER Encrypt or Decrypt files/folders CleanMgr Automated cleanup of Temp files, recycle bin CLEARMEM Clear memory leaks CLIP Copy STDIN to the Windows clipboard. CLS Clear the screen CLUSTER Windows Clustering CMD Start a new CMD shell CMDKEY Manage stored usernames/passwords COLOR Change colors of the CMD window COMP Compare the contents of two files or sets of files COMPACT Compress files or folders on an NTFS partition COMPRESS Compress individual files on an NTFS partition CON2PRT Connect or disconnect a Printer CONVERT Convert a FAT drive to NTFS. COPY Copy one or more files to another location CSCcmd Client-side caching (Offline Files) CSVDE Import or Export Active Directory data d DATE Display or set the date DEFRAG Defragment hard drive DEL Delete one or more files DELPROF Delete NT user profiles DELTREE Delete a folder and all subfolders DevCon Device Manager Command Line Utility DIR Display a list of files and folders DIRUSE Display disk usage DISKCOMP Compare the contents of two floppy disks DISKCOPY Copy the contents of one floppy disk to another DISKPART Disk Administration DNSSTAT DNS Statistics DOSKEY Edit command line, recall commands, and create macros DSACLs Active Directory ACLs DSAdd Add items to active directory (user group computer) DSGet View items in active directory (user group computer) DSQuery Search for items in active directory (user group computer) DSMod Modify items in active directory (user group computer) DSMove Move an Active directory Object DSRM Remove items from Active Directory e ECHO Display message on screen ENDLOCAL End localisation of environment changes in a batch file ERASE Delete one or more files EVENTCREATE Add a message to the Windows event log

EXIT Quit the current script/routine and set an errorlevel EXPAND Uncompress files EXTRACT Uncompress CAB files f FC FIND FINDSTR FOR /F FOR /F FOR FORFILES FORMAT FREEDISK FSUTIL FTP FTYPE g GLOBAL Display membership of global groups GOTO Direct a batch program to jump to a labelled line GPUPDATE Update Group Policy settings h HELP i iCACLS IF IFMEMBER IPCONFIG k KILL l LABEL LOCAL LOGEVENT LOGMAN LOGOFF LOGTIME m MAPISEND MBSAcli MEM MD MKLINK MODE MORE MOUNTVOL MOVE MOVEUSER MSG MSIEXEC MSINFO MSTSC MV n NET NETDOM NETSH NETSVC NBTSTAT NETSTAT NOW Manage network resources Domain Manager Configure Network Interfaces, Windows Firewall & Remote access Command-line Service Controller Display networking statistics (NetBIOS over TCP/IP) Display networking statistics (TCP/IP) Display the current Date and Time Send email from the command line Baseline Security Analyzer. Display memory usage Create new folders Create a symbolic link (linkd) Configure a system device Display output, one screen at a time Manage a volume mount point Move files from one folder to another Move a user from one domain to another Send a message Microsoft Windows Installer Windows NT diagnostics Terminal Server Connection (Remote Desktop Protocol) Copy in-use files Edit a disk label Display membership of local groups Write text to the NT event viewer Manage Performance Monitor Log a user off Log the date and time in a file Remove a program from memory Change file and folder permissions Conditionally perform a command Is the current user in an NT Workgroup Configure IP Online Help Compare two files Search for a text string in a file Search for strings in files Loop command: against a set of files Loop command: against the results of another command Loop command: all options Files, Directory, List Batch process multiple files Format a disk Check free disk space (in bytes) File and Volume utilities File Transfer Protocol Display or modify file types used in file extension associations

NSLOOKUP Name server lookup NTBACKUP Backup folders to tape NTRIGHTS Edit user account rights o OPENFILES Query or display open files p PATH Display or set a search path for executable files PATHPING Trace route plus network latency and packet loss PAUSE Suspend processing of a batch file and display a message PERMS Show permissions for a user PERFMON Performance Monitor PING Test a network connection POPD Restore the previous value of the current directory saved by PUSHD PORTQRY Display the status of ports and services POWERCFG Configure power settings PRINT Print a text file PRINTBRM Print queue Backup/Recovery PRNCNFG Display, configure or rename a printer PRNMNGR Add, delete, list printers set the default printer PROMPT Change the command prompt PsExec Execute process remotely PsFile Show files opened remotely PsGetSid Display the SID of a computer or a user PsInfo List information about a system PsKill Kill processes by name or process ID PsList List detailed information about processes PsLoggedOn Who's logged on (locally or via resource sharing) PsLogList Event log records PsPasswd Change account password PsService View and control services PsShutdown Shutdown or reboot a computer PsSuspend Suspend processes PUSHD Save and then change the current directory q QGREP r RASDIAL RASPHONE RECOVER REG REGEDIT REGSVR32 REGINI REM REN REPLACE RD RMTSHARE ROBOCOPY ROUTE RUN RUNAS RUNDLL32 s SC SCHTASKS SCLIST SET Service Control Schedule a command to run at a specific time Display NT Services Display, set, or remove environment variables Manage RAS connections Manage RAS connections Recover a damaged file from a defective disk. Registry: Read, Set, Export, Delete keys and values Import or export registry settings Register or unregister a DLL Change Registry Permissions Record comments (remarks) in a batch file Rename a file or files Replace or update one file with another Delete folder(s) Share a folder or a printer Robust File and Folder Copy Manipulate network routing tables Start | RUN commands Execute a program under a different user account Run a DLL command (add/remove print connections) Search file(s) for lines that match a given pattern.

NETSH (Network Shell) Configure Network Interfaces, Windows Firewall, Routing & remote access. Syntax NETSH [Context] [sub-Context] command Key The ows Use our contexts and commands available vary by platform, the list below is for Wind 2008. interactive mode/help (described below) to check the commands available on y machine.

= add - Add a configuration entry to a list of entries. netsh add helper - Install the specified helper DLL = advfirewall netsh advfirewall netsh advfirewall netsh advfirewall y rules. netsh advfirewall netsh advfirewall isting rule. netsh advfirewall y rule. - Change the 'netsh advfirewall' context. consec ? consec add consec delete consec dump consec set consec show - Display a list of commands. - Add a new connection security rule. - Delete all matching connection securit - Display a configuration script. - Set new values for properties of an ex - Display a specified connection securit

netsh advfirewall dump n. nfiguration settings.

Create a script that contains the current configuratio If saved to a file, this can be used to restore the co

netsh advfirewall export path\filename - Export the current policy to the speci fied file. netsh advfirewall import path\filename - Import policy from the specified file. netsh advfirewall rule. netsh advfirewall netsh advfirewall netsh advfirewall sting rule. netsh advfirewall firewall add firewall delete firewall dump firewall set firewall show - Add a new inbound or outbound firewall - Delete all matching inbound rules. - Display a configuration script. - Set new values for properties of a exi - Display a specified firewall rule. - Delete all matching security associati - Display a configuration script. - Show all matching security association

netsh advfirewall monitor delete ons. netsh advfirewall monitor dump netsh advfirewall monitor show s. netsh advfirewall reset netsh netsh netsh netsh netsh netsh advfirewall advfirewall advfirewall advfirewall advfirewall advfirewall set set set set set set

- Reset to factory settings (Firewall=ON) Set Set Set Set Set Set properties properties properties the global properties properties in all profiles. in the active profile. in the domain profile. properties. in the private profile. in the public profile.

allprofiles currentprofile domainprofile global privateprofile publicprofile

netsh advfirewall show netsh advfirewall show e. netsh advfirewall show ties. netsh advfirewall show netsh advfirewall show le. netsh advfirewall show e. netsh advfirewall show interactive session. =bridge netsh bridge netsh bridge context. netsh bridge netsh bridge netsh bridge context.

allprofiles - Display properties for all profiles. currentprofile - Display properties for the active profil domainprofile - Display properties for the domain proper global - Display the global properties. privateprofile - Display properties for the private profi publicprofile - Display properties for the public profil store - Display the policy store for the current

- Change to the 'netsh bridge' context. dump - Display a configuration script. install - Install the component corresponding to the current set show uninstall - Set configuration information. - Display information. - Remove the component corresponding to the current

=delete - Delete a configuration entry from a list of entries. netsh delete helper Remove the specified helper DLL from netsh. Note that after a helper is removed, it is no longer supported by netsh. =dhcpclient - Change to the netsh dhcpclient list netsh dhcpclient trace enable netsh dhcpclient trace disable =dump netsh dump settings. =exec - Run a script file. exec - Load a script file and run it. =firewall - Change to the 'netsh firewall' context. netsh firewall add - Add firewall configuration. netsh firewall delete - Delete firewall configuration. netsh firewall dump - Display a configuration script. netsh firewall reset - Reset firewall configuration to default. netsh firewall set allowedprogram - Set firewall allowed program configuration. netsh firewall set icmpsetting - Set firewall ICMP configuration. netsh firewall set logging - Set firewall logging configuration. netsh firewall set multicastbroadcastresponse - Set firewall multicast/broadcast response configuration. netsh firewall set notifications - Set firewall notification configuration. netsh firewall set opmode - Set firewall operational configuration. netsh firewall set portopening - Set firewall port configuration. netsh firewall set service - Set firewall service configuration. netsh firewall show allowedprogram - Show firewall allowed program configuration . netsh firewall show config - Show firewall configuration. netsh firewall show currentprofile - Show current firewall profile. netsh firewall show icmpsetting - Show firewall ICMP configuration. netsh firewall show logging - Show firewall logging configuration. netsh firewall show multicastbroadcastresponse - Show firewall multicast/broadca 'netsh dhcpclient' context. - List all the commands available. - Enable tracing for DHCP client and DHCP QEC. - Disable tracing for DHCP client and DHCP QEC.

- Display a configuration script. - Create a script that contains the current configuration. If saved to a file, this can be used to restore the configuration

st response configuration. netsh firewall show notifications netsh firewall show opmode netsh firewall show portopening netsh firewall show service netsh firewall show state =help netsh help =http netsh netsh netsh netsh netsh http http http http http

Show Show Show Show Show

firewall notification configuration. firewall operational configuration. firewall port configuration. firewall service configuration. current firewall state.

- Display a list of netsh commands. - Change to the 'netsh http' context. add - Add a configuration entry to a table. delete - Delete a configuration entry from a table. dump - Display a configuration script. flush - Flushe internal data. show - Display information. - Change to the 'netsh interface' context. 6to4 + Change to the 'netsh interface 6to4' context. add - Add a configuration entry to a table. delete - Delete a configuration entry from a table. dump - Display a configuration script. ipv4 + Change to the 'netsh interface ipv4' context. ipv6 + Change to the 'netsh interface ipv6' context. isatap + Change to the 'netsh interface isatap' context. portproxy + Change to the 'netsh interface portproxy' conte reset set show tcp teredo + + Reset information. Set configuration information. Display information. Change to the 'netsh interface tcp' context. Change to the 'netsh interface teredo' context.

=interface netsh interface netsh interface netsh interface netsh interface netsh interface netsh interface netsh interface netsh interface xt. netsh interface netsh interface netsh interface netsh interface netsh interface

The following sub-contexts are available: 6to4 ipv4 ipv6 isatap portproxy tcp teredo =ipsec netsh ipsec netsh ipsec netsh ipsec . netsh ipsec netsh ipsec netsh ipsec D. netsh ipsec netsh ipsec netsh ipsec netsh ipsec e. netsh ipsec y store. netsh ipsec tion. netsh ipsec rmation. - Change to the 'netsh ipsec' context. dump - Display a configuration script. dynamic add - Add policy, filter, and actions to SPD. dynamic delete - Delete policy, filter, and actions from SPD dynamic dump dynamic set dynamic show static static static static add delete dump exportpolicy - Display a configuration script. - Modifiy policy, filter, and actions in SPD. - Display policy, filter, and actions from SP Create new policies and related information. Delete policies and related information. Display a configuration script. Export all the policies from the policy stor

static importpolicy static set static show

- Import the policies from a file to the polic - Modify existing policies and related informa - Display details of policies and related info

=lan - Change to the 'netsh lan' context. netsh lan add - Add a configuration entry to a table. netsh lan delete - Delete a configuration entry from a table.

netsh netsh netsh netsh netsh =nap netsh netsh netsh netsh netsh

lan lan lan lan lan nap nap nap nap nap

dump export reconnect set show client dump hra reset show

Display a configuration script. Save LAN profiles to XML files. Reconnect on an interface. Configure settings on interfaces. Display information.

- Change to the 'netsh nap' context. + Change to the 'netsh nap client' context. - Display a configuration script. + Change to the 'netsh nap hra' context. - Reset configuration. - Show configuration and state information.

=netio netsh netio netsh netio netsh netio netsh netio =ras netsh netsh netsh netsh netsh netsh netsh netsh netsh ras ras ras ras ras ras ras ras ras

- Change to the 'netsh netio' context. add - Add a configuration entry to a table. delete - Delete a configuration entry from a table. dump - Display a configuration script. show - Display information. to the 'netsh ras' context. (Remote Access Server) - Change to the 'netsh ras aaaa' context. - Add items to a table. - Remove items from a table. - Change to the 'netsh ras diagnostics' context. - Display a configuration script. - Change to the 'netsh ras ip' context. - Change to the 'netsh ras ipv6' context. - Set configuration information. - Display information. to the 'netsh rpc' context. (RPC firewall filter) - Create an Add list of subnets. - Create a Delete list of subnets. - Display a configuration script. - Change to the 'netsh rpc filter' context. - Reset the selective binding settings to 'none' (liste - Display the selective binding state for each subnet o

- Change aaaa add delete diagnostics dump ip ipv6 set show

=rpc - Change netsh rpc add netsh rpc delete netsh rpc dump netsh rpc filter netsh rpc reset n on all interfaces). netsh rpc show n the system.

=set - Update configuration settings on a remote machine. netsh set machine [name=] [user=][[DomainName\]UserName] [pwd=][Password | *] If a machine name is not specified, the local machine is used. A username and password cannot be used to connect to the local machine. =show - Display information. netsh show alias - List all defined aliases. netsh show helper - List all the top-level helpers. =winhttp netsh winhttp netsh winhttp netsh winhttp netsh winhttp netsh winhttp - Change to the 'netsh winhttp' context. dump - Display a configuration script. import - Import WinHTTP proxy settings. reset - Reset WinHTTP settings. set - Configure WinHTTP settings. show - Display currents settings.

=winsock - Change to the 'netsh winsock' context. netsh winsock audit - Display a list of Winsock LSPs that have been ins talled and removed.

netsh netsh netsh netsh

winsock winsock winsock winsock

dump remove reset show

Display a configuration script. Remove a Winsock LSP from the system. Reset the Winsock Catalog to a clean state. Display information.

netsh - Interactive modeIn interactive mode, switch conte xt by typing any context name: advfirewall, bridge, firewall, http, interface, i psec.. etc list commands with ? exit interactive mode with Quit or Exit. To view help for any command, type the command, followed by a space and ? The syntax on this page is based on Windows 2008, for backwards compatibility wi th XP dns is an alias for dnsserver, ip is an alias for ipv4 Examples: Install ipmontr.dll: C:\> netsh advfirewall net add helper ipmontr.dll Export the fiewall policy: C:\> netsh advfirewall export "c:\advfirewallpolicy.wfw" Show TCP/IP settings C:\> netsh interface ip show config Set a static IP address (e.g. for a laptop) C:\> Netsh interface ip set address name="Local Area Connection" source=static a ddr=192.168.0.10 mask=255.255.255.0 gateway=192.168.0.1 gwmetric=1 Set a dynamic IP address with DHCP C:\> Netsh interface ip set address name="Local Area Connection" source=dhcp Add multiple DNS servers: C:\> Netsh interface ipv4 add dns "Local Area Connection" 10.0.0.1 C:\> Netsh interface ipv4 add dns "Local Area Connection" 10.0.0.3 index=2 index=2 adds the IP as a secondary dns server. Set a static DNS server address: C:\> Netsh interface ip set dns name="Local Area Connection" source=static addr= 192.168.0.2 register=none Set a dynamic DNS server address with DHCP: C:\> netsh interface ip set dns name="Local Area Connection" source=dhcp Set a static address for the WINS server: C:\> Netsh interface ip set wins name="Local Area Connection" source=static addr =192.168.100.3 To configure WINS from DHCP: C:\> Netsh interface ip set wins name="Local Area Connection" source=dhcp Backup the local DHCP server configuration to a file: C:\> netsh dump dhcp > C:\backupDHCPconfig.dat You can use this backup file to recreate the DHCP server with Netsh . Work against a remote machine: C:\> netsh set machine server64 Backup the current network interface configuration to a file: C:\> netsh dump interface > c:\backupInterfaceConfig.dat

Restore network interface configuration from a file: C:\> netsh exec c:\backupInterfaceConfig.dat Run Netsh from Powershell (returns a Text object you can manipulate) PS C:\> $myFWstate=netsh firewall show state PS C:\> $myFWstate -match "disable" Disable Network auto-tuning (certain routers and networking devices perform bett er with this off.) PS C:\> netsh interface tcp set global autotuning=disabled Enable Network auto-tuning (certain routers and networking devices perform bette r with this on.) PS C:\> netsh interface tcp set global autotuning=normal "Once you eliminate your #1 problem, #2 gets a promotion" - Gerald Weinberg, "Th e Secrets of Consulting"

Anda mungkin juga menyukai