CMD批处理笔记

1.cmd查看及打开类命令

systeminfo   //查看系统配置

dxdiag    //查看硬件信息,检查DirectX信息

start msinfo32  //查看全部硬件信息

wmic memorychip list brief  //查看物理内存条数量

slmgr.vbs -xpr   //查看系统是否激活

slmgr.vbs -dli   //查看激活信息

slmgr.vbs -dlv    //查看详细激活信息

regedit    //进入注册表

regedt32    //进入注册表

gpedit.msc    //组策略

explorer    //打开资源管理器

logoff    //注销命令

lusrmgr.msc   //本机用户和组

services.msc   //本地服务设置

notepad    //打开记事本

compmgmt.msc      //计算机管理

dvdplay      //DVD播放器

charmap     //启动字符映射表

diskmgmt.msc     //磁盘管理实用程序

calc      //启动计算器

devmgmt.msc     // 设备管理器

rsop.msc    //组策略结果集

perfmon.msc    //计算机性能监测程序

winver     //检查Windows版本

taskmgr     //任务管理器

wmimgmt.msc     //打开windows管理体系结构(WMI)

wscript     //windows脚本宿主设置

write       //写字板

wiaacmgr   //扫描仪和照片

mspaint     //画图板   

mstsc      //远程桌面连接

magnify     //放大镜实用程序

mmc       //打开控制台

mobsync     //同步命令

dcomcnfg     //打开系统组件服务

narrator      //屏幕“讲述人”

netstat -an     //查看所有网络连接及端口

sigverif       //文件签名验证程序

shrpubw      //创建共享文件夹

secpol.msc      //本地安全策略

syskey      //系统加密,一旦加密就不能解开

eventvwr     //事件查看器

eudcedit     //造字程序

certmgr.msc     //证书管理实用程序

cliconfg       //SQL SERVER 客户端网络实用程序

cleanmgr      //垃圾整理

osk      //打开屏幕键盘

odbcad32      //ODBC数据源管理器

iexpress      //木马捆绑工具,系统自带软件打包工具

fsmgmt.msc     //共享文件夹管理器

utilman     //辅助工具管理器

time    //显示或设置时间

date    //显示或设置日期

ver    //查看dos版本

2.CMD入门教程

1.time              //显示时间或修改时间

2.date              //显示日期或修改日期

3.dir              //显示当前目录下的目录和文件
例:  dir /p     //分页显示
      dir /w     //简要显示
      dir abc    //查看当前目录下,abc目录中的内容
      dir /p  c:\Windows\System32\*.exe   //以分页形式,查找某个路径下的文件类型
      dir c:    //查看C盘下的内容

4.format           //格式化某个盘符命令
例:format d: /d      //快速格式化D盘
    format /u d:      //格式化D盘,无法恢复

5.cd            //改变当前目录
例: cd ..     //返回上一级
     cd \     //返回根目录
     cd  abc   //进入目录abc,如果有这个目录的话
     cd  d:\abc\123   //进入D盘目录abc下的123目录中
     d:     //进入D盘
     d:\abc\123\44.txt   //在其他目录下,直接输入绝对路径打开文档

6.md        //创建目录
例: md abc  //在当前目录下,创建一个abc的目录
     md d:\aaa\bbb\ccc\ddd   //在D盘创建这些目录 


7.rd     //删除目录
例:  rd abc   //在当前目录下,删除abc空目录
      rd /s /q d:\aaa\bbb\ccc    //强制安静删除ccc这个目录

8.copy    //复制文件
例: copy 123.txt 123.bat  //在当前目录下,复制123.txt并重命名为123.bat
     d:\>copy d:\aaa\bbb\*.txt c:\   //以绝对路径复制文件

9.del   //删除文件
例: del 111.txt   //在当前目录下,删除文件
     del /f /s /q *.*   //强制删除目录下包含子目录的所有文件(谨慎使用)

10.ren   //重命名文件
例: ren aaa bbb    //重命名目录
     ren 111.txt 222.bat    //重命名文件

11.type    //显示文档里的内容
例:type 111.txt   //显示文档里面的内容

12.chkdsk   //磁盘检查
例: chkdsk /f d:     //扫描修复D盘
     chkdsk /r d:     //全面扫描修复D盘

13.path   //定义某个目录,在任何目录下,直接执行程序(必须是程序,文档类不行)
例: path=d:\;d:\aaa;c:\windows;    //多个目录,中间用分号隔开,定义后,可直接输入该目录下的程序,执行

14.cls   //清理屏幕的内容

15.move   //移动文件
例:move d:\aaa\111.txt e:\bbb    //移动文件

16.more   //分页显示
例:dir /?|more      //查看dir命令帮助时以分页显示
    type 111.txt|more    //以分页显示该文档

17.xcopy   //复制目录
例:xcopy /e d:\itctools e:\gongju   //复制itctools目录里面的内容,到e盘gongju目录里(需提前在E盘创建该目录)
    xcopy /s "\\192.168.80.20\aaa" "d:\chb"    //复制共享文件到本地

18.help   //帮助命令
例: help |more   //以分页显示当前可用命令
     cd /?      //查看CD命令的用法

19.attrib   //设置文件属性
例: attrib +h d:\itctools\PE工具箱.rar  //隐藏该文件
     attrib +h d:\itctools\kms激活     //隐藏该文件夹

20.defrag   //磁盘碎片整理
例: defrag c: /u /v   //整理C盘并显示其整理进度

21.doskey   //宏命令
例:doskey aa=md aa $T md 22  //定义宏aa输入aa等于输入后面的命令

22.prompt  //修改命令提示符
例:  prompt $t   //修改命令提示符为当前时间
      prompt $p$f   //恢复成默认提示符

23.set   //设置环境变量
例: set path=Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32
\WindowsPowerShell\v1.0\;d:\itctools;    //设置Path环境变量,只在本CMD窗口生效

24.fc   //比较文件不同
例: fc d:\1.txt d:\2.txt   //查看两个文件的不同处

25.subst   //创建虚拟磁盘
例:subst h: d:\itctools   //H盘为虚拟磁盘,d:\itctools为虚拟磁盘的路径
    subst h: /d       //删除虚拟磁盘H盘

26.tree   //显示目录的结构树
例: tree /f aaa   //查看aaa这个目录里面的目录结构树,包括文件

27.ver   //查看DOS版本

28.vol    //查看分区卷标
例:vol d:  //查看D盘卷标


               批处理命令
29.echo     //显示命令后面的内容

30.echo off   //不显示命令后面的内容

31.@       //隐藏命令本身

32.call    //调用另一个批处理

33.pause   //暂停

34.rem    //此命令后面的内容为注释,不执行

35.if    //条件判断命令
例: if "参数"=="字符串"  待执行命令
     if exist 文件名  待执行命令
     if errorlevel 数字  待执行命令

36.goto   //跳转命令
例: goto end
     :end 
     echo this is end

37.choice   //通过这个命令,让用户做出选择,从而执行不同的命令
例:choice /c ync /M "确认请按Y,否则请按N,取消请按C"

38.for   //循环命令

39. ::注释内容    //添加注释

3.ftp命令详解

· ! - 执行本地命令
· ? - 显示FTP命令的说明
· append - 向远程服务器追加本地文件
· ascii - 设置文件传输类型为ASCII,默认类型
· bell - 每一个传输命令完成触发一次响铃(默认关闭)
· binary - 设置文件传输类型为binary(二进制传输)
· bye - 结束FTP会话并退出
· cd - 改变远程工作目录
· close - 结束FTP会话并返回命令行
· debug - 开关调试(默认关闭)
· delete - 删除远程单个文件
· dir - 显示远程目录文件盒子目录列表
· disconnect - 从远程断开,重新获得FTP提示框
· get - 复制单个远程文件到本地
· glob - 开关文件名通配符(默认ON)
· hash - Toggles hash-sign (#) printing for each data block transferred (default = OFF) 为每个缓冲区传输切换打印“#”(哈希标记打印)
· help - 显示FTP命令帮助信息(用法通”?“)
· lcd - 改变本地工作目录
· literal - Sends arguments, verbatim, to the remote FTP server 向远程FTP服务器逐字发送参数(发送任意 ftp 命令)
· ls - 显示远程目录文件和子目录的简短列表(只有文件名和目录名)
· mdelete - 删除远程一个或多个文件
· mdir - 列出多个远程目录的内容
· mget - 复制一个或多个远程文件至本地
· mkdir - 创建一个远程目录
· mls - 列出多个远程目录的内容
· mput - 复制一个或多个本地文件到远程
· open - 连接到指定的FTP服务器
· prompt - 开关交互提示(默认为ON)
· put - 复制一个本地文件到远程
· pwd - 显示远程当前工作目录(字面意思:打印工作目录)
· quit - 结束FTP会话并退出FTP(功能通bye)
· quote - Sends arguments, verbatim, to the remote FTP server (same as “literal”) 发送任意 ftp 命令??
· recv - 复制远程文件到本地
· remotehelp - 显示远程命令帮助
· rename - 重命名远程文件
· rmdir - 删除远程目录
· send - 复制一个本地文件到远程(功能通put)
· status - 显示当前FTP连接状态
· trace - 开关数据包追踪(默认为OFF)
· type - 设置文件传输类型(默认为ASCII)
· user - 发送新用户信息
· verbose - 开关详细模式

4.cmd命令实例应用

常用示例

rd /s c:\$Recycle.Bin   //清空回收站

powercfg -h off    //关闭系统休眠功能

cd.>d:\chb\abc\test.txt  //在指定路径新建文档

cd.>a.txt    //在当前路径新建文档

rename d:\system\新建文件夹 电影   //重命名文件夹

rename d:\system\新建文本文档.txt mspaint.bat      //重命名文件

rename 123.txt 456.txt  //在当前目录下,重命名123.txt为456.txt

dir d:\报表*.xls /s   //查找D盘中报表开头的电子表格

shutdown /s /t 180    //系统180秒后关机

shutdown /r /t 0     //系统立刻重启

shutdown /m \\192.168.80.128 /s /t 20   //远程关机命令

netsh winsock reset  //重置Winsock目录借以恢复网络

netsh interface ip reset resetlog.txt  //重置TCP/IP协议

sfc /verifyonly     //扫描系统文件完整性,不修复

sfc /scannow        //扫描系统文件完整性,并修复

chkdsk /f d:     //扫描修复D盘

chkdsk /r d:     //全面扫描修复D盘

bcdboot C:\Windows /l zh-cn   //BIOS+MBR修复系统引导

bcdboot C:\Windows  /s H: /f uefi /l zh-cn     //UEFI+GPT修复系统引导,H为ESP分区盘符

bcdboot c:\windows /f all /s h: /l zh-cn    //修复系统引导,H为ESP分区盘符

control userpasswords2    //设置密码,权限更大,还可以设置自动登录

convert c: /fs:ntfs    //转换C盘为NTFS

convert c: /fs:fat32   //转换C盘为FAT32

nslookup www.163.com   //测试DNS是否工作正常,查看www.163.com对应的IP地址

msconfig   //系统配置实用程序,引导,启动项

ipconfig /all    //查看所有网卡的详细信息

netstat -a       //查看本地侦听的端口

ipconfig /flushdns    清理DNS缓存

telnet 192.168.0.1 21  //telnet该地址的21端口,是否打开

net user      //查看本机用户

net user chb 123 /add      //建立一个用户名为chb,密码为123

net user chb /del               //删除一个用户名为chb

net localgroup administrators chb /add          //把用户chb添加到管理员

net localgroup administrators chb /del             //把用户从管理员组删除

for /r c:\ %a in (*.doc) do @echo %a       //在C盘中查找*.doc文档

for /r c:\ %a in (*.xls,*.doc) do @echo %a    //在C盘中查找*.doc和*.xls文件

for /r c:\ %a in (*准入*) do @echo %a       //在C盘中查找含有"准入"的文件

find "张三" test.txt

findstr /r "张三 李四" test.txt   //查找包含“黄小奖”和“张欢”的行

netsh设置IP

netsh interface ip set address "本地连接" static 192.168.10.21 255.255.255.0 192.168.10.1  //配置IP地址,"本地连接"是网卡的名称,可以ipconfig命令查看

netsh interface ip set dns "本地连接" static 114.114.114.114    //配置主DNS地址

netsh interface ip add dns "本地连接" 114.114.114.114  //配置备用DNS地址,注意没有static参数

netsh interface ip set address name="本地连接" source=dhcp  	//配置IP自动获取
netsh interface ip set dns name="本地连接" source=dhcp       //配置DNS自动获取

netsh interface set interface "无线网络连接" disabled     //禁用无线网卡
netsh interface set interface "无线网络连接" enabled      //启用无线网卡

SC设置服务的启用停用

netsh firewall set opmode disable   //关闭windows防火墙(旧命令)
netsh firewall set opmode enable    //开启windows防火墙(旧命令)

netsh advfirewall set allprofiles state off  //关闭windows防火墙(新命令)
netsh advfirewall set allprofiles state on   //开启windows防火墙(新命令)
netsh advfirewall show allprofiles    //查看windows防火墙是否开启

sc config mpssvc start= disabled     //配置mpssvc服务,启动方式为禁用(等号后面必须空格)
sc config mpssvc start= demand      //配置mpssvc服务,启动方式为手动(等号后面必须空格)
sc config mpssvc start= auto       //配置mpssvc服务,启动方式为自动(等号后面必须空格)
sc stop mpssvc          //停止mpssvc服务
sc start mpssvc         //启用mpssvc服务
sc qc mpssvc          //查看mpssvc服务,启动方式
sc query mpssvc       //查看mpssvc服务是否启用

netsh创建虚拟无线网卡

netsh wlan show drivers   //查看无线网卡是否支持承载网络,如果是则可以执行以下命令
netsh wlan set hostednetwork mode=allow ssid=wifi key=12345678  //开启承载网络模块
netsh wlan start hostednetwork   //开启虚拟无线网卡

netsh wlan stop hostednetwork   //关闭虚拟无线网卡
netsh wlan set hostednetwork mode=disallow   //关闭承载网络模块

ftp命令登录示例

ftp    //打开ftp命令

open 10.249.221.61  //连接该地址

open 10.249.221.61 2121  //连接该地址,后面加上端口号2121

anonymous   //匿名登录的用户名

123@163.com   //匿名登录的密码,随便输入一个邮箱格式即可

prompt off   //关闭交互模式(强烈建议关闭)

prompt on    //开启交互模式

dir    //查看ftp里面的内容

cd aaa   //改变远程ftp目录

pwd      //查看远程所在目录

lcd D:\desktop  //更改本地目录,默认是在C盘的用户目录下

get 123.txt   //下载该文件,保存在C盘的用户目录下

mget *.txt    //下载多个文件

put 123.txt     //上传文件,必须是在本地目录中有

mput *.*        //上传多个文件

delete 123.txt  //删除FTP中的文件,必须有权限

mdelete *.*     //删除多个文件

mkdir aaa     //在ftp上创建文件夹

rmdir aaa    //删除ftp上的文件夹

bye       //退出ftp会话

reg修改导入注册表

reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server"   //查看注册表项的内容

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v AllowRemoteRPC /t REG_DWORD /d 0x1 /f    //修改注册表数值

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v baidujingyan /t REG_DWORD /d 0x1 /f     //添加注册表值(和上一条命令完全一样,如果值名称存在则修改,否则就是添加)

reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v baidujingyan /f     //删除注册表值名称

reg export "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" d:\aaa.reg      //备份注册表项

reg import d:\aaa.reg       //还原注册表项

regedit /s aaa.reg     //执行注册表文件,功能同上

msg给局域网的其他主机发送消息

msg /server:127.0.0.1 * "你好,朋友 "    //win7局域网发送信息,自己发给自己信息
CMD内regedit修改注册表HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server内的AllowRemoteRPC的值修改为1 (默认为0)
控制面板---用户帐户和家庭安全---凭据管理器,点击添加windows凭据,第一行写远程电脑的IP地址,第二行写远程电脑的用户名,第三行写测试电脑的密码,重启电脑(空密码需设置:cmd命令gpedit.msc ,计算机配置--windows设置--安全设置--本地策略--安全选项--帐户: 使用空密码的本地帐户只允许进行控制台登录(禁用))
msg /server:192.168.80.20 * "你好,朋友 "    //发个局域网电脑信息

secedit导出导入组策略

secedit /export /cfg d:\setup.inf     //导出组策略配置,只能在本机使用
 
secedit /configure /db temp.sdb /cfg d:\setup.inf    //导入组策略配置,(经测试导入不完全,自己看着用吧),会在当前目录下生成temp.sdb文件,执行完可以删除

取消打印任务

c:\Windows\System32\Printing_Admin_Scripts\zh-CN>cscript prnjobs.vbs -l     //列出所有打印作业,必须在这个目录下使用命令

cscript prnjobs.vbs -l -p "Panasonic DP-8016P Ver. 2"    //列出该打印机的打印作业,-p后面输入打印机名

cscript prnjobs.vbs -p <printer name>  -j  <job id> -x   //取消打印任务,-j后面输入打印任务ID

C:\Windows\System32\spool\PRINTERS>del *.*   //删除该目录下的所有文件,即可取消所有打印任务

使用telnet登录windows

控制面板\程序\程序和功能\打开或关闭windows功能
勾选 telnet 服务器
勾选 telnet 客户端
cmd命令 services.msc ,启用Telnet服务
右键计算机--管理--本地用户和组
选择用户,将TelnetClients组添加到用户

telnet 127.0.0.1            //在受访问的电脑上测试telnet服务是否可用
telnet 192.168.80.128 23    //telnet连接远程电脑,按N后,输入用户名,密码,telnet登录后输入help | more 查看能用的命令

cacls文件权限设置

cacls d:\aaa    //查看该文件夹的本地权限
cacls d:\aaa /t /p everyone:n     //设置该文件夹所有人都拒绝访问
cacls d:\aaa /t /p everyone:f    //设置该文件夹所有人拥有全部权限
cacls d:\bbb\*.txt /p chb:n      //设置用户chb无法访问该文件夹下的txt文件
cacls d:\*.exe /t /p everyone:r   //设置D盘的所有exe文件包含子目录,为只读,防止病毒感染

绑定静态ARP

netsh i i show in      //查看本地连接的idx值
netsh -c "i i" add neighbors 12 192.168.80.1 00-50-56-c0-00-09    //12是Idx值,arp静态IP与MAC地址永久绑定,重启不丢失
netsh -c "i i" delete neighbors 12     //删除ARP静态绑定,12是Idx值

5.windows环境变量介绍

首先明确一点:

所有的在cmd命令行下对环境变量的修改只对当前窗口有效,不是永久性的修改。也就是说当关闭此cmd命令行窗口后,将不再起作用。永久性修改环境变量的方法有两种:一种是直接修改注册表(此种方法目前没试验过),另一种是通过我的电脑-〉属性-〉高级,来设置系统的环境变量(查看详细)。

其次,明确一下环境变量的作用。

它是操作系统用来指定运行环境的一些参数。比如临时文件夹位置和系统文件夹位置等。当你运行某些程序时,除了在当前文件夹中寻找外,还会到这些环境变量中去查找,比如“Path”就是一个变量,里面存储了一些常用的命令所存放的目录路径。

第三:什么情况下进行设置?

当启动cmd命令行窗口调用某一命令的时候,经常会出现“xxx不是内部或外部命令,也不是可运行的程序或批处理文件”,如果你的拼写没有错误,同时计算机中确实存在这个程序,那么出现这个提示就是你的path变量没有设置正确,因为你的path路径,也就是默认路径里没有你的程序,同时你有没有给出你程序的绝对路径(因为你只是输入了命令或程序的名称而已),这是操作系统不知道去哪儿找你的程序,就会提示这个问题。

第四:如何修改?

1、查看当前所有可用的环境变量:输入 set 即可查看。

2、查看某个环境变量:输入 “set 变量名”即可,比如想查看path变量的值,即输入 set path

3、修改环境变量 :输入 “set 变量名=变量内容”即可,比如将path设置为“d:\nmake.exe”,只要输入set path=“d:\nmake.exe”。注意,此修改环境变量是指用现在的内容去覆盖以前的内容,并不是追加。比如当我设置了上面的path路径之后,如果我再重新输入set path=“c”,再次查看path路径的时候,其值为“c:”,而不是“d:\nmake.exe”;“c”。

4、设置为空:如果想将某一变量设置为空,输入“set 变量名=”即可。如“set path=” 那么查看path的时候就为空。注意,上面已经说了,只在当前命令行窗口起作用。因此查看path的时候不要去右击“我的电脑”——“属性”…

5、给变量追加内容(不同于3,那个是覆盖):输入“set 变量名=%变量名%;变量内容”。如,为path添加一个新的路径,输入“ set path=%path%;d:\nmake.exe”即可将d:\nmake.exe添加到path中,再次执行"set path=%path%;c:",那么,使用set path语句来查看的时候,将会有:d:\nmake.exe;c:,而不是像第3步中的只有c:。

附录:下面贴上一些常用的环境变量及作用

%ALLUSERSPROFILE% 局部 返回所有“用户配置文件”的位置。

%APPDATA% 局部 返回默认情况下应用程序存储数据的位置。

%CD% 局部 返回当前目录字符串。

%CMDCMDLINE% 局部 返回用来启动当前的 Cmd.exe 的准确命令行。

%CMDEXTVERSION% 系统 返回当前的“命令处理程序扩展”的版本号。

%COMPUTERNAME% 系统 返回计算机的名称。

%COMSPEC% 系统 返回命令行解释器可执行程序的准确路径。

%DATE% 系统 返回当前日期。使用与 date /t 命令相同的格式。由 Cmd.exe 生成。有关 date 命令的详细信息,请参阅 Date。

%ERRORLEVEL% 系统 返回最近使用过的命令的错误代码。通常用非零值表示错误。

%HOMEDRIVE% 系统 返回连接到用户主目录的本地工作站驱动器号。基于主目录值的设置。用户主目录是在“本地用户和组”中指定的。

%HOMEPATH% 系统 返回用户主目录的完整路径。基于主目录值的设置。用户主目录是在“本地用户和组”中指定的。

%HOMESHARE% 系统 返回用户的共享主目录的网络路径。基于主目录值的设置。用户主目录是在“本地用户和组”中指定的。

%LOGONSEVER% 局部 返回验证当前登录会话的域控制器的名称。

%NUMBER_OF_PROCESSORS% 系统 指定安装在计算机上的处理器的数目。

%OS% 系统 返回操作系统的名称。Windows 2000 将操作系统显示为 Windows_NT。

%PATH% 系统 指定可执行文件的搜索路径。

%PATHEXT% 系统 返回操作系统认为可执行的文件扩展名的列表。

%PROCESSOR_ARCHITECTURE% 系统 返回处理器的芯片体系结构。值: x86,IA64。
  %PROCESSOR_IDENTFIER% 系统 返回处理器说明。

%PROCESSOR_LEVEL% 系统 返回计算机上安装的处理器的型号。

%PROCESSOR_REVISION% 系统 返回处理器修订号的系统变量。

%PROMPT% 局部 返回当前解释程序的命令提示符设置。由 Cmd.exe 生成。

%RANDOM% 系统 返回 0 到 32767 之间的任意十进制数字。由 Cmd.exe 生成。

%SYSTEMDRIVE% 系统 返回包含 Windows XP 根目录(即系统根目录)的驱动器。

%SYSTEMROOT% 系统 返回 Windows XP 根目录的位置。

%TEMP% and %TMP% 系统和用户 返回对当前登录用户可用的应用程序所使用的默认临时目录。有些应用程序需要 TEMP,而其它应用程序则需要 TMP。

%TIME% 系统 返回当前时间。使用与 time /t 命令相同的格式。由 Cmd.exe 生成。有关 time 命令的详细信息,请参阅 Time。

%USERDOMAIN% 局部 返回包含用户帐户的域的名称。

%USERNAME% 局部 返回当前登录的用户的名称。

%UserProfile% 局部 返回当前用户的配置文件的位置。

%WINDIR% 系统 返回操作系统目录的位置。

6.最常用cmd命令用法

ping命令示例

ping   //测试网络连通性命令
ping -t www.baidu.com    //长ping某个地址,按ctrl+C中断
ping -a 192.168.10.3     //将地址解析成主机名
ping -n 6 www.baidu.com   //ping 6个数据包
ping -l 128 www.baidu.com  //每次发包的大小是128字节
ping -S 192.168.10.20 192.168.10.1  //指定源地址,注意参数S是大写

nbtstat查看计算机名

nbtstat  //查询同一个网段中计算机名和MAC地址
nbtstat -a zhitdw1   //根据计算机名查询MAC地址
nbtstat -A 10.249.221.64   //根据IP地址查询MAC地址
nbtstat -c    // 查看其他电脑的计算机名和IP地址,查询过才有缓存
nbtstat -n   //查看本机计算机名
nbtstat -R   //清理NetBios缓存

netstat查看端口信息

netstat -a     //查看本地侦听的端口
netstat -a -b    //查看本地侦听的端口和对应的程序
netstat -r       //查看本地路由表
netstat -n       //查看已建立的有效连接
netstat -o      //查看对应的pid进程号

wmic根据pid查看进程的路径

netstat -abno         //最后一列的数字表示pid
wmic process where processid=2848 get processid,executablepath,name     //2848是pid号,根据实际情况更改

tracert跟踪路由信息

tracert   //查看到达目标地址经过的路由器
tracert 10.249.195.100   //跟踪该地址经过的路由器
tracert -h 80 10.249.195.100  //设置最大跃点数为80

net查看添加删除用户

net   
net view \\zhchenhongbo1   //通过计算机名,查看目标主机的共享资源
net view /domain:ghj       //查看ghj域中计算机列表

net user      //查看本机用户
net user chb 123 /add      //建立一个用户名为chb,密码为123
net user chb                  //查看用户信息
net user chb /del               //删除一个用户名为chb

net localgroup administrators chb /add          //把用户chb添加到管理员
net localgroup administrators chb /del             //把用户从管理员组删除


net use    //查看网络映射列表
net use z: \\zhchenhongbo1\ftp      //创建网络映射盘,盘符Z:
net use z:  \\zhchenhongbo1\ftp password /user:administrator    //password是密码,administrator是用户名
net use z: /delete                  //删除网络映射盘,盘符Z:
net use \\10.249.221.64\ipc$ passwork /user:administrator    //创建网络映射连接,ipc$表示空连接
net use \\10.249.221.64\ipc$ /delete          //删除网络映射连接

net time \\127.0.0.1     //获取本地的时间
net use \\10.249.221.64\ipc$ password /user:administrator   //需先创建网络映射连接,才能执行下面命令
net time \\10.249.221.64     //获取其他服务器的时间
net time \\10.249.221.64 /set    //同步远程服务器的时间

net start    //查看已启动的服务列表
net stop mpssvc    //关闭防火墙服务,注意查看的是显示名称Windows Firewall,mpssvc是服务名
net start mpssvc   //启用防火墙服务

net statistics server    //查看服务器服务的统计记录(这两个命令,不知道有啥实际用途)
net statistics workstation   //查看本地工作站的统计记录

net share     //查看本机共享资源
net share desktop=d:\desktop /remark:"这是注解内容"    //添加共享资源,desktop是共享名
net share desktop /delete        //删除共享资源

net session      //查看会话列表 (暂时没发现这个命令有什么用)
net session /delete    //删除所有会话列表

at查看及删除计划

at                   //查看计划列表
at 15:44 shutdown /s /t 10    //15:44这个时间,关机延迟10秒
at 15:51 msg /server:127.0.0.1 * "你好,下班了!"      //定时提醒
at 16:40 d:\abc\123.bat         //定时执行批处理
at 1 /delete      //删除指定ID的计划
at /delete        //删除所有计划

ftp命令登录操作示例

ftp    //打开ftp命令

open 10.249.221.61  //连接该地址

open 10.249.221.61 2121  //连接该地址,后面加上端口号2121

anonymous   //匿名登录的用户名

123@163.com   //匿名登录的密码,随便输入一个邮箱格式即可

prompt off   //关闭交互模式(强烈建议关闭)

prompt on    //开启交互模式

dir    //查看ftp里面的内容

cd aaa   //改变远程ftp目录

pwd      //查看远程所在目录

lcd D:\desktop  //更改本地目录,默认是在C盘的用户目录下

get 123.txt   //下载该文件,保存在C盘的用户目录下

mget *.txt    //下载多个文件

put 123.txt     //上传文件,必须是在本地目录中有

mput *.*        //上传多个文件

delete 123.txt  //删除FTP中的文件,必须有权限

mdelete *.*     //删除多个文件

mkdir aaa     //在ftp上创建文件夹

rmdir aaa    //删除ftp上的文件夹

bye       //退出ftp会话

telnet访问windows主机

控制面板\程序\程序和功能\打开或关闭windows功能
勾选 telnet 服务器
勾选 telnet 客户端
cmd命令 services.msc ,启用Telnet服务
右键计算机--管理--本地用户和组
选择用户,将TelnetClients组添加到用户

telnet 127.0.0.1            //在受访问的电脑上测试telnet服务是否可用
telnet 192.168.80.128 23    //telnet连接远程电脑,按N后,输入用户名,密码,telnet登录后输入help | more 查看能用的命令

arp查看及清除缓存

arp -a     //查看所有接口的arp缓存表
arp -d     //清除ARP缓存

route路由表设置

route print   //查看本机路由表
route print 0.*    //查看0开头的路由表,也就是默认路由
route add 0.0.0.0 mask 0.0.0.0 192.168.12.1    //添加默认路由,也就是设置网关
route -p add 10.41.0.0 mask 255.255.0.0 10.27.0.1   //-p的意思是添加永久路由,重启不丢失
route -p add 10.41.0.0 mask 255.255.0.0 10.27.0.1 metric 10   //metric 后面的10代表跃点数
route -p add 10.41.0.0 mask 255.255.0.0 10.27.0.1 metric 10 if 12    //if后面的12是接口编号,通过route print查看
route delete 10.41.0.0 mask 255.255.0.0    //删除路由表
route delete 10.*     //删除所有10开头的路由表

nslookup查看DNS解析

nslookup auth.zh.gmcc.net   //查看DNS服务器,以及DNS解析到的IP地址
nslookup 10.249.250.134     //查看DNS服务器是否能反向解析,即通过IP地址,反向解析成网址
nslookup -qt=a www.163.com 211.136.192.6   //查看指定211.136.192.6这个DNS服务器来解析www.163.com的情况

7.windows用自带命令分区

-------------------------------MBR分区表---------------------------------------------

1.用安装版安装windows server 2008到了安装界面,
在"您想将WIndows安装在何处?"按Shift + F10打开命令提示符.

2.输入"Diskpart"

3.输入"list disk",查看磁盘信息.

4.输入:”select disk 0”,选择disk 0为当前操作的磁盘.不一定是0,具体看磁盘信息显示的数字.

5.输入:”Clean”,清空当前磁盘分区。

6.输入:”convert mbr”,转换为MBR分区。

7.输入:“Create partition primary size=102400”,其中create partition 表示创建分区。
primary表示创建是主分区。如果这个位置是logical:表示逻辑分区,extended:表示扩展分区。size:表示分区大小,单位M

8.使用“Active”把主分区激活,并格式化。为什么要激活?因为,激活后分区信息和唯一的活动分区标记会写入硬盘分区表,
这样当启动电脑时BIOS会检测主分区的操作系统(io.sys文件),然后操作系统开始控制启动权。

9.输入:“Create partition extended”,这句话是把剩下的容量全部划分成扩展分区,不指定大小就是剩下全部容量的意思.

10.输入:"List partition "查看已经创建好的分区!

11.输入:“Create partition logical size=30720”,创建第一个逻辑分区.

12.输入:“Create partition logical”,创建第二个逻辑分区,大小为剩下的全部容量.

13.退出命令提示符,点击"刷新",OK了.

---------------------------------GPT分区表-----------------------------------------

1.执行上面1到5的命令.

2.输入:“convert gpt”,转换为gpt分区.

3.create partition efi size=100–创建EFI分区,大小为100M

4.create partition msr size=128–创建MSR分区,微软默认大小是128M

5.create partition primary size=50000–创建主分区,这里要注意数字按M计算,50000就是分区大小为50000M,可以根据自己实际情况调整,该分区用来安装系统

6.list partition-----------------列出磁盘上的分区

7.退出命令提示符界面,返回安装界面.

8.批处理示例

打开关闭防火墙

#关闭防火墙
netsh advfirewall set allprofiles state off 

#开启防火墙
netsh advfirewall set allprofiles state on

打开关闭网卡

#关闭名称为“本地连接”的网卡,这个名称可以修改自定义的
netsh interface set interface "本地连接" disabled

#关闭“无线网络连接”网卡
netsh interface set interface "无线网络连接" disabled

#开启“本地连接”网卡
netsh interface set interface "本地连接" enabled 

#开启“无线网络连接”网卡
netsh interface set interface "无线网络连接" enabled

计算机网卡信息收集并上传ftp

@echo off
for /f "tokens=2 delims=:" %%i in ('ipconfig /all ^| findstr /i /c:"IPv4 地址"') do set ip=%%i
set Nip=%ip:~1,14%
@echo off
for /f "tokens=2 delims=:" %%i in ('ipconfig /all ^| findstr /i /c:"主机名"') do set Hostname=%%i
set Name=%Hostname:~1,20%
@echo off
echo 本机网络设置信息 >c:\电脑信息统计.txt

echo 计算机名:%Name% >>c:\电脑信息统计.txt
echo   IP地址:%Nip% >>c:\电脑信息统计.txt
@echo off
title 计算机mac地址统计
color 0A
%net config workstation%
md c:
@echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
@echo ※                                                                          ※
@echo ※                         本机的信息如下                                   ※
@echo ※                                                                          ※
@echo 本机当前IP地址             [%Nip%]
@echo 本机当前计算机名           [ %Name%] 
setlocal enabledelayedexpansion
@echo off
for /f  "tokens=1,3 delims=,"   %%i in ('getmac /v /nh /fo:csv ^| findstr ..-..-..-..-..-..') do (
    echo %%i %%j >>c:\电脑信息统计.txt
)

#@echo off
#set ftpfile=putfiles.ftp
#set logfile=putfiles.log
#echo open 10.249.195.100 > "%ftpfile%"
#rem 把下面行中的 username和password改为你的用户名和密码
#echo user mac mac >> "%ftpfile%"
#rem ------------------------------
#echo bin >> "%ftpfile%"
#rem 进入FTP server 中的"dmfgs"目录
#echo cd dmfgs >> "%ftpfile%" //如果服务器已经对ftp上传文件进行了配置rem echo cd dmfgs >> "%ftpfile%" 注释该行
#rem ------------------------------
#rem 进入本地C盘根目录
#echo lcd c:\ >> "%ftpfile%"
#rem ------------------------------
#echo put %Name%.txt >> "%ftpfile%"
#echo quit >> "%ftpfile%"
#echo -------------------------------- >> "%logfile%"
#date /t >> "%logfile%"
#time /t >> "%logfile%"
#echo -------------------------------- >> "%logfile%"
#ftp -n < "%ftpfile%" >> "%logfile%"
#del "%ftpfile%"
#del "%logfile%"
#@echo on
rem -----------脚本结束---------------

@echo off

关闭IE安全检查

echo Windows Registry Editor Version 5.00 >1.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Security] >>1.reg
echo "DisableSecuritySettingsCheck"=dword:00000001 >>1.reg
reg import 1.reg
del 1.reg
pause

将本机作为NTP服务器

Windows Registry Editor Version 5.00

#设置"Enabled"值为1,默认0
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\TimeProviders\NtpServer]
"Enabled"=dword:00000001

#设置"AnnounceFlags"值为5,默认10
#设置"LocalClockDispersion"值为0,默认0x0000000a
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\Config]
"AnnounceFlags"=dword:00000005
"LocalClockDispersion"=dword:00000000

禁用服务

color a
net stop Remote Desktop Services
sc config TermService start= disabled
net stop Remote Registry
sc config RemoteRegistry start= disabled
net stop Server
sc config LanmanServer start= disabled
pause

设置IP地址

设置手动IP地址.bat

netsh interface ip set address "本地连接" static 10.249.221.64 255.255.255.0 10.249.221.254 
netsh interface ip set dns "本地连接" static 10.243.4.137
netsh interface ip add dns "本地连接" 10.251.139.241

设置自动获取IP地址.bat

netsh interface ip set address name="本地连接" source=dhcp  	
netsh interface ip set dns name="本地连接" source=dhcp

交互式设置IP地址.bat

@echo off
set slection1=
set/p slection1=请输入IP地址:
set slection2=
set/p slection2=请输入子网掩码:
set slection3=
set/p slection3=请输入网关地址:
set slection4=
set/p slection4=请输入DNS地址:
set slection5=
set/p slection5=请输入备用DNS地址:
netsh interface ip set address "本地连接" static %slection1% %slection2% %slection3%
netsh interface ip set dns "本地连接" static %slection4%
netsh interface ip add dns "本地连接" %slection5%
pause

修改IE主页

reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /t reg_sz /d https://www.baidu.com/ /f 
reg add "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v "Default_Page_URL" /t reg_sz /d https://www.baidu.com/ /f 
pause

注册表锁定与解锁(慎用)

组策略解锁注册表:
运行“gpedit.msc”—用户配置—管理模板—系统
阻止访问注册表编辑工具(禁用)

锁注册表.BAT

@reg  add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableRegistryTools /t reg_dword /d 00000001 /f

解锁注册表.BAT

@reg  add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableRegistryTools /t reg_dword /d 00000000 /f 
start regedit

msg命令使用前提

echo Windows Registry Editor Version 5.00 >1.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Lsa] >>1.reg
echo "LimitBlankPasswordUse"=dword:00000000 >>1.reg
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server] >>1.reg
echo "AllowRemoteRPC"=dword:00000001 >>1.reg
reg import 1.reg
del 1.reg
netsh advfirewall set allprofiles state off  
::关闭防火墙
pause  
::暂停

查看windows激活到期时间

slmgr.vbs -xpr

查看windows激活详细信息

slmgr.vbs -dlv

9.自动安装打印机批处理

prnport.vbs

'----------------------------------------------------------------------
'
' Copyright (c) Microsoft Corporation. All rights reserved.
'
' Abstract:
' prnport.vbs - Port script for WMI on Windows 
'     used to add, delete and list ports
'     also for getting and setting the port configuration
'
' Usage:
' prnport [-adlgt?] [-r port] [-s server] [-u user name] [-w password]
'                   [-o raw|lpr] [-h host address] [-q queue] [-n number]
'                   [-me | -md ] [-i SNMP index] [-y community] [-2e | -2d]"
'
' Examples
' prnport -a -s server -r IP_1.2.3.4 -e 1.2.3.4 -o raw -n 9100
' prnport -d -s server -r c:\temp\foo.prn
' prnport -l -s server
' prnport -g -s server -r IP_1.2.3.4
' prnport -t -s server -r IP_1.2.3.4 -me -y public -i 1 -n 9100
'
'----------------------------------------------------------------------

option explicit

'
' Debugging trace flags, to enable debug output trace message
' change gDebugFlag to true.
'
dim   gDebugFlag
const kDebugTrace = 1
const kDebugError = 2

gDebugFlag = false

'
' Operation action values.
'
const kActionAdd          = 0
const kActionDelete       = 1
const kActionList         = 2
const kActionUnknown      = 3
const kActionGet          = 4
const kActionSet          = 5

const kErrorSuccess       = 0
const KErrorFailure       = 1

const kFlagCreateOrUpdate = 0

const kNameSpace          = "root\cimv2"


'
' Constants for the parameter dictionary
'
const kServerName      = 1
const kPortName        = 2
const kDoubleSpool     = 3
const kPortNumber      = 4
const kPortType        = 5
const kHostAddress     = 6
const kSNMPDeviceIndex = 7
const kCommunityName   = 8
const kSNMP            = 9
const kQueueName       = 10
const kUserName        = 11
const kPassword        = 12

'
' Generic strings
'
const L_Empty_Text                 = ""
const L_Space_Text                 = " "
const L_Colon_Text                 = ":"
const L_LPR_Queue                  = "LPR"
const L_Error_Text                 = "错误"
const L_Success_Text               = "成功"
const L_Failed_Text                = "失败"
const L_Hex_Text                   = "0x"
const L_Printer_Text               = "打印机"
const L_Operation_Text             = "操作"
const L_Provider_Text              = "提供程序"
const L_Description_Text           = "描述"
const L_Debug_Text                 = "调试:"

'
' General usage messages
'
const L_Help_Help_General01_Text   = "用法: prnport [-adlgt?] [-r 端口][-s 服务器][-u 用户名][-w 密码]"
const L_Help_Help_General02_Text   = "               [-o raw|lpr][-h 主机地址][-q 队列][-n 编号]"
const L_Help_Help_General03_Text   = "               [-me | -md ][-i SNMP 索引][-y 团体][-2e | -2d]"
const L_Help_Help_General04_Text   = "参数:"
const L_Help_Help_General05_Text   = "-a     - 添加端口"
const L_Help_Help_General06_Text   = "-d     - 删除指定端口"
const L_Help_Help_General07_Text   = "-g     - 获得 TCP 端口的配置"
const L_Help_Help_General08_Text   = "-h     - 设备的 IP 地址"
const L_Help_Help_General09_Text   = "-i     - SNMP 索引,如果已启用 SNMP"
const L_Help_Help_General10_Text   = "-l     - 列出所有 TCP 端口"
const L_Help_Help_General11_Text   = "-m     - SNMP 类型。[e] 启用,[d] 禁用"
const L_Help_Help_General12_Text   = "-n     - 端口编号,应用于 TCP RAW 端口"
const L_Help_Help_General13_Text   = "-o     - 端口类型,raw 或 lpr"
const L_Help_Help_General14_Text   = "-q     - 队列名称,只应用于 TCP LPR 端口"
const L_Help_Help_General15_Text   = "-r     - 端口名"
const L_Help_Help_General16_Text   = "-s     - 服务器名"
const L_Help_Help_General17_Text   = "-t     - 设定 TCP 端口的配置"
const L_Help_Help_General18_Text   = "-u     - 用户名"
const L_Help_Help_General19_Text   = "-w     - 密码"
const L_Help_Help_General20_Text   = "-y     - 社区名,如果已启用 SNMP"
const L_Help_Help_General21_Text   = "-2     - 双后台处理程序,应用于 TCP LPR 端口。[e] 启用,[d] 禁用"
const L_Help_Help_General22_Text   = "-?     - 显示命令用法"
const L_Help_Help_General23_Text   = "例如:"
const L_Help_Help_General24_Text   = "prnport -l -s 服务器"
const L_Help_Help_General25_Text   = "prnport -d -s 服务器 -r IP_1.2.3.4"
const L_Help_Help_General26_Text   = "prnport -a -s 服务器 -r IP_1.2.3.4 -h 1.2.3.4 -o raw -n 9100"
const L_Help_Help_General27_Text   = "prnport -t -s 服务器 -r IP_1.2.3.4 -me -y public -i 1 -n 9100"
const L_Help_Help_General28_Text   = "prnport -g -s 服务器 -r IP_1.2.3.4"
const L_Help_Help_General29_Text   = "prnport -a -r IP_1.2.3.4 -h 1.2.3.4"
const L_Help_Help_General30_Text   = "注解:"
const L_Help_Help_General31_Text   = "上一个例子将试图获取指定 IP 地址的设备设置。"
const L_Help_Help_General32_Text   = "如果已检测到设备,那个设备的首选设置会被添加到 TCP 端口。"

'
' Messages to be displayed if the scripting host is not cscript
'
const L_Help_Help_Host01_Text      = "此脚本应该用 CSCRIPT.EXE 在命令提示符下执行。"
const L_Help_Help_Host02_Text      = "例如: CScript script.vbs 参数"
const L_Help_Help_Host03_Text      = ""
const L_Help_Help_Host04_Text      = "要设置 CScript 作为运行 .vbs 文件的默认应用程序,运行如下:"
const L_Help_Help_Host05_Text      = "     CScript //H:CScript //S"
const L_Help_Help_Host06_Text      = "然后可以运行 ""script.vbs arguments"",而无需在运行脚本前先使用 CScript。"

'
' General error messages
'
const L_Text_Error_General01_Text  = "无法决定脚本操作主机。"
const L_Text_Error_General02_Text  = "无法分析命令行。"
const L_Text_Error_General03_Text  = "Win32 错误代码"

'
' Miscellaneous messages
'
const L_Text_Msg_General01_Text    = "已添加端口"
const L_Text_Msg_General02_Text    = "无法删除端口"
const L_Text_Msg_General03_Text    = "无法获取端口"
const L_Text_Msg_General04_Text    = "已创建/更新端口"
const L_Text_Msg_General05_Text    = "无法创建/更新端口"
const L_Text_Msg_General06_Text    = "无法枚举端口"
const L_Text_Msg_General07_Text    = "枚举的端口数量"
const L_Text_Msg_General08_Text    = "已删除的端口"
const L_Text_Msg_General09_Text    = "无法获取 SWbemLocator 对象"
const L_Text_Msg_General10_Text    = "无法连接到 WMI 服务"


'
' Port properties
'
const L_Text_Msg_Port01_Text       = "服务器名"
const L_Text_Msg_Port02_Text       = "端口名"
const L_Text_Msg_Port03_Text       = "主机地址"
const L_Text_Msg_Port04_Text       = "协议 RAW"
const L_Text_Msg_Port05_Text       = "协议 LPR"
const L_Text_Msg_Port06_Text       = "端口编号"
const L_Text_Msg_Port07_Text       = "队列"
const L_Text_Msg_Port08_Text       = "已启用字节计数"
const L_Text_Msg_Port09_Text       = "已禁用字节计数"
const L_Text_Msg_Port10_Text       = "已启用 SNMP "
const L_Text_Msg_Port11_Text       = "已禁用 SNMP"
const L_Text_Msg_Port12_Text       = "团体"
const L_Text_Msg_Port13_Text       = "设备索引"

'
' Debug messages
'
const L_Text_Dbg_Msg01_Text        = "于函数 DelPort"
const L_Text_Dbg_Msg02_Text        = "于函数 CreateOrSetPort"
const L_Text_Dbg_Msg03_Text        = "于函数 ListPorts"
const L_Text_Dbg_Msg04_Text        = "于函数 GetPort"
const L_Text_Dbg_Msg05_Text        = "于函数 ParseCommandLine"

main

'
' Main execution starts here
'
sub main

    on error resume next

    dim iAction
    dim iRetval
    dim oParamDict

    '
    ' Abort if the host is not cscript
    '
    if not IsHostCscript() then

        call wscript.echo(L_Help_Help_Host01_Text & vbCRLF & L_Help_Help_Host02_Text & vbCRLF & _
                          L_Help_Help_Host03_Text & vbCRLF & L_Help_Help_Host04_Text & vbCRLF & _
                          L_Help_Help_Host05_Text & vbCRLF & L_Help_Help_Host06_Text & vbCRLF)

        wscript.quit

    end if

    set oParamDict = CreateObject("Scripting.Dictionary")

    iRetval = ParseCommandLine(iAction, oParamDict)

    if iRetval = 0 then

        select case iAction

            case kActionAdd
                iRetval = CreateOrSetPort(oParamDict)

            case kActionDelete
                iRetval = DelPort(oParamDict)

            case kActionList
                iRetval = ListPorts(oParamDict)

            case kActionGet
                iRetVal = GetPort(oParamDict)

            case kActionSet
                iRetVal = CreateOrSetPort(oParamDict)

            case else
                Usage(true)
                exit sub

        end select

    end if

end sub

'
' Delete a port
'
function DelPort(oParamDict)

    on error resume next

    DebugPrint kDebugTrace, L_Text_Dbg_Msg01_Text
    DebugPrint kDebugTrace, L_Text_Msg_Port01_Text & L_Space_Text & oParamDict(kServerName)
    DebugPrint kDebugTrace, L_Text_Msg_Port02_Text & L_Space_Text & oParamDict(kPortName)

    dim oService
    dim oPort
    dim iResult
    dim strServer
    dim strPort
    dim strUser
    dim strPassword

    iResult = kErrorFailure

    strServer   = oParamDict(kServerName)
    strPort     = oParamDict(kPortName)
    strUser     = oParamDict(kUserName)
    strPassword = oParamDict(kPassword)

    if WmiConnect(strServer, kNameSpace, strUser, strPassword, oService) then

        set oPort = oService.Get("Win32_TCPIPPrinterPort='" & strPort & "'")

    else

        DelPort = kErrorFailure

        exit function

    end if

    '
    ' Check if Get succeeded
    '
    if Err.Number = kErrorSuccess then

        '
        ' Try deleting the instance
        '
        oPort.Delete_

        if Err.Number = kErrorSuccess then

            wscript.echo L_Text_Msg_General08_Text & L_Space_Text & strPort

        else

            wscript.echo L_Text_Msg_General02_Text & L_Space_Text & L_Error_Text & L_Space_Text _
                         & L_Hex_Text & hex(Err.Number) & L_Space_Text & Err.Description

            '
            ' Try getting extended error information
            '
            call LastError()

        end if

    else

        wscript.echo L_Text_Msg_General02_Text & L_Space_Text & L_Error_Text & L_Space_Text _
                     & L_Hex_Text & hex(Err.Number) & L_Space_Text & Err.Description

        '
        ' Try getting extended error information
        '
        call LastError()

    end if

    DelPort = iResult

end function

'
' Add or update a port
'
function CreateOrSetPort(oParamDict)

    on error resume next

    dim oPort
    dim oService
    dim iResult
    dim PortType
    dim strServer
    dim strPort
    dim strUser
    dim strPassword

    DebugPrint kDebugTrace, L_Text_Dbg_Msg02_Text
    DebugPrint kDebugTrace, L_Text_Msg_Port01_Text & L_Space_Text & oParamDict.Item(kServerName)
    DebugPrint kDebugTrace, L_Text_Msg_Port02_Text & L_Space_Text & oParamDict.Item(kPortName)
    DebugPrint kDebugTrace, L_Text_Msg_Port06_Text & L_Space_Text & oParamDict.Item(kPortNumber)
    DebugPrint kDebugTrace, L_Text_Msg_Port07_Text & L_Space_Text & oParamDict.Item(kQueueName)
    DebugPrint kDebugTrace, L_Text_Msg_Port13_Text & L_Space_Text & oParamDict.Item(kSNMPDeviceIndex)
    DebugPrint kDebugTrace, L_Text_Msg_Port12_Text & L_Space_Text & oParamDict.Item(kCommunityName)
    DebugPrint kDebugTrace, L_Text_Msg_Port03_Text & L_Space_Text & oParamDict.Item(kHostAddress)

    strServer   = oParamDict(kServerName)
    strPort     = oParamDict(kPortName)
    strUser     = oParamDict(kUserName)
    strPassword = oParamDict(kPassword)

    '
    ' If the port exists, then get the settings. Later PutInstance will do an update
    '
    if WmiConnect(strServer, kNameSpace, strUser, strPassword, oService) then

        set oPort = oService.Get("Win32_TCPIPPrinterPort.Name='" & strPort & "'")

        '
        ' If get was unsuccessful then spawn a new port instance. Later PutInstance will do a create
        '
        if Err.Number <> kErrorSuccess then

            '
            ' Clear the previous error
            '
            Err.Clear

            set oPort = oService.Get("Win32_TCPIPPrinterPort").SpawnInstance_

        end if

    else

        CreateOrSetPort = kErrorFailure

        exit function

    end if

    if Err.Number <> kErrorSuccess then

        wscript.echo L_Text_Msg_General03_Text & L_Space_Text & L_Error_Text & L_Space_Text _
                     & L_Hex_Text & hex(Err.Number) & L_Space_Text & Err.Description

        CreateOrSetPort = kErrorFailure

        exit function

    end if

    oPort.Name          = oParamDict.Item(kPortName)
    oPort.HostAddress   = oParamDict.Item(kHostAddress)
    oPort.PortNumber    = oParamDict.Item(kPortNumber)
    oPort.SNMPEnabled   = oParamDict.Item(kSNMP)
    oPort.SNMPDevIndex  = oParamDict.Item(kSNMPDeviceIndex)
    oPort.SNMPCommunity = oParamDict.Item(kCommunityName)
    oPort.Queue         = oParamDict.Item(kQueueName)
    oPort.ByteCount     = oParamDict.Item(kDoubleSpool)

    PortType     = oParamDict.Item(kPortType)

    '
    ' Update the port object with the settings corresponding
    ' to the port type of the port to be added
    '
    select case lcase(PortType)

            case "raw"

                 oPort.Protocol      = 1

                 if Not IsNull(oPort.Queue) then

                     wscript.echo L_Error_Text & L_Colon_Text & L_Space_Text _
                     & L_Help_Help_General14_Text

                     CreateOrSetPort = kErrorFailure

                     exit function

                 end if

            case "lpr"

                 oPort.Protocol      = 2

                 if IsNull(oPort.Queue) then

                     oPort.Queue = L_LPR_Queue

                 end if

            case else

                 '
                 ' PutInstance will attempt to get the configuration of
                 ' the device based on its IP address. Those settings
                 ' will be used to add a new port
                 '
    end select

    '
    ' Try creating or updating the port
    '
    oPort.Put_(kFlagCreateOrUpdate)

    if Err.Number = kErrorSuccess then

        wscript.echo L_Text_Msg_General04_Text & L_Space_Text & oPort.Name

        iResult = kErrorSuccess

    else

        wscript.echo L_Text_Msg_General05_Text & L_Space_Text & oPort.Name & L_Space_Text _
                     & L_Error_Text & L_Space_Text & L_Hex_Text & hex(Err.Number) _
                     & L_Space_Text & Err.Description

        '
        ' Try getting extended error information
        '
        call LastError()

        iResult = kErrorFailure

    end if

    CreateOrSetPort = iResult

end function

'
' List ports on a machine.
'
function ListPorts(oParamDict)

    on error resume next

    DebugPrint kDebugTrace, L_Text_Dbg_Msg03_Text

    dim Ports
    dim oPort
    dim oService
    dim iRetval
    dim iTotal
    dim strServer
    dim strUser
    dim strPassword

    iResult = kErrorFailure

    strServer   = oParamDict(kServerName)
    strUser     = oParamDict(kUserName)
    strPassword = oParamDict(kPassword)

    if WmiConnect(strServer, kNameSpace, strUser, strPassword, oService) then

        set Ports = oService.InstancesOf("Win32_TCPIPPrinterPort")

    else

        ListPorts = kErrorFailure

        exit function

    end if

    if Err.Number <> kErrorSuccess then

        wscript.echo L_Text_Msg_General06_Text & L_Space_Text & L_Error_Text & L_Space_Text _
                     & L_Hex_Text & hex(Err.Number) & L_Space_Text & Err.Description

        ListPrinters = kErrorFailure

        exit function

    end if

    iTotal = 0

    for each oPort in Ports

        iTotal = iTotal + 1

        wscript.echo L_Empty_Text
        wscript.echo L_Text_Msg_Port01_Text & L_Space_Text & strServer
        wscript.echo L_Text_Msg_Port02_Text & L_Space_Text & oPort.Name
        wscript.echo L_Text_Msg_Port03_Text & L_Space_Text & oPort.HostAddress

        if oPort.Protocol = 1 then

            wscript.echo L_Text_Msg_Port04_Text
            wscript.echo L_Text_Msg_Port06_Text & L_Space_Text & oPort.PortNumber

        else

            wscript.echo L_Text_Msg_Port05_Text
            wscript.echo L_Text_Msg_Port07_Text & L_Space_Text & oPort.Queue

            if oPort.ByteCount then

                wscript.echo L_Text_Msg_Port08_Text

            else

                wscript.echo L_Text_Msg_Port09_Text

            end if

        end if

        if oPort.SNMPEnabled then

            wscript.echo L_Text_Msg_Port10_Text
            wscript.echo L_Text_Msg_Port12_Text & L_Space_Text & oPort.SNMPCommunity
            wscript.echo L_Text_Msg_Port13_Text & L_Space_Text & oPort.SNMPDevIndex

        else

            wscript.echo L_Text_Msg_Port11_Text

        end if

        Err.Clear

    next

    wscript.echo L_Empty_Text
    wscript.echo L_Text_Msg_General07_Text & L_Space_Text & iTotal

    ListPorts = kErrorSuccess

end function

'
' Gets the configuration of a port
'
function GetPort(oParamDict)

    on error resume next

    DebugPrint kDebugTrace, L_Text_Dbg_Msg04_Text
    DebugPrint kDebugTrace, L_Text_Msg_Port01_Text & L_Space_Text & oParamDict(kServerName)
    DebugPrint kDebugTrace, L_Text_Msg_Port02_Text & L_Space_Text & oParamDict(kPortName)

    dim oService
    dim oPort
    dim iResult
    dim strServer
    dim strPort
    dim strUser
    dim strPassword

    iResult = kErrorFailure

    strServer   = oParamDict(kServerName)
    strPort     = oParamDict(kPortName)
    strUser     = oParamDict(kUserName)
    strPassword = oParamDict(kPassword)

    if WmiConnect(strServer, kNameSpace, strUser, strPassword, oService) then

        set oPort = oService.Get("Win32_TCPIPPrinterPort.Name='" & strPort & "'")

    else

        GetPort = kErrorFailure

        exit function

    end if

    if Err.Number = kErrorSuccess then

        wscript.echo L_Empty_Text
        wscript.echo L_Text_Msg_Port01_Text & L_Space_Text & strServer
        wscript.echo L_Text_Msg_Port02_Text & L_Space_Text & oPort.Name
        wscript.echo L_Text_Msg_Port03_Text & L_Space_Text & oPort.HostAddress

        if oPort.Protocol = 1 then

            wscript.echo L_Text_Msg_Port04_Text
            wscript.echo L_Text_Msg_Port06_Text & L_Space_Text & oPort.PortNumber

        else

            wscript.echo L_Text_Msg_Port05_Text
            wscript.echo L_Text_Msg_Port07_Text & L_Space_Text & oPort.Queue

            if oPort.ByteCount then

                wscript.echo L_Text_Msg_Port08_Text

            else

                wscript.echo L_Text_Msg_Port09_Text

            end if

        end if

        if oPort.SNMPEnabled then

            wscript.echo L_Text_Msg_Port10_Text
            wscript.echo L_Text_Msg_Port12_Text & L_Space_Text & oPort.SNMPCommunity
            wscript.echo L_Text_Msg_Port13_Text & L_Space_Text & oPort.SNMPDevIndex

        else

            wscript.echo L_Text_Msg_Port11_Text

        end if

        iResult = kErrorSuccess

    else

        wscript.echo L_Text_Msg_General03_Text & L_Space_Text & L_Error_Text & L_Space_Text _
                     & L_Hex_Text & hex(Err.Number) & L_Space_Text & Err.Description

        '
        ' Try getting extended error information
        '
        call LastError()

    end if

    GetPort = iResult

end function

'
' Debug display helper function
'
sub DebugPrint(uFlags, strString)

    if gDebugFlag = true then

        if uFlags = kDebugTrace then

            wscript.echo L_Debug_Text & L_Space_Text & strString

        end if

        if uFlags = kDebugError then

            if Err <> 0 then

                wscript.echo L_Debug_Text & L_Space_Text & strString & L_Space_Text _
                             & L_Error_Text & L_Space_Text & L_Hex_Text & hex(Err.Number) _
                             & L_Space_Text & Err.Description

            end if

        end if

    end if

end sub

'
' Parse the command line into its components
'
function ParseCommandLine(iAction, oParamDict)

    on error resume next

    DebugPrint kDebugTrace, L_Text_Dbg_Msg05_Text

    dim oArgs
    dim iIndex

    iAction = kActionUnknown

    set oArgs = Wscript.Arguments

    while iIndex < oArgs.Count

        select case oArgs(iIndex)

            case "-g"
                iAction = kActionGet

            case "-t"
                iAction = kActionSet

            case "-a"
                iAction = kActionAdd

            case "-d"
                iAction = kActionDelete

            case "-l"
                iAction = kActionList

            case "-2e"
                oParamDict.Add kDoubleSpool, true

            case "-2d"
                oParamDict.Add kDoubleSpool, false

            case "-s"
                iIndex = iIndex + 1
                oParamDict.Add kServerName, RemoveBackslashes(oArgs(iIndex))

            case "-u"
                iIndex = iIndex + 1
                oParamDict.Add kUserName, oArgs(iIndex)

            case "-w"
                iIndex = iIndex + 1
                oParamDict.Add kPassword, oArgs(iIndex)

            case "-n"
                iIndex = iIndex + 1
                oParamDict.Add kPortNumber, oArgs(iIndex)

            case "-r"
                iIndex = iIndex + 1
                oParamDict.Add kPortName, oArgs(iIndex)

            case "-o"
                iIndex = iIndex + 1
                oParamDict.Add kPortType, oArgs(iIndex)

            case "-h"
                iIndex = iIndex + 1
                oParamDict.Add kHostAddress, oArgs(iIndex)

            case "-q"
                iIndex = iIndex + 1
                oParamDict.Add kQueueName, oArgs(iIndex)

            case "-i"
                iIndex = iIndex + 1
                oParamDict.Add kSNMPDeviceIndex, oArgs(iIndex)

            case "-y"
                iIndex = iIndex + 1
                oParamDict.Add kCommunityName, oArgs(iIndex)

            case "-me"
                oParamDict.Add kSNMP, true

            case "-md"
                oParamDict.Add kSNMP, false

            case "-?"
                Usage(True)
                exit function

            case else
                Usage(True)
                exit function

        end select

        iIndex = iIndex + 1

    wend

    if Err = kErrorSuccess then

        ParseCommandLine = kErrorSuccess

    else

        wscript.echo L_Text_Error_General02_Text & L_Space_Text & L_Error_Text & L_Space_Text _
                     & L_Hex_Text & hex(Err.Number) & L_Space_text & Err.Description


        ParseCommandLine = kErrorFailure

    end if

end  function

'
' Display command usage.
'
sub Usage(bExit)

    wscript.echo L_Help_Help_General01_Text
    wscript.echo L_Help_Help_General02_Text
    wscript.echo L_Help_Help_General03_Text
    wscript.echo L_Help_Help_General04_Text
    wscript.echo L_Help_Help_General05_Text
    wscript.echo L_Help_Help_General06_Text
    wscript.echo L_Help_Help_General07_Text
    wscript.echo L_Help_Help_General08_Text
    wscript.echo L_Help_Help_General09_Text
    wscript.echo L_Help_Help_General10_Text
    wscript.echo L_Help_Help_General11_Text
    wscript.echo L_Help_Help_General12_Text
    wscript.echo L_Help_Help_General13_Text
    wscript.echo L_Help_Help_General14_Text
    wscript.echo L_Help_Help_General15_Text
    wscript.echo L_Help_Help_General16_Text
    wscript.echo L_Help_Help_General17_Text
    wscript.echo L_Help_Help_General18_Text
    wscript.echo L_Help_Help_General19_Text
    wscript.echo L_Help_Help_General20_Text
    wscript.echo L_Help_Help_General21_Text
    wscript.echo L_Help_Help_General22_Text
    wscript.echo L_Empty_Text
    wscript.echo L_Help_Help_General23_Text
    wscript.echo L_Help_Help_General24_Text
    wscript.echo L_Help_Help_General25_Text
    wscript.echo L_Help_Help_General26_Text
    wscript.echo L_Help_Help_General27_Text
    wscript.echo L_Help_Help_General28_Text
    wscript.echo L_Help_Help_General29_Text
    wscript.echo L_Empty_Text
    wscript.echo L_Help_Help_General30_Text
    wscript.echo L_Help_Help_General31_Text
    wscript.echo L_Help_Help_General32_Text

    if bExit then

        wscript.quit(1)

    end if

end sub

'
' Determines which program is being used to run this script.
' Returns true if the script host is cscript.exe
'
function IsHostCscript()

    on error resume next

    dim strFullName
    dim strCommand
    dim i, j
    dim bReturn

    bReturn = false

    strFullName = WScript.FullName

    i = InStr(1, strFullName, ".exe", 1)

    if i <> 0 then

        j = InStrRev(strFullName, "\", i, 1)

        if j <> 0 then

            strCommand = Mid(strFullName, j+1, i-j-1)

            if LCase(strCommand) = "cscript" then

                bReturn = true

            end if

        end if

    end if

    if Err <> 0 then

        wscript.echo L_Text_Error_General01_Text & L_Space_Text & L_Error_Text & L_Space_Text _
                     & L_Hex_Text & hex(Err.Number) & L_Space_Text & Err.Description

    end if

    IsHostCscript = bReturn

end function

'
' Retrieves extended information about the last error that occurred
' during a WBEM operation. The methods that set an SWbemLastError
' object are GetObject, PutInstance, DeleteInstance
'
sub LastError()

    on error resume next

    dim oError

    set oError = CreateObject("WbemScripting.SWbemLastError")

    if Err = kErrorSuccess then

        wscript.echo L_Operation_Text            & L_Space_Text & oError.Operation
        wscript.echo L_Provider_Text             & L_Space_Text & oError.ProviderName
        wscript.echo L_Description_Text          & L_Space_Text & oError.Description
        wscript.echo L_Text_Error_General04_Text & L_Space_Text & oError.StatusCode

    end if

end sub

'
' Connects to the WMI service on a server. oService is returned as a service
' object (SWbemServices)
'
function WmiConnect(strServer, strNameSpace, strUser, strPassword, oService)

   on error resume next

   dim oLocator
   dim bResult

   oService = null

   bResult  = false

   set oLocator = CreateObject("WbemScripting.SWbemLocator")

   if Err = kErrorSuccess then

      set oService = oLocator.ConnectServer(strServer, strNameSpace, strUser, strPassword)

      if Err = kErrorSuccess then

          bResult = true

          oService.Security_.impersonationlevel = 3

          '
          ' Required to perform administrative tasks on the spooler service
          '
          oService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege"

          Err.Clear

      else

          wscript.echo L_Text_Msg_General10_Text & L_Space_Text & L_Error_Text _
                       & L_Space_Text & L_Hex_Text & hex(Err.Number) & L_Space_Text _
                       & Err.Description

      end if

   else

       wscript.echo L_Text_Msg_General09_Text & L_Space_Text & L_Error_Text _
                    & L_Space_Text & L_Hex_Text & hex(Err.Number) & L_Space_Text _
                    & Err.Description

   end if

   WmiConnect = bResult

end function

'
' Remove leading "\\" from server name
'
function RemoveBackslashes(strServer)

    dim strRet

    strRet = strServer

    if Left(strServer, 2) = "\\" and Len(strServer) > 2 then

        strRet = Mid(strServer, 3)

    end if

    RemoveBackslashes = strRet

end function

自动安装打印机批处理.BAT

@echo off
color a
 
echo ***欢迎使用打印机安装程序***

rem ">nul"使命令输出不显示
echo  创建打印机 TCP/IP 端口: IP_10.249.221.56-1
echo - 

cscript %~dp0\prnport.vbs -a -r IP_10.249.221.56-1 -h 10.249.221.56  -o raw

echo 删除同名打印机
echo -
rundll32 printui.dll,PrintUIEntry /dl /n "Panasonic DP-8016P Ver. 2" /q
rem 此处删除同名打印机,否则会出现打印机副本
echo 创建打印机: Panasonic DP-8016PTX34
echo -
rem 判断64位系统和32位系统 
if /i %PROCESSOR_IDENTIFIER:~0,3%==x86 ( 
echo  32位操作系统 
echo -           

rundll32 printui.dll,PrintUIEntry /if /b "Panasonic DP-8016PTX34" /f %~dp0\32\STUP816P.INF /r "IP_10.249.221.56-1" /m "Panasonic DP-8016P Ver. 2" /z

)else ( 
echo 64位操作系统
echo -           

rundll32 printui.dll,PrintUIEntry /if /b "Panasonic DP-8016PTX34" /f %~dp0\64\STUP816P.INF /r "IP_10.249.221.56-1" /m "Panasonic DP-8016P Ver. 2" /z

) 
echo  打印机安装完成
echo -
echo  按任意键退出...
pause>nul

1.批处理目录结构如下,32对应32位驱动,64对应64位驱动,prnport.vbs是脚本,请勿修改,所有修改都是对XXX.BAT文件

在这里插入图片描述

2.用笔记本打开XXX.BAT文件,替换为自己需要的IP地址
在这里插入图片描述

3.这里替换的是打印机显示的名称,可以自定义

在这里插入图片描述

4.打开64文件夹,找到XXX.INF类型文件,这里是我需要安装的是STUP816P.INF,把这个名称记录下来等会需要用到(32也是同理)
在这里插入图片描述

5.将下面红色框内的名称替换成, STUP816P.INF这里已经替换好了
在这里插入图片描述

6.有时在一个XXX.INF安装信息里面包含多个版本,需要先手动安装一下打印机,记录下需要安装的版本名称,这里需要安装的是Panasonic DP-8016P Ver. 2,把这个记录下来等会有用

在这里插入图片描述
在这里插入图片描述

7.将下面红色框内的字符,替换为刚才我们记录下来的型号名称, Panasonic DP-8016P Ver. 2

在这里插入图片描述

8.此时运行XXX.BAT即可自动安装打印机了(注意建议使用右键管理员方式运行,不然有时会显示端口添加失败)

10.自动安装打印机批处理综合示例

打印机安装.bat

@echo off
color a
cls

:begin

echo.
echo          打印机一键安装工具
echo.
echo     请选择安装内容: 
echo.
echo     1. 打印机1
echo.
echo     2. 打印机2
echo.
echo     3. 打印机3
echo.
echo     x. 退出
echo.


	set /p mychoice=  我的选择是: 
  if %mychoice%==1 goto one 
  if %mychoice%==2 goto two
  if %mychoice%==3 goto three
  if %mychoice%==x goto exit 

 goto begin

:one
	start  "" "%~dp0PrintDriver\打印机1.bat"
	goto exit

	
:two
	start  "" "%~dp0PrintDriver\打印机2.bat"
	goto exit

	
:three
	start  "" "%~dp0PrintDriver\打印机3.bat"
	goto exit

:exit


echo.
echo.
echo      运行完毕!
echo.
echo      谢谢使用。
echo.
echo.
exit

打印机1.BAT

@echo off
color a
 
echo ***打印机 1安装程序***

echo  创建打印机 TCP/IP 端口: IP_10.249.195.140-1
echo ------------------------------ 
cscript %~dp0\prnport.vbs -a -r IP_10.249.195.140-1 -h 10.249.195.140  -o raw
rem 添加打印机端口和IP地址

echo 删除同名打印机
echo ------------------------------
rundll32 printui.dll,PrintUIEntry /dl /n "KONICA MINOLTA 367SeriesPCL" /q
rem 此处删除同名打印机,否则会出现打印机副本

echo 创建打印机: KONICA MINOLTA 367
echo -------------------------------

if /i %PROCESSOR_IDENTIFIER:~0,3%==x86 ( 
echo  32位操作系统 
echo ------------------------------           

rundll32 printui.dll,PrintUIEntry /if /b "KONICA MINOLTA 367" /f %~dp0KONICA367\x86\KOAYEJ__.INF /r "IP_10.249.195.140-1" /m "KONICA MINOLTA 367SeriesPCL" /z

)else ( 
echo 64位操作系统
echo -----------------------------           

rundll32 printui.dll,PrintUIEntry /if /b "KONICA MINOLTA 367" /f %~dp0KONICA367\x64\KOAYEJ__.INF /r "IP_10.249.195.140-1" /m "KONICA MINOLTA 367SeriesPCL" /z

) 
rem 判断64位系统和32位系统 

echo  打印机安装完成
echo ---------------------------
echo  按任意键退出...

pause>nul  

exit

prnport.vbs
略(和第9章的是一样的脚本)

批处理目录结构如下
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

打印机1.BAT说明图示
在这里插入图片描述

  • 4
    点赞
  • 37
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

神秘剑客_CN

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值