Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Patchinst.vbs script

3 views
Skip to first unread message

Sal

unread,
Sep 15, 2003, 1:16:53 PM9/15/03
to
I am using this script to remotely install the patch. I don't know how to
use scripts and was looking for help. I changed the variable to not force a
reboot after patch is installed, but now I want to send a pop message to
that user using that same script stating that I installed a patch and they
need to reboot.
http://support.microsoft.com/default.aspx?scid=kb;[LN];827227


Thanks
Sal


Torgeir Bakken (MVP)

unread,
Sep 15, 2003, 1:27:51 PM9/15/03
to
Sal wrote:

Hi

I would have used the "net send" command to send a message to the remote
computer/user:


Set oShell = CreateObject("WScript.Shell")

sNode = "136.164.48.162" ' IP address or computer name

' Chr(20) vill create a new line in the messenger service dialog box
sMsg = "An important security update is now installed on your computer." _
& Chr(20) & Chr(20) _
& "Please reboot the computer immediately to let it take effect!"

oShell.Run "net.exe send " & sNode & " """ & sMsg & """", 0, False

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter


Sal

unread,
Sep 15, 2003, 1:54:40 PM9/15/03
to
Thanks for the reply

Is there any way for me to use the IPFILE.txt instead of manually having to
enter the IP address for each IP ?

Thanks
Sal


"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
news:3F65F696...@hydro.com...

Torgeir Bakken (MVP)

unread,
Sep 15, 2003, 2:22:05 PM9/15/03
to
Sal wrote:

> Thanks for the reply
>
> Is there any way for me to use the IPFILE.txt instead of manually having to
> enter the IP address for each IP ?

Hi

Below is the code for net send implemented into the (sub)code found at
http://support.microsoft.com/?kbid=827227 so that a message is sent at once when
a successful installation is done.

My inserted code is between

' XXXXXXXXXXX code insert start XXXXXXXXXXX
and
' XXXXXXXXXXX code insert stop XXXXXXXXXXX

Here you go:


' rest of original script above here
else
' Get a reference to the file that was copied.
set odestFile = osvcLocal.get("cim_datafile=""z:\\Patchinst.exe""")

' Wait for the installation to complete.
' Lay and wait--up to two minutes for the installation to complete.
for waitTime = 0 to 120
wscript.Sleep 1000 ' Sleep one second.
' Delete temporary file as soon as possible after it is freed.
if (odestFile.Delete() = 0) then
exit for
end if
next ' Otherwise, loop again and keep waiting...

' XXXXXXXXXXX code insert start XXXXXXXXXXX

' send message to user/computer


Set oShell = CreateObject("WScript.Shell")

' Chr(20) vill create a new line in the messenger service dialog box
sMsg="An important security update is now installed on your computer." _


& Chr(20) & Chr(20) _
& "Please reboot the computer immediately to let it take effect!"

oShell.Run "net.exe send " & ip & " """ & sMsg & """", 0, False

' XXXXXXXXXXX code insert stop XXXXXXXXXXX

wscript.echo "Installation successful."

end if 'Create process succeeded.
' rest of original script below here

Sal

unread,
Sep 15, 2003, 3:10:49 PM9/15/03
to
Thanks Alot!!! That worked perfectly!

Sal
"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message

news:3F66034D...@hydro.com...

0 new messages