|
WINDOSWS自带一些小应用程序详解
*************************************************************************************************
今天有点不爽,公司的ADSL被停了欠费:(,一天没有上网:(,记起自己的机器上有个庞大的技术知识库(平时收集的),看的很少,于是今天就翻出来看看:),发现了一篇好文章《加固NT和IIS的安全》,里边提到了如下小程序.
-------------------------------------------------------------------------------------------------
//*xcopy.exe, wscript.exe, cscript.exe, net.exe, ftp.exe, telnet.exe,arp.exe,
edlin.exe,
ping.exe,route.exe,at.exe,finger.exe,posix.exe,rsh.exe,atsvc.exe,qbasic.exe,runonce.exe,syskey.exe,cacls.exe,
ipconfig.exe, rcp.exe, secfixup.exe, nbtstat.exe, rdisk.exe, debug.exe,
regedt32.exe, regedit.exe, edit.com, netstat.exe, tracert.exe, nslookup.exe,
rexec.exe, cmd.exe,nslookup.exe *//
-------------------------------------------------------------------------------------------------
文章介绍说要把c:\\winnt\\system32下的这些工具移动到一个只有administrator才可以读写删的目录,来加固安全.我个人认为这样并不能使NT安全,如果我进入你的机器我敲上
netstat -an 对方机器提示我\"\'netstat.exe\'
不是内部或外部命令,也不是可运行的程序或批处理文件。\"那就很明显了,对方管理员移动了这些文件,我的选择有两个 继续入侵
退出(小心蜜罐or陷阱).继续入侵很好办,拷一个 命令行的下载工具 wget.exe
我觉得就不错支持断点续传,把自己机器上的需要程序(当然双方系统要相同,不相同的系统net、netstat一样么?我没有实验那位同志试验了,可要说说哦:)打包传到网上,下载
用gzip.exe(命令行解压缩/压缩工具)解开,ok!!
退出-->game
over:).既然文章建议移动这些程序,那就必然有他的用意,怕被人(黑客/骇客...)利用进一步入侵系统,那么我就看看这些工具有什么用处吧.我的系统
windows 2000 professionnal 其中有些工具没有,不知道是不是 winnt 的专利@@
*************************************************************************************************
xcopy.exe
#################################################################################################
C:\\>xcopy /? //说的很详细了,就不用我说了:)
复制文件和目录树。
XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
[/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U]
[/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z]
[/EXCLUDE:file1[+file2][+file3]...]
source 指定要复制的文件。
destination 指定新文件的位置和/或名称。
/A 只复制有存档属性集的文件,
但不改变属性。
/M 只复制有存档属性集的文件,
并关闭存档属性。
/D:m-d-y 复制在指定日期或指定日期以后改变的文件。
如果没有提供日期,只复制那些源时间
比目标时间新的文件。
/EXCLUDE:file1[+file2][+file3]...
指定含有字符串的文件列表。如果有任何
字符串与要被复制的文件的绝对路径
相符,那个文件将不会得到复制。
例如,指定如 \\obj\\ 或 .obj 的字符串会排除
目录 obj 下面的所有文件或带有
.obj 扩展名的文件。
/P 创建每个目标文件前提示。
/S 复制目录和子目录,除了空的。
/E 复制目录和子目录,包括空的。
与 /S /E 相同。可以用来修改 /T。
/V 验证每个新文件。
/W 提示您在复制前按键。
/C 即使有错误,也继续复制。
/I 如果目标不存在,又在复制一个以上的文件,
则假定目标一定是一个目录。
/Q 复制时不显示文件名。
/F 复制时显示完整的源和目标文件名。
/L 显示要复制的文件。
/H 也复制隐藏和系统文件。
/R 改写只读文件。
/T 创建目录结构,但不复制文件。不
包括空目录或子目录。/T /E 包括
空目录和子目录。
/U 只复制已经存在于目标中的文件。
/K 复制属性。一般的 Xcopy 会重设只读属性。
/N 用生成的短名复制。
/O 复制文件所有权和 ACL 信息。
/X 复制文件审核设置(隐含 /O)。
/Y 禁止提示以确认改写一个
现存目标文件。
/-Y 导致提示以确认改写一个
现存目标文件。
/Z 用重新启动模式复制网络文件。
命令选项 /Y 可以预先在 COPYCMD 环境变量中设置。
这可能被命令行上的 /-Y 改写。
#################################################################################################
wscript.exe
cscript.exe//这两个命令可以看作成一个.都是调试脚本用的,具体的呵呵~看你掌握的知识的全面性了:)
#################################################################################################
C:\\>cscript.exe /?
Microsoft (R) Windows Script Host Version 5.6
版权所有(C) Microsoft Corporation 1996-2001。保留所有权利。
用法:CScript scriptname.extension [option...] [arguments...]
选项:
//B 批模式:不显示脚本错误及提示信息
//D 启用 Active Debugging
//E:engine 使用执行脚本的引擎
//H:CScript 将默认的脚本宿主改为 CScript.exe
//H:WScript 将默认的脚本宿主改为 WScript.exe (默认)
//I 交互模式(默认,与 //B 相对)
//Job:xxxx 执行一个 WSF 工作
//Logo 显示徽标(默认)
//Nologo 不显示徽标:执行时不显示标志
//S 为该用户保存当前命令行选项
//T:nn 超时设定秒:允许脚本运行的最长时间
//X 在调试器中执行脚本
//U 用 Unicode 表示来自控制台的重定向 I/O
#################################################################################################
net.exe
#################################################################################################
C:\\>net.exe /?//呵呵~~难道这个还用我说??
此命令的语法是:
NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP |
HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION |
SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]
//只要有不懂的地方就在DOS下,敲上 net accounts /? 查看一下了:)有很多意想不到的收获哦:)
#################################################################################################
ftp.exe//这个大家经常用,ftp ip ; put hack.html index.html 呵呵~那个家伙就被你黑了@@
#################################################################################################
ftp> ?
Commands may be abbreviated. Commands are:
! delete literal prompt send
? debug ls put status
append dir mdelete pwd trace
ascii disconnect mdir quit type
bell get mget quote user
binary glob mkdir recv verbose
bye hash mls remotehelp
cd help mput rename
close lcd open rmdir
#################################################################################################
telnet.exe//大家经常 telnet 23 ; uname -a ; id 呵呵~~ root 晕倒:)
#################################################################################################
Microsoft (R) Windows 2000 (TM) 版本 5.00 (内部版本号 2195)
欢迎使用 Microsoft Telnet Client
Telnet Client 内部版本号 5.00.99203.1
Escape 字符为 \'CTRL+]\'
Microsoft Telnet> ?
指令可能缩写了。支持的指令为:
close 关闭当前连接
display 显示操作参数
open 连接到一个站点
quit 退出 telnet
set 设置选项 (要列表,请键入 \'set ?\' )
status 打印状态信息
unset 解除设置选项 (要列表,请键入 \'unset ?\' )
?/help 打印帮助信息
Microsoft Telnet> set
格式为 \'set Name <Value>\'
要查看帮助请键入 \'set ?\' 。
Microsoft Telnet> set ?
NTLM 打开 NTLM 身份验证。
LOCAL_ECHO 打开 LOCAL_ECHO。
TERM x (x 表示 ANSI, VT100, VT52 或 VTNT)
CODESET x (x 表示 Shift JIS,
Japanese EUC,
JIS Kanji,
JIS Kanji(78),
DEC Kanji 或
NEC Kanji)
CRLF 发送 CR 和 LF
Microsoft Telnet> unset ?
NTLM 关闭 NTLM 身份验证。
LOCAL_ECHO 关闭 LOCAL_ECHO.
CODESET 关闭 Japanese 代码集的 VT80 仿真。
CRLF 仅发送 CR (不发送 LF)
Microsoft Telnet>
#################################################################################################
arp.exe//查看本机的???:(
#################################################################################################
C:\\>arp.exe /?
Displays and modifies the IP-to-Physical address translation tables used by
address resolution protocol (ARP).
ARP -s inet_addr eth_addr [if_addr]
ARP -d inet_addr [if_addr]
ARP -a [inet_addr] [-N if_addr]
-a Displays current ARP entries by interrogating the current
protocol data. If inet_addr is specified, the IP and Physical
addresses for only the specified computer are displayed. If
more than one network interface uses ARP, entries for each ARP
table are displayed.
-g Same as -a.
inet_addr Specifies an internet address.
-N if_addr Displays the ARP entries for the network interface specified
by if_addr.
-d Deletes the host specified by inet_addr. inet_addr may be
wildcarded with * to delete all hosts.
-s Adds the host and associates the Internet address inet_addr
with the Physical address eth_addr. The Physical address is
given as 6 hexadecimal bytes separated by hyphens. The entry
is permanent.
eth_addr Specifies a physical address.
if_addr If present, this specifies the Internet address of the
interface whose address translation table should be modified.
If not present, the first applicable interface will be used.
Example:
> arp -s 157.55.85.212 00-aa-00-62-c6-09 .... Adds a static entry.
> arp -a .... Displays the arp table.
C:\\>
#################################################################################################
edlin.exe //这个是什么东西??没有找到:(
#################################################################################################
ping.exe//呵呵~~大名鼎鼎啊:)
#################################################################################################
C:\\>ping.exe /?
Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] destination-list
Options:
-t Ping the specified host until stopped.
To see statistics and continue - type Control-Break;
To stop - type Control-C.
-a Resolve addresses to hostnames.
-n count Number of echo requests to send.
-l size Send buffer size.
-f Set Don\'t Fragment flag in packet.
-i TTL Time To Live.
-v TOS Type Of Service.
-r count Record route for count hops.
-s count Timestamp for count hops.
-j host-list Loose source route along host-list.
-k host-list Strict source route along host-list.
-w timeout Timeout in milliseconds to wait for each reply.
C:\\>
#################################################################################################
route.exe//自己看看说明吧:)
#################################################################################################
C:\\>route.exe /?
Manipulates network routing tables.
ROUTE [-f] [-p] [command [destination]
[MASK netmask] [gateway] [METRIC metric] [IF nterface]
-f Clears the routing tables of all gateway entries. If this is
used in conjunction with one of the commands, the tables are
cleared prior to running the command.
-p When used with the ADD command, makes a routepersistent across
boots of the system. By default, routes are not preserved
when the system is restarted. Ignored for all other commands,
which always affect the appropriate persistent routes. This
option is not supported in Windows 95.
command One of these:
PRINT Prints a route
ADD Adds a route
DELETE Deletes a route
CHANGE Modifies an existing route
destination Specifies the host.
MASK Specifies that the next parameter is the \'netmask\' value.
netmask Specifies a subnet mask value for this route entry.
If not specified, it defaults to 255.255.255.255.
gateway Specifies gateway.
interface the interface number for the specified route.
METRIC specifies the metric, ie. cost for the destination.
All symbolic names used for destination are looked up in the network database
file NETWORKS. The symbolic names for gateway are looked up in the host name
database file HOSTS.
If the command is PRINT or DELETE. Destination or gateway can be a wildcard,
(wildcard is specified as a star \'*\'), or the gateway argument may be
omitted.
If Dest contains a * or ?, it is treated as a shell pattern, and only
matching destination routes are printed. The \'*\' matches any string,
and \'?\' matches any one char. Examples: 157.*.1, 157.*, 127.*, *224*.
Diagnostic Notes:
Invalid MASK generates an error, that is when (DEST & MASK) != DEST.
Example> route ADD 157.0.0.0 MASK 155.0.0.0 157.55.80.1 IF 1
The route addition failed: The specified mask parameter is invalid.
(Destination & Mask) != Destination.
Examples:
> route PRINT
> route ADD 157.0.0.0 MASK 255.0.0.0 157.55.80.1 METRIC 3 IF 2
destination^ ^mask ^gateway metric^ ^
Interface^
If IF is not given, it tries to find the best interface for a given
gateway.
> route PRINT
> route PRINT 157* .... Only prints those matching 157*
> route DELETE 157.0.0.0
> route PRINT
C:\\>
#################################################################################################
at.exe//呵呵~你不是经常用它启动放在对方机器上的后门么:),多看看参数吧:)
#################################################################################################
C:\\>at.exe /?
AT 命令安排在特定日期和时间运行命令和程序。
要使用 AT 命令,计划服务必须已在运行中。
AT [\\\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\\\computername] time [/INTERACTIVE]
[ /EVERY:date[,...] | /NEXT:date[,...]] \"command\"
\\\\computername 指定远程计算机。 如果省略这个参数,会计划在本地计算机上运行命令。
id 指定给已计划命令的识别号。
/delete 删除某个已计划的命令。如果省略 id,计算机上所有已计划的命令都会被删。
/yes 不需要进一步确认时,跟删除所有作业的命令一起使用。
time 指定运行命令的时间。
/interactive 允许作业在运行时,与当时登录的用户桌面进行交互。
/every:date[,...] 每个月或每个星期在指定的日期运行命令。如果省略日期,则默认为在每月的本日运行。
/next:date[,...] 指定在下一个指定日期(如,下周四)运行命令。如果省略日期,则默认为在每月的本日运行。
\"command\" 准备运行的 Windows NT 命令或批处理程序。
C:\\>
#################################################################################################
finger.exe//查看对方机器上现在登陆的用户信息,哇哇~~root在线,还搞个P啊,撤吧.
#################################################################################################
C:\\>finger -help
Displays information about a user on a specified system running the
Finger service. Output varies based on the remote system.
FINGER [-l] [user]@host [...]
-l Displays information in long list format.
user Specifies the user you want information about. Omit the user
parameter to display information about all users on the
specifed host.
@host Specifies the server on the remote system whose users you
want information about.
C:\\>
#################################################################################################
posix.exe//什么东西???????????????不会用:(
#################################################################################################
C:\\>posix.exe -help
usage: posix /c <path> [<args>]
#################################################################################################
rsh.exe//远程执行命令??也是没有搞定:(
#################################################################################################
C:\\>rsh.exe /?
rsh.exe: remote terminal session not supported
Runs commands on remote hosts running the RSH service.
RSH host [-l username] [-n] command
host Specifies the remote host on which to run command.
-l username Specifies the user name to use on the remote host. If
omitted, the logged on user name is used.
-n Redirects the input of RSH to NULL.
command Specifies the command to run.
#################################################################################################
#################################################################################################
atsvc.exe
qbasic.exe
runonce.exe//本人机器上没有:(
#################################################################################################
syskey.exe//执行一下看看:)
#################################################################################################
winnt 数据库加密
#################################################################################################
cacls.exe//哦~这个命令哦 谁用过??
#################################################################################################
C:\\>cacls.exe /?
显示或者修改文件的访问控制表(ACL)
CACLS filename [/T] [/E] [/C] [/G user:perm] [/R user [...]]
[/P user:perm [...]] [/D user [...]]
filename 显示 ACL。
/T 更改当前目录及其所有子目录中
指定文件的 ACL。
/E 编辑 ACL 而不替换。
/C 在出现拒绝访问错误时继续。
/G user:perm 赋予指定用户访问权限。
Perm 可以是: R 读取
W 写入
C 更改(写入)
F 完全控制
/R user 撤销指定用户的访问权限(仅在与 /E 一起使用时合法)。
/P user:perm 替换指定用户的访问权限。
Perm 可以是: N 无
R 读取
W 写入
C 更改(写入)
F 完全控制
/D user 拒绝指定用户的访问。
在命令中可以使用通配符指定多个文件。
也可以在命令中指定多个用户。
C:\\>
#################################################################################################
ipconfig.exe/可以查看本地的ip地址,网卡地址......
#################################################################################################
C:\\>ipconfig.exe /?
Windows 2000 IP Configuration
USAGE:
ipconfig [/? | /all | /release [adapter] | /renew [adapter]
| /flushdns | /registerdns
| /showclassid adapter
| /setclassid adapter [classidtoset] ]
adapter Full name or pattern with \'*\' and \'?\' to \'match\',
* matches any character, ? matches one character.
Options
/? Display this help message.
/all Display full configuration information.
/release Release the IP address for the specified adapter.
/renew Renew the IP address for the specified adapter.
/flushdns Purges the DNS Resolver cache.
/registerdns Refreshes all DHCP leases and re-registers DNS names
/displaydns Display the contents of the DNS Resolver Cache.
/showclassid Displays all the dhcp class IDs allowed for adapter.
/setclassid Modifies the dhcp class id.
The default is to display only the IP address, subnet mask and
default gateway for each adapter bound to TCP/IP.
For Release and Renew, if no adapter name is specified, then the IP address
leases for all adapters bound to TCP/IP will be released or renewed.
For SetClassID, if no class id is specified, then the classid is removed.
Examples:
> ipconfig ... Show information.
> ipconfig /all ... Show detailed information
> ipconfig /renew ... renew all adapaters
> ipconfig /renew EL* ... renew adapters named EL....
> ipconfig /release *ELINK?21* ... release all matching adapters,
eg. ELINK-21, myELELINKi21adapter.
C:\\>
#################################################################################################
rcp.exe//没有看错吧??@@ 远程拷贝@@!@
#################################################################################################
C:\\>rcp.exe /?
Copies files to and from computer running the RCP service.
RCP [-a | -b] [-h] [-r] [host][.user:]source [host][.user:] path\\destination
-a Specifies ASCII transfer mode. This mode converts
the EOL characters to a carriage return for UNIX
and a carriage
return/line feed for personal computers. This is
the default transfer mode.
-b Specifies binary image transfer mode.
-h Transfers hidden files.
-r Copies the contents of all subdirectories;
destination must be a directory.
host Specifies the local or remote host. If host is
specified as an IP address OR if host name contains
dots, you must specify the user.
.user: Specifies a user name to use, rather than the
current user name.
source Specifes the files to copy.
path\\destination Specifies the path relative to the logon directory
on the remote host. Use the escape characters
(\\ , \", or \') in remote paths to use wildcard
characters on the remote host.
C:\\>
#################################################################################################
secfixup.exe//没有找到:(
nbtstat.exe//你不是经常这样 nbtstat -A ip 看对方机器的NETBIOS的信息么:)
#################################################################################################
C:\\>nbtstat.exe /?
Displays protocol statistics and current TCP/IP connections using NBT
(NetBIOS over TCP/IP).
NBTSTAT [ [-a RemoteName] [-A IP address] [-c] [-n]
[-r] [-R] [-RR] [-s] [-S] [interval] ]
-a (adapter status) Lists the remote machine\'s name table given its name
-A (Adapter status) Lists the remote machine\'s name table given its
IP address.
-c (cache) Lists NBT\'s cache of remote [machine] names and their IP
addresses
-n (names) Lists local NetBIOS names.
-r (resolved) Lists names resolved by broadcast and via WINS
-R (Reload) Purges and reloads the remote cache name table
-S (Sessions) Lists sessions table with the destination IP addresses
-s (sessions) Lists sessions table converting destination IP
addresses to computer NETBIOS names.
-RR (ReleaseRefresh) Sends Name Release packets to WINs and then, starts
Refresh
RemoteName Remote host machine name.
IP address Dotted decimal representation of the IP address.
interval Redisplays selected statistics, pausing interval seconds
between each display. Press Ctrl+C to stop redisplaying
statistics.
#################################################################################################
rdisk.exe//很危险的一个命令:(
debug.exe//调试程序
regedt32.exe//注册表编辑器
regedit.exe//同上
edit.com//命令行编辑器
#################################################################################################
netstat.exe//我经常这样看 netstat -an | find \":3389\"看有没有人连我:)
#################################################################################################
C:\\>netstat.exe /?
Displays protocol statistics and current TCP/IP network connections.
NETSTAT [-a] [-e] [-n] [-s] [-p proto] [-r] [interval]
-a Displays all connections and listening ports.
-e Displays Ethernet statistics. This may be combined with the -s
option.
-n Displays addresses and port numbers in numerical form.
-p proto Shows connections for the protocol specified by proto; proto
may be TCP or UDP. If used with the -s option to display
per-protocol statistics, proto may be TCP, UDP, or IP.
-r Displays the routing table.
-s Displays per-protocol statistics. By default, statistics are
shown for TCP, UDP and IP; the -p option may be used to specify
a subset of the default.
interval Redisplays selected statistics, pausing interval seconds
between each display. Press CTRL+C to stop redisplaying
statistics. If omitted, netstat will print the current
configuration information once.
C:\\>
#################################################################################################
tracert.exe//呵呵~看看你发出的信息,经过了几层:)也可以利用它找路由器:)
#################################################################################################
C:\\>tracert.exe
Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
Options:
-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list Loose source route along host-list.
-w timeout Wait timeout milliseconds for each reply.
C:\\>
nslookup.exe,
> ?
Commands: (identifiers are shown in uppercase, [] means optional)
NAME - print info about the host/domain NAME using default server
NAME1 NAME2 - as above, but use NAME2 as server
help or ? - print info on common commands
set OPTION - set an option
all - print options, current server and host
[no]debug - print debugging information
[no]d2 - print exhaustive debugging information
[no]defname - append domain name to each query
[no]recurse - ask for recursive answer to query
[no]search - use domain search list
[no]vc - always use a virtual circuit
domain=NAME - set default domain name to NAME
srchlist=N1[/N2/.../N6] - set domain to N1 and search list to N1,N2, etc.
root=NAME - set root server to NAME
retry=X - set number of retries to X
timeout=X - set initial time-out interval to X seconds
type=X - set query type (ex. A,ANY,CNAME,MX,NS,PTR,SOA,SRV)
querytype=X - same as type
class=X - set query class (ex. IN (Internet), ANY)
[no]msxfr - use MS fast zone transfer
ixfrver=X - current version to use in IXFR transfer request
server NAME - set default server to NAME, using current default server
lserver NAME - set default server to NAME, using initial server
finger [USER] - finger the optional NAME at the current default host
root - set current default server to the root
ls [opt] DOMAIN [> FILE] - list addresses in DOMAIN (optional: output to FILE)
-a - list canonical names and aliases
-d - list all records
-t TYPE - list records of the given type (e.g. A,CNAME,MX,NS,PTR etc.)
view FILE - sort an \'ls\' output file and view it with pg
exit - exit the program
>
#################################################################################################
rexec.exe//GOOD 可惜,不会用:(
#################################################################################################
C:\\>rexec.exe
Runs commands on remote hosts running the REXEC service. Rexec
authenticates the user name on the remote host before executing the
specified command.
REXEC host [-l username] [-n] command
host Specifies the remote host on which to run command.
-l username Specifies the user name on the remote host.
-n Redirects the input of REXEC to NULL.
command Specifies the command to run.
C:\\>
#################################################################################################
cmd.exe//这个可是重点哦:)
#################################################################################################
C:\\>cmd.exe /?
启动 Windows 2000 命令解释器一个新的实例
CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]
[[/S] [/C | /K] string]
/C 执行字符串指定的命令然后终断
/K 执行字符串指定的命令但保留
/S 在 /C 或 /K 后修改字符串处理(见下)
/Q 关闭回应
/D 从注册表中停用执行 AutoRun 命令(见下)
/A 使向内部管道或文件命令的输出成为 ANSI
/U 使向内部管道或文件命令的输出成为 Unicode
/T:fg 设置前景/背景颜色(详细信息,请见 COLOR /?)
/E:ON 启用命令扩展(见下)
/E:OFF 停用命令扩展(见下)
/F:ON 启用文件和目录名称完成字符 (见下)
/F:OFF 停用文件和目录名称完成字符(见下)
/V:ON 将 c 作为定界符启动延缓环境变量扩展。如: /V:ON 会
允许 !var! 在执行时允许 !var! 扩展变量 var。var 语法
在输入时扩展变量,这与在一个 FOR 循环内不同。
/V:OFF 停用延缓的环境扩展。
请注意,如果字符串有引号,可以接受用命令分隔符 \'&&\' 隔开
的多个命令。并且,由于兼容原因,/X 与 /E:ON 相同,/Y 与
/E:OFF 相同,并且 /R 与 /C 相同。忽略任何其它命令选项。
如果指定了 /C 或 /K,命令选项后的命令行其余部分将作为命令行处
理;在这种情况下,会使用下列逻辑处理引号字符(\"):
1. 如果符合下列所有条件,那么在命令行上的引号字符将被
保留:
- 不带 /S 命令选项
- 整整两个引号字符
- 在两个引号字符之间没有特殊字符,特殊字符为下列中的
一个: <>()@^|
- 在两个引号字符之间有至少一个空白字符
- 在两个引号字符之间有至少一个可执行文件的名称。
2. 否则,老办法是,看第一个字符是否是一个引号字符,如果
是,舍去开头的字符并删除命令行上 的最后一个引号字符,
保留最后一个引号字符之后的文字。
如果 /D 未在命令行上被指定,当 CMD.EXE 开始时,它会寻找
以下 REG_SZ/REG_EXPAND_SZ 注册表变量。如果其中一个或
两个都存在,这两个变量会先被执行。
HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Command Processor\\AutoRun
和/或
HKEY_CURRENT_USER\\Software\\Microsoft\\Command Processor\\AutoRun
命令扩展是按默认值启用的。您也可以使用 /E:OFF,为某一
特定调用而停用扩展。您可以在机器上和/或用户登录会话上
启用或停用 CMD.EXE 所有调用的扩展,这要通过设置使用
REGEDT32.EXE 的注册表中的一个或两个 REG_DWORD 值:
HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Command Processor\\EnableExtensions
和/或
HKEY_CURRENT_USER\\Software\\Microsoft\\Command Processor\\EnableExtensions
到 0x1 或 0x0。 用户特定设置比机器设置有优先权。命令行
命令选项比注册表设置有优先权。
命令行扩展包括对下列命令所做的更改和/或添加:
DEL 或 ERASE
COLOR
CD 或 CHDIR
MD 或 MKDIR
PROMPT
PUSHD
POPD
SET
SETLOCAL
ENDLOCAL
IF
FOR
CALL
SHIFT
GOTO
START (同时包括对外部命令调用所做的更改)
ASSOC
FTYPE
有关详细信息,请键入 HELP 命令名。
延迟变量环境扩展不按默认值启用。您可以用/V:ON或 /V:OFF
命令选项,为 CMD.EXE 的某个调用而启用或停用延迟环境变量扩充。
您可以在机器上和/或用户登录会话上启用或停用 CMD.EXE 所有
调用的完成,这要通过设置使用 REGEDT32.EXE 的注册表中的
一个或两个 REG_DWORD 值:
HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Command Processor\\DelayedExpansion
和/或
HKEY_CURRENT_USER\\Software\\Microsoft\\Command Processor\\DelayedExpansion
到 0x1 或 0x0。 用户特定设置比机器设置有优先权。命令行命令选项
比注册表设置有优先权。
如果延迟环境变量扩充被启用,惊叹号字符可在执行时间,被用来
代替一个环境变量的数值。
文件和目录名完成不按默认值启用。您可以用 /F:ON 或 /F:OFF
命令选项,为 CMD.EXE 的某个调用而启用或停用文件名完成。 您可以
在机器上和/或用户登录会话上启用或停用 CMD.EXE 所有调用的
完成,这要通过设置使用 REGEDT32.EXE 的注册表中的一个或两个
REG_DWORD 值:
HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Command Processor\\CompletionChar
HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Command Processor\\PathCompletionChar
和/或
HKEY_CURRENT_USER\\Software\\Microsoft\\Command Processor\\CompletionChar
HKEY_CURRENT_USER\\Software\\Microsoft\\Command Processor\\PathCompletionChar
由一个控制字符的十六进制值作为一个特定参数(例如,0x4 是
Ctrl-D,0x6 是 Ctrl-F)。 用户特定设置优先于机器设置。命令行
命令选项优先于注册表设置。
如果完成是用 /F:ON 命令选项启用的,两个要使用的控制符是: 目录名
字完成用 Ctrl-D, 文件名完成用 Ctrl-F。 要停用注册表中的某个
字符,请用空格 (0x20) 的数值,因为此字符不是控制字符。
如果键入两个控制字符中的一个,完成会被调用。完成功能将
路径字符长带到光标的左边,如果没有通配符,将通配符附加
到左边,并建立相符的路径列表。然后,显示第一个相符的路
径。如果没有相符的路径,则发出嘟嘟声,不影响显示。之后,
重复按同一个控制字符会循环显示相符路径的列表。将 Shift 键
跟控制字符同时按下,会倒着显示列表。如果对该行进行了任
何编辑,并再次按下控制字符,保存的相符路径的列表会被丢弃,
新的会被生成。如果在文件和目录名完成之间命令选项,会发生
同样现象。两个控制字符之间的唯一区别是文件完成字符符合
文件和目录名,而目录完成字符只符合目录名。如果文件完成
被用于内置式目录命令(CD, MD 或 RD),就会使用目录完成。
将引号将相符路径括起来,完成代码可以正确处理含有空格
或其它特殊字符的文件名。同时,如果备份,然后从行内调用
文件完成,完成被调用是位于光标右方的文字会被丢弃。
C:\\>
#################################################################################################
|