Solved

Run this batch code in all machines

Posted on 2011-09-20
1
448 Views
Last Modified: 2012-06-21
Hi,

Run this batch code in all machines
Can anyone help with a way
Thanks
@echo off
echo+
echo ** Running Malwarebytes' Anti-Malware installation batch script **
%~d0
cd %~dp0
\\isiosl\mbam-setup.exe /NOCANCEL /NORESTART /VERYSILENT /SP- /SUPPRESSMSGBOXES
ping -n 6 -w 1000 1.1.1.1 >NUL
IF DEFINED programfiles(x86) (cd "%programfiles(x86)%\Malwarebytes' Anti-Malware") ELSE (cd "%programfiles%\Malwarebytes' Anti-Malware")
START /WAIT mbam.exe /register 4WF67-S87DH A5E5-FFCK-E72H-G9HQ
START /WAIT mbam.exe /hideregistration
START /WAIT mbam.exe /update -silent
START /WAIT mbam.exe /schedule /update /silent /daily /wakefromsleep /every 1 /starting 07/01/2011 04:30:00 /recover 23 /random
START /WAIT mbam.exe /schedule /scan -quick -remove -terminate -log -reboot /wakefromsleep /silent /daily /every 1 /starting 07/01/2011 02:00:00 /recover 23
SC QUERY MBAMSERVICE >NUL | FIND "RUNNING"
IF %ERRORLEVEL% == 0 GOTO :REGISTERED
:NONREGISTERED
START /WAIT mbamgui.exe /install /silent
START mbamgui.exe /starttray /silent
GOTO :DONE
:REGISTERED
START mbamgui.exe /starttray /silent
GOTO :DONE
:DONE

Open in new window

0
Comment
Question by:bsharath
1 Comment
 
LVL 9

Accepted Solution

by:
Lester_Clayton earned 500 total points
ID: 36571861
Place your batch file in a central location - perhaps in the same area where the users run mbam-setup.exe from. Create a file containing a list of all the computer names, and then use PSEXEC to parse the list and execute the application on all machines.

Sample:

psexec @computerlist.txt \\isiosl\Distro\Malwarebytes\MalwareInstall.cmd

Open in new window


PSEXEC can be obtained from www.sysinternals.com

I'd recommend running PSEXEC /? to see all the arguments the program will supply, but in a pinch you probably only need to use the @file one.  You will also need to accept the license agreement the first time you run it.

Naturally, just put 1 computer name in the computer file to ensure it works before putting them all in.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question