web脚本自动关闭开启服务_如何使用脚本自动更新系统实用程序或Web文件

web脚本自动关闭开启服务_如何使用脚本自动更新系统实用程序或Web文件

web脚本自动关闭开启服务

web脚本自动关闭开启服务_如何使用脚本自动更新系统实用程序或Web文件

One of the great things about most system utilities is their portability. Many simply are distributed directly as an exe or in a zip file and are ready to use with no install required. Because of the simplicity of use, these types of applications are easily updated, however many lack any form of auto-update capability. Our UpdateFromWeb script solves this problem as it makes installing updates to portable applications, or any file available via the web for that matter, an automated process.

大多数系统实用程序的一大优点是它们的可移植性。 许多文件直接作为exe或zip文件直接分发,并且无需安装即可使用。 由于使用简便,可以轻松更新这些类型的应用程序,但是许多应用程序缺少任何形式的自动更新功能。 我们的UpdateFromWeb脚本解决了此问题,因为它使对便携式应用程序或通过Web可用的任何文件的更新安装过程自动化。

用法 (Usage)

The UpdateFromWeb script usage is pretty simple and we have provided several examples below. You simply provide the source URL and the directory where the files to be updated on your computer are located and the script does the rest.

UpdateFromWeb脚本的用法非常简单,下面提供了几个示例。 您只需提供源URL和计算机上要更新的文件所在的目录,其余脚本由脚本执行。

Features include:

功能包括:

  • Universal – works for any tools or files on any URL

    通用-适用于任何URL上的任何工具或文件
  • Directory scanning for updating all applicable files in a local directory (including subdirectories)

    目录扫描,用于更新本地目录(包括子目录)中的所有适用文件
  • Automatic unzipping and extraction

    自动解压缩和提取
  • Direct URL downloads for single file updates

    直接URL下载以进行单个文件更新
  • Case conversion for websites where URLs are case sensitive

    URL区分大小写的网站的大小写转换
  • New file detection for only updating newer versions

    新文件检测仅用于更新较新的版本
  • Automatic shutdown and restart of running applications which need to be updated

    自动关闭并重新启动正在运行的需要更新的应用程序
  • Can be run on demand or automated

    可以按需运行或自动化

There are more features included which are documented in the script file. Just open it in Notepad (or any other text editor) to view all the options.

脚本文件中记录了其中包含的更多功能。 只需在记事本(或任何其他文本编辑器)中将其打开即可查看所有选项。

The UpdateFromWeb script makes use of a couple of external tools which will need to be on your system prior to use. The download links for these tools are provided below and need to be placed in a folder in your system’s PATH variable (if in doubt, just put these required files in C:\Windows).

UpdateFromWeb脚本使用了一些外部工具,使用前它们必须在系统上。 这些工具的下载链接在下面提供,并且需要放置在系统PATH变量中的文件夹中(如有疑问,只需将这些必需的文件放在C:\ Windows中)。

不仅仅是工具或应用程序 (Not Just for Tools or Applications)

As mentioned above, the UpdateFromWeb script can be used for any file which has a consistent URL. For example, if a project is updated nightly using the URL mysite.com/project.zip, you can use the UpdateFromWeb script to automatically download and extract the zip file to a local folder on your machine.

如上所述,UpdateFromWeb脚本可用于任何具有一致URL的文件。 例如,如果使用URL mysite.com/project.zip每晚更新项目,则可以使用UpdateFromWeb脚本自动下载zip文件并将其解压缩到计算机上的本地文件夹中。

On a similar note, you can use the script to keep files and/or tools consistent across multiple machines. Just upload a file to a central location and an automated process running UpdateFromWeb can handle the rest.

类似地,您可以使用脚本使多台计算机上的文件和/或工具保持一致。 只需将文件上传到中央位置,运行UpdateFromWeb的自动化流程即可处理其余的工作。

例子 (Examples)

The UpdateFromWeb script can be both used from the command line or hardcoded. Additionally, you can mix and match as needed.

UpdateFromWeb脚本既可以从命令行使用,也可以硬编码。 此外,您可以根据需要混合和匹配。

Below are some examples which demonstrate the usage as well as the respective execution settings for both the command line and hardcode.

下面是一些示例,这些示例演示了命令行和硬代码的用法以及相应的执行设置。

Update all SysInternals tools located in “C:\My Tools” and restart any running applications which were updated:

更新位于“ C:\ My Tools”中的所有SysInternals工具,然后重新启动所有已更新的正在运行的应用程序:

Command line:

命令行:

UpdateFromWeb /U:http://live.sysinternals.com/tools /D /R “/T:C:\My Tools”

UpdateFromWeb /U:http://live.sysinternals.com/tools / D / R“ / T:C:\ My Tools”

Hardcode:

硬编码:

SET URL=http://live.sysinternals.com/tools

设置URL = http://live.sysinternals.com/tools

SET TargetDir=C:\My Tools

SET TargetDir = C:\我的工具

SET UpdateDir=1

SET UpdateDir = 1

SET RestartStopped=1

SET RestartStopped = 1

Update all Nirsoft tools located in “C:\My Tools” and all subdirectories:

更新位于“ C:\ My Tools”和所有子目录中的所有Nirsoft工具:

Command line:

命令行:

UpdateFromWeb /U:http://www.nirsoft.net/utils /D /S /Z /L “/T:C:\My Tools”

UpdateFromWeb /U:http://www.nirsoft.net/utils / D / S / Z / L“ / T:C:\ My Tools”

Hardcode:

硬编码:

SET URL=http://www.nirsoft.net/utils

设置URL = http://www.nirsoft.net/utils

SET TargetDir=C:\My Tools

SET TargetDir = C:\我的工具

SET UpdateDir=1

SET UpdateDir = 1

SET Recurse=1

SET递归= 1

SET ToLower=1

SET ToLower = 1

SET Unzip=1

SET解压缩= 1

SET RestartStopped=1

SET RestartStopped = 1

Update the file named “Specs.doc” from mysite.com and copy it to “C:\Files\Latest Specs.pdf”:

从mysite.com更新名为“ Specs.doc”的文件,并将其复制到“ C:\ Files \ Latest Specs.pdf”:

Command line:

命令行:

UpdateFromWeb /U:http://mysite.com/Specs.pdf “/F:Latest Specs.pdf” /T:C:\Files

UpdateFromWeb /U:http://mysite.com/Specs.pdf“ / F:最新Specs.pdf” / T:C:\ Files

Hardcode:

硬编码:

SET URL=http://mysite.com/Specs.pdf

SET URL = http://mysite.com/Specs.pdf

SET TargetDir=C:\Files

SET TargetDir = C:\ Files

SET FileToGet=Latest Specs.pdf

SET FileToGet =最新规格.pdf

Update the files in the “C:\Files” directory with latest files from Specs.zip on mysite.com:

使用mysite.com上Specs.zip中的最新文件更新“ C:\ Files”目录中的文件:

Command line:

命令行:

UpdateFromWeb /U:http://mysite.com/Specs.zip /D /N /Z /T:C:\Files

UpdateFromWeb /U:http://mysite.com/Specs.zip / D / N / Z / T:C:\ Files

Hardcode:

硬编码:

SET URL=http://mysite.com/Specs.zip

SET URL = http://mysite.com/Specs.zip

SET TargetDir=C:\Files

SET TargetDir = C:\ Files

SET UpdateDir=1

SET UpdateDir = 1

SET CopyNewFiles=1

SET CopyNewFiles = 1

SET Unzip=1

SET解压缩= 1

Update all files in the “C:\Files” to be in sync with the files stored on mysite.com/files:

更新“ C:\ Files”中的所有文件,使其与mysite.com/files中存储的文件同步:

Command line:

命令行:

UpdateFromWeb /U:http://mysite.com/files” /D /T:C:\Files

UpdateFromWeb /U:http://mysite.com/files” / D / T:C:\ Files

Hardcode:

硬编码:

SET URL=http://mysite.com/files

设置URL = http://mysite.com/files

SET TargetDir=C:\Files

SET TargetDir = C:\ Files

SET UpdateDir=1

SET UpdateDir = 1

Download Update From Web Script

从Web脚本下载更新

Download Download.exe Tool

下载Download.exe工具

Download 7-Zip Command Line Tool

下载7-Zip命令行工具

翻译自: https://www.howtogeek.com/102771/how-to-auto-update-your-system-utilities-or-web-files-with-a-script/

web脚本自动关闭开启服务