数字汇编
谷歌
Translate to EnglishÜbersetzen Sie zum Deutsch/GermanTraduzca al Español/SpanishTraduisez au Français/FrenchTraduca ad Italiano/ItalianTraduza ao Português/Portuguese日本語に翻訳しなさい /Japanese
한국어에게 번역하십시오/Korean中文翻译/Chinese Simplified中文翻译/Chinese Traditionalترجمة الى العربية/ArabicVertaal aan het Nederlands/DutchΜεταφράστε στα ελληνικά/GreekПереведите к русскому/Russian
Plugin by Taragana

How to run scripts from command line in Windows如何从运行脚本的命令行在Windows

脚本 Running scripts to automate some simple tasks or some repetitive tasks are very common nowadays.运行脚本自动化一些简单的任务,或一些重复的任务是非常普遍的今天。 Every operating system has got its own way of writing scripts to automate tasks and it sometimes varies from one flavor of operating system to another flavor.每一个作业系统已得到以自己的方式写作脚本自动化的任务和它有时不同,从一个味道的作业系统,另一个味道。

For instance, Windows has got batch files, vb script and Linux has its own shell scripting methodologies.举例来说, Windows已得到批处理文件, VB的脚本和Linux有自己的壳脚本的方法。 When it comes to windows most of us will definitely remember writing small scripts using Batch files having extension .bat.当谈到到Windows我们大多数人一定会记得,写作小脚本使用批处理文件有扩展名。蝙蝠。 But batch files have limited ability to execute tasks so programmers generally use Visual basic scripts (vbs) to do such tasks.但批处理文件有能力有限,执行任务,使程序员普遍使用Visual Basic脚本( vbs )这样的任务。 Today we are going to see how to use the same from command line because most of us are not aware of the built-in DOS command line utility.今天我们要看到如何使用相同的命令行,因为我们大多数人不知道有内建在DOS命令行实用工具。

命令提示符

指挥 Windows scripting was introduced mainly to administer networks, some operating system tasks like installing softwares, uninstalling softwares, log clearance and some OS specific tasks by programmers. Windows脚本介绍,主要是管理网络,一些作业系统的任务,例如安装软件,卸载软件,登录手续及一些操作系统的具体任务由程序员。 Windows scripting is so powerful that you can use the same to automate tasks at system logon, log-off, scheduled tasks , to do some remote administration or to implement network policies in all the network computers by administrator. Windows脚本是如此强大,您可以使用相同的自动化任务,在系统登录,登录起飞,计划任务,做一些远程管理或执行的政策,在网络的所有网络计算机管理员。 If the script is saved as a vbs file you can straight away execute the same from windows or you can use a command line tool called cscript to execute from command line.如果脚本是保存为vbs文件,您可以立即执行,同时从Windows或者您也可以使用命令行工具的所谓cscript执行从命令行。

Sample usage of the command is given below,使用范例的命令是考虑到下面,

  • cscript <filename> cscript <文件名>

  • eg) cscript sample.vbs 例如) cscript sample.vbs

  • cscript <filename> > <output filename> cscript <文件名> > <output filename>

  • eg) cscript sample.vbs > output.txt 例如) cscript sample.vbs > output.txt

To read more about scripting read this若要了解更多关于脚本阅读这本 Microsoft Script Library Microsoft脚本图书馆 . In my future posts I will be writing more about the basics of scripting and some useful scripting examples. 我在未来的职位,我会写更多有关的基本脚本和一些有用的脚本的例子。 Keep reading……继续阅读… …

Share or Bookmark: These icons link to social bookmarking sites where readers can share and discover new web pages. 共享或书签: 这些图标链接到社会书签网站,读者可以分享和发现新的网页。 DiggSphinndel.icio.usFacebookMixxGoogle


See Similar Posts看到类似职位

Leave a Comment留下意见