Script to patch windows servers save as a ,bat using pstools

from here down save as .bat

____________________________________

@ECHO OFF

cd

c:

CD\pstools

:MENU

ECHO ============= MENU NAME =============

ECHO ————————————-

ECHO 11111    Description

ECHO ==========PRESS ‘Q’ TO QUIT==========

ECHO.

SET INPUT=

SET /P INPUT=Please select a number:

IF /I ‘%INPUT%’==’11111’ GOTO Selection11111

IF /I ‘%INPUT%’==’Q’ GOTO Quit

CLS

ECHO ============INVALID INPUT============

ECHO ————————————-

ECHO Please select a number from the Main

echo Menu [1-9] or select ‘Q’ to quit.

ECHO ————————————-

ECHO ======PRESS ANY KEY TO CONTINUE======

PAUSE > NUL

GOTO MENU

:Selection11111

c:\pstools\script.exe

psexec.exe command

pause

exit

exit

ECHO ==============THANKYOU===============

ECHO ————————————-

ECHO ======PRESS ANY KEY TO CONTINUE======

PAUSE>NUL

EXIT

From here down save as .vbs

___________________________________

On Error Resume Next

Const ForReading = 1

Const OverwriteExisting = TRUE

dim filesys, newfolder

Set objFSO = CreateObject(“Scripting.FileSystemObject”)

Set objFile = objFSO.OpenTextFile(“c:\where is the machine txt at”)

msgbox “Start patch 1 loading.”

Do Until objFile.AtEndOfStream

strComputer = objFile.ReadLine

If Not filesys.FolderExists(“\\” & strComputer & “\C$\Temp”) Then

Set newfolder = filesys.CreateFolder(“\\” & strComputer & “\C$\Temp”)

End If

strRemoteFolder = “\\” & strComputer & “\C$\Temp”

objFSO.copyFolder “c:\where is the software folder at”, strRemoteFolder, OverwriteExisting

reponse.write(“done & strComputer”)

Loop

msgbox “Patch 1 done with load.”

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.