Network Deployment Tool (VBScript)

AddThis Social Bookmark Button

The Network Deployment Tool demonstrates how to use PSEXEC, NETSCAN and VBScript to deploy any application, command or script to all computers in the current domain and subnet. This application is ready to use as is and will prompt for users to configure the appropriate target files for deployment.

When you run the application a HTML Deployment Summary window appears to provide you with details on the progress of your deployment and asks for your confirmation.
On each targeted machine your application files are deployed and then executed as you have configured in a batch file included with the deployed files.

This script is designed to be run on a machine in the same subnet as target computers and with administrative rights and has been tested on Windows 7, Windows 8 and Server 2008 although it should also work on XP SP2 and 2003 SP2 or later machines. A sample deployment which simply pops up a message on each computer is included but I have also included additional code for configuring an email to confirm a test deployment without user intervention.

You can print or email the HTML summary window when complete (some code changes required to email to custom address) and it is also saved to file automatically.

When you run the application it extracts itself to your application data folder and automatically launches the deployment script. 
A safety prompt confirmation appears to ensure the script is not accidentally triggered. You are also required to enter your password for confirmation.

On each targeted machine a folder called c:\deploy is created containing files from the deploy folder configured when you run the application which are then automatically executed.

To deploy to all computers successfully this script should be run on a machine in the same subnet as target computers with domain administration rights to allow installation and execution on all computers.

A sample deployment script is included which runs a demonstration message on each targeted machine to indicate successful deployment. The sample script includes code for also sending an email from each targeted machine to indicate successful deployment (email requires modification of samplemail.vbs file).

The display window will close automatically once complete. Reports are saved in the application folder.

WARNING: This script has the potential to execute any application on all machines in a network. Used incorrectly, PSEXEC can open up a potential security risk and can cause adverse affects. Please test carefully prior to deployment to a live environment. If you launch applications that are not configured to run hidden then the user will see the activity on their screen. In these situations it would be advisable to notify users or perform these activities after hours as it will interrupt their operations and they may close your program.

How it works:

Executing the Network Deployment Tool extracts all the files to %APPDATA%\networkdeploy.
A subfolder called deploy is created to contain the target files for deployment.

On execution the script launches an HTML window to show progress and prompts the user for confirmation and their current password.
The script then runs a network scan with preconfigured settings to generate a CSV file of identified targets.
The script then copies the deploy subfolder to all target computers as c:\deploy.
The script then runs PSEXEC to execute the deploy.cmd batch file in the deploy folder on each target machine identified that belongs to the same domain.

On completion the target CSV file and a HTML summary are saved to the deployment tool folder and the user is prompted to email these as well.

What's in the application:

  • deploy folder
    • deploy.cmd (required starting file to trigger execution of your custom commands on the client machine)
    • samplemail.vbs (Sample Code to test deployment script)
  • cjd.ico (icon for executable)
  • netscan.exe (SoftPerfect Network Scanner)
  • netscan.ini (SoftPerfect Network Scanner Settings)
  • network-deploy.vbs (The Network Deployment Tool)
  • PsExec.exe (SysInternals PSExec)
  • START.cmd (required starting file to trigger execution of Network Deployment Tool)

Accessing the code

Download and run the application attached at the end of this article but select 'NO' when prompted to proceed by the application. The deployed files folder should open automatically. In the address bar of windows explorer go up one folder to find the main source code and files.

If this window does not open you can also access these files by opening the folder %appdata%\networkdeploy. You can do this quickly by typing this in the start box or the address bar in windows explorer.

Third Party Components:

NETSCAN.exe The SoftPerfect network scanner is used to generate the data required to identify target machines. To modify the custom settings configured for this application run the executable using the command "netscan.exe /ini" which will load the settings from the ini file. These specify the fields to be reported and extracted. Additional fields and data can be configured in this way. The settings are saved in the ini file in the deployment folder which should be included in the deployed software.

PSEXEC.exe SysInternals PSExec is part of the PS Tools suite designed for remote administration and management of Microsoft Windows machines.

Compiling a custom version:

To compile a custom version, run the application but select 'NO' when prompted to proceed.
Open the %APPDATA%\networkdeploy folder. Modify the appropriate files.
Install WINRAR.
Select all files in the deployment folder including the deploy subfolder. Right click and choose 'Add to Archive'.
In WINRAR set the following options:
* GENERAL TAB -  RAR/Best Compression/Create SFX Archive/Create Solid Archive
* FILES TAB -  Store Relative File Paths
* ADVANCED TAB - Press SFX Options button
>  GENERAL TAB - Path to Extract: %APPDATA%\networkdeploy (Absolute Path)
>  SETUP TAB - Run After Extraction: %APPDATA%\networkdeploy\START.cmd
>  MODES TAB - Hide All
>  TEXT AND ICON TAB - Load SFX Icon from file: cjd.ico
>  UPDATE TAB - Extract and replace files/Overwrite all files
Press OK to create your archive.

This will generate a new EXE file you can use to deploy your custom version of this application.


This demonstrates a range of functions including WMI, reading and saving files using FileSystemObject, Sending Email using CDO with attachments, Generating HTML in vbscript, Using a progress bar in vbscript and Using the Shell to run commands and applications.

See 'Accessing the Code' to get access to all of the files required to execute and implement this script.

Download this file (networkdeploy.exe)networkdeploy.exe952 kB2012-08-21

Only members can add comments. Becoming a member is free. See the Members section for more information.