<

Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x

Software Installation Remotely {through Script}

Published on
10,908 Points
4,908 Views
Last Modified:
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this is the only way to perform such activities but as I am fond of writing scripts and love to do work remotely without disturbing the users {and most importantly it is easy} so here is my way of installing software via script

Prerequisites

Administrative privileges on the system on which you want to install the software
WMIC (Windows Management Instrumentation Console)
Text Editor (NotePad, WordPad etc)
Xcopy(for copying installation files into the system)
MSI (Microsoft software installer file of desired software)

Code:

@EchO off
SET /P tsystem=Enter Target system:
EchO.
XCopy "\\Source Path\*.*" "\\%tsystem%\target path\*.*" /E /C /H /R /Y
WMIC /Node:"%tsystem%" product call install true,"","Target Path\MSI file"
RD /S /Q "\\%tsystem%\d$\Folder name"

Explanation:

Open a text editor e.g notepad and type the above code. Firstly set a variable named “tsystem” which will store the target system name on which you want to install the software. Now copy all the installation files of the software in the target system with XCOPY command.
XCopy "\\Source Path\*.*" "\\%tsystem%\target path\*.*" /E /C /H /R /Y

{Note: Here “Source Path\*.* “  shows path of the source folder with all its files and “Target Path\*.*” shows path of target folder and all files}

Once all the files are copied on target system then we have to run WMIC to install the product.

WMIC /Node:"%tsystem%" product call install true,"","Target Path\MSI file"

Here we call the variable %tsystem% which we have declared earlier in the script which stores the target system name.

{Note: You have to give the target path of MSI file of desired software which you want to install}  

Now in last we will remove the directory of installation files from the target system through RD command {so that it will not occupy space of client's HDD}

RD /S /Q "\\%tsystem%\d$\Folder name"

"Folder name" represents the name of installation folder.

Now save the file at your desired location with the extension ".cmd" or ".bat". To execute the command just double click the file and here you go.

Hope this article will help you all for your future installation.
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
0 Comments

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Join & Write a Comment

In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month