sysinternals_批处理脚本以自动更新Sysinternals工具

sysinternals

sysinternals

While the Microsoft Sysinternals tools are incredibly powerful and useful, the one feature they lack is the ability to check for new versions. Currently, you have to periodically check the Sysinternals site and compare versions between your system and the most recent official release in order to stay up to date.

尽管Microsoft Sysinternals工具功能强大且实用,但是它们缺少的一项功能是能够检查新版本。 当前,您必须定期检查Sysinternals站点并比较系统和最新正式发行版之间的版本,以保持最新状态。

As a better solution, we have created a batch script which will automatically update the Sysinternals tools you have on your system. All you have to do is put the batch script file into the folder where your Sysinternals tools are located and the script does the rest, no configuration is needed.

作为更好的解决方案,我们创建了一个批处理脚本,该脚本将自动更新您系统上的Sysinternals工具。 您所要做的只是将批处理脚本文件放入Sysinternals工具所在的文件夹中,其余部分由脚本执行,无需进行配置。

Here is how it works:

下面是它的工作原理:

  • The current list of tools from Sysinternals is downloaded and compared to the files on your system.

    Sysinternals的当前工具列表已下载,并与系统上的文件进行比较。
  • If a match is found, the current version from Sysinternals is copied to your system.

    如果找到匹配项,则会将Sysinternals中的当前版本复制到您的系统中。
  • If a tool is currently running, it is closed and then restarted once the script completes.

    如果当前正在运行工具,则在脚本完成后将其关闭,然后重新启动。

剧本 (The Script)

@ECHO OFF
TITLE Sysinternals Updater
ECHO Sysintenals Updater
ECHO Written by: Jason Faulkner
ECHO SysadminGeek.com
ECHO.
ECHO.

SETLOCAL ENABLEDELAYEDEXPANSION

SET SysInternalsTools="%Temp%SysInternalsTools.tmp.txt"
SET CurrentTasks="%Temp%CurrentTasks.tmp.txt"
SET StartWhenFinished="%Temp%StartWhenFinished.tmp.txt"

ECHO Detected directory: %~dp0
%~d0
CD %~p0
ECHO.
ECHO.

ECHO Downloading current tool list...
SET LiveShare=\live.sysinternals.comtools
START /MIN %LiveShare%
DIR %LiveShare% /B > %SysInternalsTools%
TASKLIST > %CurrentTasks%
ECHO ;Terminated tools > %StartWhenFinished%

ECHO.
ECHO Updating installed SysInternals tools
FOR /F %%A IN ('DIR /B') DO (
   FOR /F "usebackq" %%B IN (%SysInternalsTools%) DO (
      IF /I [%%A]==[%%B] (
         ECHO Updating %%A
         FOR /F "usebackq" %%C IN (%CurrentTasks%) DO (
            IF /I [%%A]==[%%C] (
               ECHO %%C is currently running, killing process - queue restart
               ECHO %%C >> %StartWhenFinished%
               TASKKILL /IM %%A /T /F
            )
         )
         XCOPY %LiveShare%%%B %%A /Y
         ECHO.
      )
   )
)

ECHO.
ECHO Resuming killed tasks
FOR /F "usebackq skip=1" %%A IN (%StartWhenFinished%) DO (
   ECHO Starting %%A
   START "Sysinternals Tool" "%%A"
)

IF EXIST %SysInternalsTools% DEL %SysInternalsTools%
IF EXIST %CurrentTasks% DEL %CurrentTasks%
IF EXIST %StartWhenFinished% DEL %StartWhenFinished%

ENDLOCAL

ECHO.
PAUSE

链接 (Links)

Download Sysinternals Updater Script from Sysadmin Geek

从Sysadmin Geek下载Sysinternals Updater脚本

翻译自: https://www.howtogeek.com/50356/batch-script-to-auto-update-sysinternals-tools/

sysinternals

Optimize Windows system reliability and performance with Sysinternals IT pros and power users consider the free Windows Sysinternals tools indispensable for diagnosing, troubleshooting, and deeply understanding the Windows platform. In this extensively updated guide, Sysinternals creator Mark Russinovich and Windows expert Aaron Margosis help you use these powerful tools to optimize any Windows system’s reliability, efficiency, performance, and security. The authors first explain Sysinternals’ capabilities and help you get started fast. Next, they offer in-depth coverage of each major tool, from Process Explorer and Process Monitor to Sysinternals’ security and file utilities. Then, building on this knowledge, they show the tools being used to solve real-world cases involving error messages, hangs, sluggishness, malware infections, and much more. Windows Sysinternals creator Mark Russinovich and Aaron Margosis show you how to: Use Process Explorer to display detailed process and system information Use Process Monitor to capture low-level system events, and quickly filter the output to narrow down root causes List, categorize, and manage software that starts when you start or sign in to your computer, or when you run Microsoft Office or Internet Explorer Verify digital signatures of files, of running programs, and of the modules loaded in those programs Use Autoruns, Process Explorer, Sigcheck, and Process Monitor features that can identify and clean malware infestations Inspect permissions on files, keys, services, shares, and other objects Use Sysmon to monitor security-relevant events across your network Generate memory dumps when a process meets specified criteria Execute processes remotely, and close files that were opened remotely Manage Active Directory objects and trace LDAP API calls Capture detailed data about processors, memory, and clocks Troubleshoot unbootable devices, file-in-use errors, unexplained communication, and many other problems Understand Windows core concepts that aren’t well-documented elsewhere Table of Contents PART I: GETTING STARTED Chapter 1 Getting started with the Sysinternals utilities Chapter 2 Windows core concepts Chapter 3 Process Explorer Chapter 4 Autoruns PART II: USAGE GUIDE Chapter 5 Process Monitor Chapter 6 ProcDump Chapter 7 PsTools Chapter 8 Process and diagnostic utilities Chapter 9 Security utilities Chapter 10 Active Directory utilities Chapter 11 Desktop utilities Chapter 12 File utilities Chapter 13 Disk utilities Chapter 14 Network and communication utilities Chapter 15 System information utilities Chapter 16 Miscellaneous utilities PART III: TROUBLESHOOTING—“THE CASE OF THE UNEXPLAINED…” Chapter 17 Error messages Chapter 18 Crashes Chapter 19 Hangs and sluggish performance Chapter 20 Malware Chapter 21 Understanding system behavior Chapter 22 Developer troubleshooting
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值