Windows commonly used shell commands

Introduction

The result of mouse-based operation is that the appearance of the OS interface changes, which requires more learning costs. More importantly, the speed of guiding Path based on the interface is incomparable with the direct access to the command line. In addition, a large part of Geek is controlled by the keyboard, not by the mouse.

Organize the common shell commands of Windows, on the one hand, help to learn Mysql in depth, on the other hand, prepare to try to transition to the Linux family.

1. Overview of Shell commands under Windows

Windows' Shell command is Windows' CMD command. The cmd command is retained from the original MS-DOS system.

Shell source path and configuration

The corresponding command resources are configured in the environment variables of windows:

Windows Shell commands are based on the configured Path environment variable. For Shell commands, the corresponding named executable entries are searched from front to back in the Path path.

That is to say, you can write some shell programs by yourself, such as C, Java, Perl, etc., and then configure them in environment variables to have your own private shell commands. Most of the default Shell commands correspond to the target programs in the "C:/Windows/" and "C:/Windows/System32" directories. Some Windows-based applications (such as Mysql) will add their own directories to the Windows Path configuration.

How Shell commands are executed

Generally, it is executed by calling out the CMD console

· For those who are familiar with it, you can write the bat batch shell command by yourself, and then save it as a file with a .bat suffix.

· Take Win7 as an example, you can use the Win key to call up the search window for quick execution, but you can’t use all of them

At the same time, it can be executed by calling out the running window through Win+R

2. Commonly used Shell program commands

The following is a list of those shell commands that are called out by category. By using the corresponding commands, you can save a lot of time:

Windows common tools to run programs

run the program run command
notebook notepad
calculator calc
drawing mspaint
writing board write
windows magnifying glass magnify
Accessibility Manager utilman
Telnet client client Telnet
task manager taskmgr
Scanners and Cameras sticpl.cpl
Remote Desktop mstsc
Registry Editor regedit
TrueType character creation program shutdown
printer folder control printers
control Panel control
on-screen keyboard pers
Internet connection ncpa.cpl 或control netconnections
Log off from Windows logoff
font folder fonts 或control fonts
disk management diskmgmt.msc
quick search findfast.cpl
Disk Defragmenter dfrg.msc
Disk Checker pers
Disk Cleanup Tool cleanmgr
command line prompt cmd
scrapbook viewer clipbrd
Accessibility options access.cpl
Add Hardware Wizard hdwwiz.cpl
add or remove programs appwiz.cpl

Common management configuration tools

device manager devmgmt.msc
Direct X Control Panel (if installed) directx.cpl
Direct X Diagnostic Tool dxdiag
disk partition manager diskpart
display properties desk.cpl or control desktop
Folder options control folders
Appearance tab of display properties control color
File signature verification clearly visible
IP configuration utility ipconfig
keyboard properties control keyboard
mouse properties main.cpl or control mouse
internet properties regedit
password attribute shutdown
Phone and Modem Options control printers
Power Options Properties powercfg.cpl
performance perfmon
Regional and Language Options intl.cpl
system property sysdm.cpl
User Account Management nusrmgr.cpl
windows firewall firewall.cpl
run windows update wupdmgr
system configuration utility msconfig
Sound and Audio Device Properties mmsys.cpl
Shared folder fsmgmt.msc
Serve services.msc
Windows Security Center wscui.cpl
mission plan control schedtasksl
game control joy.cpl
character map charmap
Certificate Management Console certmgr.msc

some advanced configuration management

Windows Management Architecture wmimgmt.msc
Windows System Security Tools syskey
系统配置编辑器 sysedit
策略的结果集
可移动存储 ntmsmgr.msc
可移动存储操作请求 ntmsoprq.msc
ODBC数据源管理器 odbccp32.cpl
本地安全设置 secpol.msc
本地用户和组 lusrmgr.msc
索引服务 ciadv.msc
组策略编辑器 gpedit.msc
事件查看器 eventvwr.msc
Driver Verifier Manager verifier
r. Watson系统诊断工具 drwtsn32

三、一些Shell程序命令详解

下面围绕第二章节以及更多高级shell操作命令进行详细描述:(陆续根据使用补充)

  • 网络配置Ipconfig命令

  • 默认Ipconfig为显示当前网络基本连接信息

  • 显示连接配置 ipconfig /all

  • 显示DNS缓存内容 ipconfig /displaydns

  • 去除DNS缓存内容 ipconfig /flushdns

  • 释放全部(或指定)适配器的由DHCP分配的动态IP地址) ipconfig /release

  • 为全部适配器重新分配IP地址 ipconfig /renew

  • 刷新DHCP并重新注册DNS ipconfig /registerdns

  • 显示DHCP Class ID ipconfig /showclassid

  • 修改DHCP Class ID ipconfig /setclassid

  • 关机操作shutdown命令

Shutdown使您能够一次关闭或重新启动一台本地或远程计算机:

语法::
shutdown [/i | /l | /s | /r | /a | /p | /h | /e] [/f] [/m //computername/] [/t XXX] [/d [p:]XX:YY/c"Comment"]

参数:
· /i : 显示“远程关机对话框”。/i 选项必须是键入的第一个参数,之后的所有参数都将被忽略。

  • /l : 立即注销当前用户,没有超时期限。不能将 /l 与 /m //computername/ 或 /t 一起使用。
  • /s : 关闭计算机。
  • /r : 关机后重新启动计算机。
  • /a : 取消关机操作(仅在超时期限内有效)。a 参数仅可以与 /m //computername/ 一起使用。
  • /p : 仅关闭本地计算机(而不是远程计算机),没有超时期或警告。/p 只能和 /d 一起使用。如果您的计算机不支持关闭电源功能,使用 /p 将关闭系统但不会切断您的计算机电源。
  • /h : 使本地计算机处于休眠状态(如果已启用休眠)。仅可将 h 与 /f 一起使用。
  • /e : 允许在目标计算机上记录意外关机原因。
  • /f : 强制关闭正在运行的应用程序而不提前警告用户。
  • /t:设置经过过长时间进行当次操作,定时功能,时间单位为秒

举例:

  • 立即关机:shutdown -s -t 0
  • 30秒后重启:shutdown -r -t 30
  • 取消关机:shutdown -a

网络连接查看命令netstat

  • netstat -a 查看开启了哪些端口,常用netstat -an

  • netstat -n 查看端口的网络连接情况,常用netstat -an

  • netstat -v 查看正在进行的工作

  • netstat -p 协议名 例:netstat -p tcq/ip 查看某协议使用情况(查看tcp/ip协议使用情况)

  • netstat -s 查看正在使用的所有协议使用情况

系统网络服务命令net

  • netstat -a 查看开启了哪些端口,常用netstat -an

  • net use //ip/ipc$ " " /user:" " 建立IPC空链接

  • net use //ip/ipc$ “密码” /user:“用户名” 建立IPC非空链接

  • net use h: //ip/c$ “密码” /user:“用户名” 直接登陆后映射对方C:到本地为H:

  • net use h: //ip/c$ 登陆后映射对方C:到本地为H:

  • net use //ip/ipc$ /del 删除IPC链接

  • net use h: /del 删除映射对方到本地的为H:的映射

  • net user 用户名 密码 /add 建立用户

  • net user guest /active:yes 激活guest用户

  • net user 查看有哪些用户

  • net user 帐户名 查看帐户的属性

  • net localgroup administrators 用户名 /add 把"用户"添加到管理员中使其具有管理员权限,注意:administrator后加s用复数

  • net start 查看开启了哪些服务

  • net start 服务名 开启服务;(如:net start telnet, net start schedule)

  • net stop 服务名 停止某服务

  • net time //目标ip 查看对方时间

  • net time //目标ip /set 设置本地计算机时间与"目标IP"主机的时间同步,加上参数/yes可取消确认信息

  • net view 查看本地局域网内开启了哪些共享

  • net view //ip 查看对方局域网内开启了哪些共享

  • net config 显示系统网络设置

  • net logoff 断开连接的共享

  • net pause 服务名 暂停某服务

  • net send ip “文本信息” 向对方发信息

  • net ver 局域网内正在使用的网络连接类型和信息

  • net share 查看本地开启的共享

  • net share ipc$ 开启ipc$共享

  • net share ipc$ /del 删除ipc$共享

  • net share c$ /del 删除C:共享

  • net user guest 12345 用guest用户登陆后用将密码改为12345

  • net password 密码 更改系统登陆密码

系统服务命令sc

SC来控制系统创建服务和管理服务。

SC使用这样的语法:

sc [command] [service name] …

下面介绍各种参数。

  1. server :可选,可以使用双斜线,如myserver ,也可以是192.168.0.1 来操作远程计算机。如果在本地计算机上操作就不用添加任何参数。

  2. command:下面列出SC可以使用的命令
    o config—-改变一个服务的配置。(长久的)
    o continue–对一个服务送出一个继续控制的要求。
    o control—-对一个服务送出一个控制。
    o create—-创建一个服务。(增加到注册表中)
    o delete—-删除一个服务。(从注册表中删除)
    o EnumDepend–列举服务的从属关系。
    o GetDisplayName–获得一个服务的显示名称。
    o GetKeyName–获得一个服务的服务键名。
    o interrogate–对一个服务送出一个询问控制要求。
    o pause—-对一个服务送出一个暂停控制要求。
    o qc—-询问一个服务的配置。
    o query—-询问一个服务的状态,也可以列举服务的状态类型。
    o start—-启动一个服务。
    o stop—-对一个服务送出一个停止的要求。

  3. service name:在注册表中为service key制定的名称。注意这个名称是不同于显示名称的(这个名称可以用net start和服务控制面板看到),而SC是使用服务键名来鉴别服务的。

特别说明
:SC create 子命令

这个命令可以在注册表和服务控制管理数据库建立一个入口。使用语法如下:

sc create [service name] [binPath= ] …

这里的servername,servicename,optionname,optionvalues和上面的一样,这里就option描述,通常为键值对应:option name = option values 。

注:键值对应 name= value,等号后面应由一个空格,不能省略

option 详细描述如下:

  • type=—-own, share, interact, kernel, filesys

关于建立服务的类型,选项值包括驱动程序使用的类型,默认是share。

  • start=—-boot, sys tem, auto, demand, disabled

关于启动服务的类型,选项值包括驱动程序使用的类型,默认是demand(手动)。

  • error=—-normal, severe, critical, ignore

当服务在导入失败错误的严重性,默认是normal。

  • binPath=–(string)

服务二进制文件的路径名,这里没有默认值,这个字符串是必须设置的。

  • group=—-(string)

这个服务属于的组,这个组的列表保存在注册表中的ServiceGroupOrder下。默认是nothing。

  • tag=—-(string)

如果这个字符串被设置为yes,sc可以从CreateService call中得到一个tagId。然而,SC并不显示这个标签,所以使用这个没有多少意义。默认是nothing

  • depend=—-(space separated string)有空格的字符串。

在这个服务启动前必须启动的服务的名称或者是组。

  • obj=—-(string)

账号运行使用的名称,也可以说是登陆身份。默认是localsys tem

  • Displayname=–(string)

一个为在用户界面程序中鉴别各个服务使用的字符串。

  • password=–(string)

一个密码,如果一个不同于localsys tem的账号使用时需要使用这个。

  • Optionvalues

Optionname参数名称的数值列表。参考optionname。当我们输入一个字符串时,如果输入一个空的引用这意味着一个空的字符串将被导入。

举例说明:在一台叫做(myserver )的计算机上为一个叫“NewService”的服务建立的一个注册表登记,命令如下:

sc myserver create MyService binpath= C:/NewServ.exe
在这里插入图片描述

Guess you like

Origin blog.csdn.net/zch981964/article/details/132204409