Windows 7 64 位系统下载

Win7:免费下载,安装简单,硬件兼容,极速安全

如果您电脑是预安装的 Win10 系统,为避免兼容性问题,建议选择 Win10

视频教程:下载的系统如何安装

Windows 10 64 位系统下载

Win10:界面简洁,经典易用,运行流畅,自动安装

如果您电脑遇到死机卡顿各种问题,下载安装即可解决!

视频教程:下载的系统如何安装

当前位置:首页 > Win7教程

Windows 7下的NET PRINT指令被删除

Win7教程2014-08-28 16:02:38

如果你习惯下指令来操作系统,那么您可以试试在 Windows 7 的 command line 底下输入 "net /?",你会发现下图:

Windows 7下的NET PRINT指令被删除
 

耶... 怎么 NET PRINT 的指令不见了?


是的,你没有看错,NET PRINT 指令在 Windows 7 已经不存在了。


为什么呢?根据中国 TechNet 团队特派员的了解,决定不在 Windows7 继续提供 NET PRINT 指令有两个理由,一是指令的使用率,二是有其他的方式可以达到同样的目的。


在我们开始说明有哪些方式可以达到同样的效果前,先让我们来复习一下 NET PRINT 这个指令吧。


透过 NET PRINT 的指令说明(如下)我们可以知道,NET PRINT 是用来显示当前列印工作排序状态。您可以透过指令来指派列印工作的状态,例如暂停列印工作、恢复列印工作以及删除列印工作。


NET PRINT
\\computername\sharename
          [\\computername] job# [/HOLD | /RELEASE | /DELETE]


NET PRINT displays print jobs and shared queues.  For each queue, the display lists jobs, showing the size and status of each job, and the status of the queue.


computername is the name of the computer sharing the printer queue(s).
sharename is the name of the shared printer queue.
job# is the identification number assigned to a print job.  A computer with one or more printer queues assigns each print job a unique number.
/HOLD prevents a job in a queue from printing.  The job stays in the printer queue, and other jobs bypass it until it is released.
/RELEASE reactivates a job that is held.
/DELETE removes a job from a queue.


虽然 NET PRINT 已经不复存在,但是你在 %windir%\System32\Printing_Admin_Scripts\en-US 找到 prnjobs.vbs 来实现相同的功能。

 

Windows 7下的NET PRINT指令被删除

 这里要注意的是,如果您想要在command line里下 prnjobs.vbs -? 指令的话,必须向下图这样下:cscript prnjobs.vbs -?

 

Windows 7下的NET PRINT指令被删除

 

底下列出 prnjobs 的指令说明:


Usage: prnjobs [-zmxl?] [-s server][-p printer][-j jobid][-u user name][-w password]


As you can see from the command above, there are several arguments that can be passed to the script:


-j is the job id
-l is used to list all jobs
-m used to resume the job
-p used to specify the printer name
-s used to specify the server name
-u specify the user name of a user (passing admin credentials for example)
-w specify the password
-x used to cancel a print job
-z used to pause a print job
-? display command usage / help


如果您想要利用 prnjobs.vbs 来进行打印机的管理,那么我也列出几个常用的指令与过去和 NET PRINT 指令的对照,方便您使用:

作用
 NET PRINT 指令
 PRNJOBS.VBS 指令

 

列印工作排序状态
 NET PRINT
 cscript prnjobs.vbs –l –p

 

暂停列印工作
 NET PRINT /hold
 cscript prnjobs.vbs -p   -j  -z

 

恢复列印工作
 NET PRINT /release
 cscript prnjobs.vbs -p   -j  -m

删除/取消列印工作
 NET PRINT /delete
 cscript prnjobs.vbs -p   -j  -x

上面的对照表示假设您使用的是本机打印机,如果您要管理远端的打印机,请记得加 -s 这个参数。

您也可以透过 PowerShell 脚本以及 WMI 脚本来执行这个指令。

祝大家使用愉快。

happy 有用 53 sad
分享 share
标签:
Windows 7下的NET PRINT指令被删除wind
相关推荐
电脑没声音案例分析 125 2014/08/28
笔记本为什么上不了网 217 2014/08/28
关注微信 关注公众号 立即获取
Win7/8/10通用密钥
以及Office资源

Copyright ©2018-2023 www.958358.com 粤ICP备19111771号-7