• ARTICLES
SEARCH

How-To Geek

Batch Script to Auto Update Sysinternals Tools

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.

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.

Here is how it works:

  • The current list of tools from Sysinternals is downloaded and compared to the files on your system.
  • If a match is found, the current version from Sysinternals is copied to your system.
  • 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

Jason Faulkner is a developer and IT professional who never has a hot cup of coffee far away. Interact with him on Google+

  • Published 07/27/10

Comments (18)

  1. Shaun

    I usually schedule this every month or so within the folder of all my SysInternals tools.
    —–
    wget.exe http://download.sysinternals.com/Files/SysinternalsSuite.zip
    7za.exe x SysinternalsSuite.zip -y
    del SysinternalsSuite.zip
    —–

  2. JJ

    Just a small hint:
    command L does not exist ;)
    But still, nice script, will let it run on schedule on our server. Thanks

  3. The How-To Geek

    @JJ

    Oops! Fixed the post.

  4. Adam

    I just do:
    robocopy \live.sysinternals.comTools sysinternals /MIR

    It won’t do the fancy stopping and starting running processes thing though

  5. Spencer

    This is a great script. Love the start/stop stuff too!

  6. joe

    filehippo will check these and provide you with download links

  7. David

    Here is my old script… http://getsysinternals.codeplex.com/

    It is meant to be scheduled, it will download only updated utils and notify you about updated on over email. But I guess with the broadband simple xcopy/robocopy is better solution. But back in the days… ;)

  8. EY

    This will do work wget -r http://live.sysinternals.com/

  9. Scott Fenton

    Yeah I wrote one too a while back… turns out the console version of wget has this feature built in…. :)

    Have a look-see for anyone interested. The script is only a few lines but requires wget.exe and a date stamper so that the date is stamped onto the name of the file.

    Check it out…. Let me know if anyone likes it…….

    http://drop.io/SysDownUp

  10. Kut

    http://www.kls-soft.com/wscc/index.php
    I use it as a portable version and on my thumbdrive/dropbox

  11. Mensch

    I receive this message when I execute the sysinternals update batch file within my sysinternals folder:

    windows cannot access \live.sysinternals.comtools

    The error code is 80070043.

    I have been searching daily for a solution since I read this article.

  12. Tom

    Nice, but using PowerShell would have been more state-of-the-art …

  13. Nick

    “I receive this message when I execute the sysinternals update batch file within my sysinternals folder:

    windows cannot access \live.sysinternals.comtools

    The error code is 80070043.

    I have been searching daily for a solution since I read this article.”

    Same issue here.

    Anyone know the problem and solution?

  14. Fin

    The batch script just caused my computer to lock up. Any explanation for what caused my computer to lock up?

  15. sulasno

    I wonder what’s the difference between mine and Shaun ?

    wget -O “%userprofile%desktopSoftwareSysinternalsSuiteSysinternalsSuite.zip” http://download.sysinternals.com/Files/SysinternalsSuite.zip
    PATH=%PATH%;”C:Program Files7-Zip”
    CD /D %userprofile%desktopSoftwareSysinternalsSuite
    7z x -aoa SysinternalsSuite.zip
    DEL SysinternalsSuite.zip

  16. piersh
  17. grommit

    SET LiveShare=\\live.sysinternals.com\tools

    that works or, if bandwidth isnt much of an issues, or if you arent running procmon or procexp all the time, use xcopy /d /u /v /z /y \\live.sysinternals.com\tools\*

  18. surfasb

    Here is a corresponding PowerShell Script. It also creates an INF file that install them into the Startmenu along with an Uninstall entry.

Enter Your Email Here to Get Access for Free:

Go check your email!