[TOC]
1.系统设备驱动 mode 命令 描述:MODE命令配置系统设备更改CMD配置
基础语法:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 串行端口: MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s] [to=on|off] [xon=on|off] [odsr=on|off] [octs=on|off] [dtr=on|off|hs] [rts=on|off|hs|tg] [idsr=on|off] 设备状态: MODE [device] [/STATUS] 打印重定向: MODE LPTn[:]=COMm[:] 选择代码页: MODE CON[:] CP SELECT=yyy 代码页状态: MODE CON[:] CP [/STATUS] 显示模式: MODE CON[:] [COLS=c] [LINES=n] 击键率: MODE CON[:] [RATE=r DELAY=d]
基础实例:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 >mode 设备状态 LPT1: ---------- 未重新路由打印机输出结果 设备状态 COM1: ---------- 波特率: 1200 奇偶校验: None 数据位: 7 停止位: 1 超时: OFF XON/XOFF: OFF CTS 握手: OFF DSR 握手: OFF DSR 敏感度: OFF DTR 电路: ON RTS 电路: ON 设备状态 CON: --------- 行: 300 列: 80 键盘速度: 31 键盘延迟: 1 代码页: 936 mode CON /status mode con cp SELECT=437 >mode con: cols=1024 lines=30
WeiyiGeek.
DriverQuery命令 描述:新增的cmd命令,允许管理员显示已安装设备驱动程序的列表。 基础语法:1 2 3 4 5 6 7 8 9 10 11 12 13 14 DRIVERQUERY [/S system [/U username [/P [password]]]] [/FO format] [/NH] [/SI] [/V] /FO format 指定要显示的结果类型。与命令行开关一起传递的有效值是 "TABLE" 、"LIST" 、" CSV" 。 /NH 指定“列标题”不应该在屏幕输出中出现。只对 "TABLE" 和 "CSV" 格式有效。 /SI 提供有关已签名驱动程序的信息。 /V 显示详细任务输出,对签名的驱动程序无效。 DRIVERQUERY DRIVERQUERY /FO CSV /SI DRIVERQUERY /NH DRIVERQUERY /S ipaddress /U user /V DRIVERQUERY /S system /U domain\user /P password /FO LIST
WeiyiGeek.
1 2 driverquery /FO LIST /SI | MORE driverquery | findstr "2017"
WeiyiGeek.
2.系统控制设置 bootcfg命令 简述: BOOTCFG 命令设置 boot.ini 文件的属性 描述: bootcfg 命令是一个 Microsoft Windows XP 故障恢复控制台命令,可以用来处理BOOT.INI 文件中配置,查询,更改或删除启动项目设置。
此命令具有这样的功能:在硬盘上扫描 Microsoft Windows NT、Microsoft Windows 2000和 Windows XP 安装,然后将这些安装添加到现有的 Boot.ini 文件中,如果 Boot.ini 文件不存在,则重新生成一个新的 Boot.ini 文件,bootcfg 命令使其他 Boot.ini 文件参数能够添加到现有项或新项中。
参数列表:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 /Addsw 允许用户添加预定义开关 /Rmsw 允许用户删除预定义开关 /Debug 允许用户为远程调试指定端口和波特率 ON|OFF|EDIT 指定用于 1394 端口调试的值; /Dbg1394 允许用户为调试配置 1394 端口 /Copy 生成一个现有的启动项目的副本 /Delete 从 BOOT.INI 文件删除现有启动项目 /Query 显示当前启动项目和它们的设置 /Raw 允许用户指定要添加的任何开关 /Timeout 允许用户更改超时值 /Default 允许用户更改默认启动项目 /EMS 允许用户为无头支持配置 /redirect 开关 /s Computer 指定远程计算机名称或 IP 地址(不能使用反斜杠),默认值是本地计算机。 /u Domain\User 对于由 user 或 domain\user 指定的用户,运行具有其帐户权限的命令。默认值是当前登录发布命令的计算机的用户权限。 /p Password 指定用户帐户的密码,该用户帐户在 /u 参数中指定。 /mm MaximumRAM 将 /maxmem 开关添加到指定的 OSEntryLineNum,并且设置操作系统可以使用的最大内存数 /bv 将 /basevideo 开关添加到指定的 OSEntryLineNum,从而控制操作系统使用已安装视频驱动器的标准 VGA 模式 /so 将 /sos 开关添加到指定的 OSEntryLineNum,从而控制操作系统在设备驱动程序名称加载时显示它们 /ng 将 /noguiboot 开关添加到指定的 OSEntryLineNum,从而禁用在 CTRL+ALT+DEL 登录提示之前显示的 Windows XP Professional 进度栏 /id OSEntryLineNum 对于添加有操作系统加载项的 Boot.ini 文件,指定其 [operating systems] 区段中的操作系统项的行号,[operating systems] 标题区域后的首行是 1 /d description 为新的操作系统项指定说明 /ch channel 指定用于调试的信道:有效值为 1 到 64 之间的某个整数。如果禁用 1394 端口调试,则不要使用 /ch channel 参数。
命令详解:1 2 3 4 5 6 7 8 9 10 11 12 bootcfg addsw bootcfg /addsw [/s Computer [/u Domain\User /p Password]] [/mm MaximumRAM] [/bv] [/so] [/ng] /id OSEntryLineNum bootcfg /addsw /mm 64 /id 2 bootcfg /addsw /so /id 3 bootcfg /addsw /so /ng /s srvmain /u hiropln /id 2 bootcfg /addsw /ng /id 2 bootcfg /addsw /mm 96 /ng /s srvmain /u maindom\hiropln /p [email protected] /id 2
1 2 3 4 5 6 7 8 9 10 bootcfg copy bootcfg /copy [/s Computer [/u Domain\User /p Password]] [/d Description] [/id OSEntryLineNum] bootcfg /copy /d "\ABC Server\" /id 1 bootcfg /copy /s srvmain /u maindom\hiropln /p [email protected] /d " Windows XP" /id 2 bootcfg /copy /u hiropln /p [email protected] /d " AB Ver 1.001" /id 2
1 2 3 4 5 6 7 8 9 10 11 bootcfg dbg1394 bootcfg /dbg1394 {ON|OFF|EDIT} [/s Computer [/u Domain\User /p Password]] [/ch channel] /id OSEntryLineNum bootcfg /dbg1394 /id 2 bootcfg /dbg1394 on /ch 1 /id 3 bootcfg /dbg1394 edit /ch 8 /id 2 bootcfg /s srvmain /u maindom\hiropln /p [email protected] 3 /dbg1394 off /id 2
1 2 3 4 5 6 7 8 9 10 bootcfg debug bootcfg /debug {ON|OFF|EDIT} [/s Computer [/u Domain\User /p Password]] [/port {COM1|COM2|COM3|COM4}] [/baud {9600|19200|38400|57600|115200}] [/id OSEntryLineNum] bootcfg /debug on /port com1 /id 2 bootcfg /debug edit /port com2 /baud 19200 /id 2 bootcfg /s srvmain /u maindom\hiropln /p [email protected] /debug off /id 2
1 2 3 4 5 6 7 bootcfg default bootcfg /default [/s Computer [/u Domain\User /p Password]] [/id OSEntryLineNum] bootcfg /default /id 2 bootcfg /default /s srvmain /u maindom\hiropln /p [email protected] /id 2
1 2 3 4 5 6 7 bootcfg delete bootcfg /delete [/s Computer [/u Domain\User /p Password]] [/id OSEntryLineNum] bootcfg /delete /id 1 bootcfg /delete /s srvmain /u maindom\hiropln /p [email protected] /id 3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 在boot.ini中的[boot loader]节添加"redirect=Port#" 行,以及对指定的操作系统添加/redirect开关。 bootcfg ems bootcfg /ems {ON|OFF|EDIT} [/s Computer [/u Domain\User /p Password]] [/port {COM1|COM2|COM3|COM4|BIOSSET}] [/baud {9600|19200|38400|57600|115200}] [/id OSEntryLineNum] on | off 指定用于 EMS 重定向的值 ON 为指定的 OSEntryLineNum 启用远程输出。将 /redirect 开关添加到指定 OSEntryLineNum,并且将 redirect=comX 设置添加到 [boot loader] 区段,comX 的值由 /port 参数设置 OFF 禁用输出到远程计算机。将 /redirect 开关从指定 OSEntryLineNum 删除,并将 redirect=comX 设置从 [boot loader] 区段删除 EDIT 允许通过更改 [boot loader] 区段中的 redirect=comX 设置来更改端口设置,comX 值恢复为 /port 参数所指定的值 /port {COM1|COM2|COM3|COM4|BIOSSET} 指定用于重定向的 COM 端口。BIOSSET 控制 EMS 获得 BIOS 设置以确定用于重定向的端口。如果禁用了远程管理输出,请不要使用 /port 参数 bootcfg /ems on /port com1 /baud 19200 /id 2 bootcfg /ems on /port biosset /id 3 bootcfg /s srvmain /ems off /id 2 bootcfg /ems edit /port com2 /baud 115200 bootcfg /s srvmain /u maindom\hiropln /p [email protected] /ems off /id 2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 bootcfg query bootcfg /query [/s Computer [/u Domain\User /p Password]] 启动加载程序设置 timeout: 30 default:multi(0)disk(0)rdisk(0)partition(1)\WINDOWS 启动项 ID、友好名、路径以及 OS 加载项 启动项目 ID: 1 好记的名称:"Microsoft Windows XP Professional" 路径:multi(0)disk(0)rdisk(0)partition(1)\WINDOWS OS 加载选项:/fastdetect /debug /debugport=com1: 该 bootcfg query 输出的启动加载程序设置部分显示了 Boot.ini 的 [boot loader] 区段中的所有项。 该 bootcfg query 输出的启动项部分显示了 Boot.ini 的 [operating systems] 区段中的这些操作系统项: 下述范例显示了如何使用 bootcfg /query 命令: bootcfg /query bootcfg /query /s srvmain /u maindom\hiropln /p [email protected] bootcfg /query /u hiropln /p [email protected]
1 2 3 4 5 6 7 8 9 10 11 bootcfg raw 语法 bootcfg [/s Computer [/u Domain\User /p Password]] /raw OSLoadOptionsString [/id OSEntryLineNum] Bootcfg raw 可将文本添加到某个操作系统项的末尾,该过程会覆盖任何已有的操作系统项选项,所添加的文本应包含有效的 OS 加载项,比如 /debug、/fastdetect、/nodebug、/baudrate、/crashdebug 以及 /sos 等。 比如使用下述命令可将“/debug /fastdetect”添加到首个操作系统项的末尾,并会替代此前的任何操作系统项选项: bootcfg /raw "/debug /fastdetect" /id 1 有关可选 OS 加载项以及 Windows 在启动期间如何使用 Boot.ini 文件的详细信息,请参阅 Microsoft Knowledge Base 中编号为 Q170756 的技术文章,其标题为“Windows NT Boot.ini 文件的可用开关项”。 下述范例显示了如何使用 bootcfg /raw 命令: bootcfg /raw "/debug /sos" /id 2 bootcfg /raw /s srvmain /u maindom\hiropln /p [email protected] "/crashdebug " /id 2
1 2 3 4 5 6 7 8 9 10 bootcfg rmsw bootcfg /rmsw [/s Computer [/u Domain\User /p Password]] [/mm] [/bv] [/so] [/ng] /id OSEntryLineNum bootcfg /rmsw /mm 64 /id 2 bootcfg /rmsw /so /id 3 bootcfg /rmsw /so /ng /s srvmain /u hiropln /id 2 bootcfg /rmsw /ng /id 2 bootcfg /rmsw /mm 96 /ng /s srvmain /u maindom\hiropln /p [email protected] /id 2
1 2 3 4 5 6 7 8 9 10 11 bootcfg timeout bootcfg /timeout TimeOutValue [/s Computer [/u Domain\User /p Password]] TimeOutValue :指定位于 [boot loader] 区段的超时值。 bootcfg /timeout 30 bootcfg /s srvmain /u maindom\hiropln /p [email protected] /timeout 50
警告: BOOT.INI 用于 Windows XP 及更早版本操作系统上的启动选项,使用 BCDEDIT 命令行工具修改Windows Vista 引导选项.
bcdedit 命令 1 2 3 4 5 6 bcdedit -set loadoptions DISABLE_INTEGRITY_CHECKS bcdedit -set TESTSIGNING ON bcdedit -set loadoptions ENABLE_INTEGRITY_CHECKS bcdedit -set TESTSIGNING OFF
powercfg 命令 描述:此命令行工具使用户能够控制系统上的电源设置。
参数列表与语法:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 POWERCFG -LIST POWERCFG -DELETE <GUID> POWERCFG -DELETESETTING <SUB_GUID> <SETTING_GUID> powercfg -q 381b4222-f694-41f0-9685-ff5bb260df2e fea3413e-7e05-4911-9a71-700331f1c294
WeiyiGeek.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 POWERCFG -X <SETTING> <VALUE> <SETTING> 指定下列选项之一: -monitor-timeout-ac <分钟> -monitor-timeout-dc <分钟> -disk-timeout-ac <分钟> -disk-timeout-dc <分钟> -standby-timeout-ac <分钟> -standby-timeout-dc <分钟> -hibernate-timeout-ac <分钟> -hibernate-timeout-dc <分钟> POWERCFG -Change -monitor-timeout-ac 5
WeiyiGeek.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 用法: POWERCFG -CHANGENAME <GUID> <name> <scheme description> 如果该描述被忽略,则仅修改该名称 用法: POWERCFG -DUPLICATESCHEME <GUID> <destination GUID> 案例: <GUID> 指定通过使用 powercfg -l 获得的方案 GUID 如果忽略 <destination GUID>,将为重复的方案创建新 GUID。 用法: POWERCFG -SETACTIVE <SCHEME_GUID> <SCHEME_GUID> 指定方案 GUID 用法: POWERCFG -GETACTIVESCHEME 用法: POWERCFG -SETACVALUEINDEX <SCHEME_GUID> <SUB_GUID> <SETTING_GUID> <SettingIndex> 交流 POWERCFG -SETDCVALUEINDEX <SCHEME_GUID> <SUB_GUID> <SETTING_GUID> <SettingIndex> 直流 参数: <SCHEME_GUID> 指定一个电源方案 GUID,并可以通过使用 PowerCfg /L 获得它。 <SUB_GUID> 指定电源设置 GUID 的一个子组,并可以通过使用 "PowerCfg /Q" 获得它。 <SETTING_GUID> 指定一个单独的电源设置 GUID,并可以通过使用 "PowerCfg /Q" 获得它。 <SettingIndex> 指定此电源设置将被设置为可能值列表中的哪个值。 示例: POWERCFG -SetAcValueIndex <GUID> <GUID> <GUID> 5 这会将该电源设置的交流值设置为此电源设置的可能值列表中的第 5 项。 用法: POWERCFG -H <ON|OFF> POWERCFG -H -Size <PercentSize> 参数: -Size 以总内存百分比指定所需的休眠文件大小。默认大小不得小于 50。此开关还自动启用休眠文件。 POWERCFG -DEVICEQUERY <queryflags> wake_from_S1_supported 返回支持从浅睡眠状态唤醒系统的所有设备。 wake_from_S2_supported 返回支持从深睡眠状态唤醒系统的所有设备。 wake_from_S3_supported 返回支持从最深睡眠状态唤醒系统的所有设备。 wake_from_any 返回支持从任何睡眠状态唤醒系统的所有设备。 S1_supported 列出支持浅睡眠的设备。 S2_supported 列出支持较深睡眠的设备。 S3_supported 列出支持最深睡眠的设备。 S4_supported 列出支持休眠的设备。 wake_programmable 列出用户可配置的从某个睡眠状态唤醒系统的设备。 wake_armed 列出当前配置为从任何睡眠状态唤醒系统的设备。 all_devices 返回系统中现有的所有设备。 POWERCFG -DEVICEQUERY wake_armed POWERCFG -DEVICEENABLEWAKE <devicename> PowerCfg -DEVICEQUERY wake_programmable POWERCFG -DEVICEENABLEWAKE "Microsoft USB IntelliMouse Exp"
WeiyiGeek.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 POWERCFG -DEVICEDISABLEWAKE <devicename> POWERCFG -IMPORT <filename> <GUID> <filename> 指定到由以下内容生成的文件的完全限定路径"PowerCfg -EXPORT" 参数生成的文件的完全限定 <GUID> (可选)将设置加载到此 GUID 所代表的电源方案中。如果未提供,powercfg将生成并使用新 GUID POWERCFG -IMPORT c:\scheme.pow 用法: POWERCFG -EXPORT <filename> <GUID> 示例: POWERCFG -EXPORT c:\scheme.pow 381b4222-f694-41f0-9685-ff5bb260df2
WeiyiGeek.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 用法: POWERCFG -SETSECURITYDESCRIPTOR <GUID|ACTION> <SDD 参数: <GUID> 指定电源方案或电源设置 GUID。 <ACTION> 可以是下列字符串之一: ActionSetActive、ActionCreate、ActionDefaul <SDDL> 以 SDDL 格式指定一个有效的安全描述符字符串。 调用 POWERCFG -GETSECURITYDESCRIPTOSDDL 字符串示例。 用法: POWERCFG -GETSECURITYDESCRIPTOR <GUID|ACTION> <GUID> 指定电源方案或电源设置 GUID <ACTION> 可以是下列字符串之一: ActionSetActive, ActionCreate, ActionDefaul 用法: POWERCFG -REQUESTSOVERRIDE <CALLER_TYPE> <NAME> <REQUEST> 参数 <CALLER_TYPE> 指定以下调用程序类型之一:PROCESS、SERVICE、DRIVER。这通过调用 POWERCFG -REQUESTS 命令获得。 <NAME> 指定调用程序名称。这是通过调用 POWERCFG -REQUESTS 命令返回的名称。 <REQUEST> 指定以下一个或多个电源请求类型: Display、System、Awaymode。 示例: POWERCFG -REQUESTSOVERRIDE PROCESS wmplayer.exe Disp ENERGY 命令将在当前路径中生成一个 HTML 报告文件,ENERGY命令支持以下可选参数: POWERCFG -ENERGY [-OUTPUT <FILENAME>] [-XML] [-DURATION <SECONDS>] POWERCFG -ENERGY -TRACE [-D <FILEPATH>] [-DURATION <SECONDS>] -OUTPUT <FILENAME> – 指定存储能量报告 HTML 文件的路径和文件名。 -XML - 将报告文件格式化为 XML 文件。 -TRACE - 记录系统行为,但不执行分析。 除非指定 -D 参数,否则将在当前路径中生成跟踪文件。 -D <FILEPATH> - 指定存储跟踪数据的目录。只能与 -TRACE 参数一起使用。 -DURATION <SECONDS> – 指定观察系统行为的秒数。默认值为 60 秒。 -WAKETIMERS -枚举活动唤醒计时器。如果启用,唤醒计时器可以将系统从睡眠状态和休眠状态唤醒。 powercfg -energy -output test.html -DURATION 10
WeiyiGeek.