1. Findstr // Searches for strings in files
a) Findstr /s /m “bruce” *.* // searches for “bruce” in all files
b) Findstr "bruce there" x.y // searches for "bruce" or"there" in file x.y.
c) Findstr /C:"bruce there" x.y //searches for "bruce there" in file x.y.
/S Searches for matching files in the current directory and all subdirectories.
/M Prints only the filename if a file contains a match.
2. Xcopy //Copies files and directory trees.
xcopy ""brucepc"Courses"*.* /s /y //copy all files of courses
/S Copies directories and subdirectories except empty ones.
/Y Suppresses prompting to confirm you want to overwrite an
existing destination file.
3. Start //Starts a separate window to run a specified program or command.
Start C:"Windows
4. ipconfig /all // Show detailed information such as IP address, subnet mask and default gateway for each adapter bound to TCP/IP.
5. ping IP //for check net status
6. shutdown /r /t 0 //立即重起
shutdown /s /t 0 //立即关机,
/r Shutdown and restart the computer.
/s Shutdown the computer
7. cd" //go to root directory
8. pushd //Stores the current directory for use by the POPD command, then changes to the specified directory.
9. popd // Changes to the directory stored by the PUSHD command
10. regedit /s 1.reg //automate import reg file and no hint
11. net use //列出本机网络连接
a) net use ""IP"ipc$ "密码" /user:"帐号" 建立与指定IP的IPC$(空连接)
net use z: ""IP"c$ "密码" /user:"帐号" 将对方的c盘映射为自己的z盘
net use ""IP"ipc$ /del 删除与指定IP的IPC$连接
net use z: /del 删除本机映射的z盘
net use * /del 删除本机所有映射和IPC$连接
如提示:提供的凭据与已存在的凭据冲突, net use * /del 即可
b) Remote: net use ""computername"sharename "password" /user:"administrator"
12. net user 查看本机用户
a) net user abcd 1234 /add,新建一个用户名为abcd,密码为1234的帐户,默认为user组成员。
b) net user abcd /del,将用户名为abcd的用户删除。
c) net user abcd /active:no,将用户名为abcd的用户禁用。
d) net user abcd /active:yes,激活用户名为abcd的用户。
net user abcd,查看用户名为abcd的用户的情况
13. net localgroup administrators 用户名 /add 把用户添加到管理员
net localgroup administrators 用户名 /del 把用户从管理员组删除
13. net start service name// 开启服务;(如:net start telnet, net start schedule)
net stop service name//停止某服务
14. net view ""ip 查看对方局域网内开启了哪些共享
15. net share 查看本地开启的共享
a) net share ipc$ 开启ipc$共享
b) net share ipc$ /del 删除ipc$共享
c) net share c$ /del 删除C:共享
16.使用nslookup命令检测DNS服务器工作是否正常
17 net helpmsg //提供 Windows NT 错误信息的帮助。
Such as: net helpmsg 4100//The DHCP client has obtained an IP address that is already in use on the network
. The local interface will be disabled until the DHCP client can obtain a new address.
18. 设置目录权限的cacls 命令:
cacls BDPTmpWrkFldr /t /e /c /g "NT AUTHORITY"SYSTEM":r
cacls BDPTmpWrkFldr /t /e /c /g "NT AUTHORITY"SYSTEM":f
移掉administrators的权限: cacls test /e /r BUILTIN"administrators
加上权限: cacls test /g BUILTIN"administrators:f
无交互的方法: echo y|cacls test /e /r BUILTIN"administrators
echo y|cacls test /g BUILTIN"administrators:f
echo y|cacls test /g BUILTIN"administrators:f
cacls test /e /g BUILTIN"users:r
不加/e 就会删除前面的设置, 加上/e 就是追加设置.
删除目录的命令
cmd /c echo y|rd D:"testdir /s
19.netstat –n//立刻知道和那几个ip(端口)建立了连接(可以知道有人 黑你吗)