CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Aug 2013

    MsgBox while Windows update

    Hi gurus

    I have a serious problem with our javaupdates. To solve it i built a WSUS package and included a vbs script to kill all disturbing processes, which works great. But now I need a MsgBox to have the user confirmed killing his browsers processes or not and interestingly enought it works on a Win vista 32bit mashine. Not on a Win 7 64bit machine.

    On Error Resume Next
    'Object declaration
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("WScript.Shell")
    Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
    Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
    ' Constante
    const HKEY_CURRENT_USER = &H80000001
    const HKEY_LOCAL_MACHINE = &H80000002
    ' Bypass IE Zone Security Checking
    Set oEnv = objShell.Environment("PROCESS")
    ' BODY 
    If MsgBox("Java installieren und alle Browser schließen?", vbQuestion + vbYesNo, "Wichtiges Javaupdate!! by treefish ;)") = vbNo Then
    	'Befehl zum Beenden des Updates
    	objShell.Run "net stop wuauserv", 0, True
    	'Browser und Java werden abgeschossen
    	objShell.Run "TASKKILL /F /T /IM chrome.exe /IM iexplore.exe /IM java.exe /IM jusched.exe /IM jp2launcher.exe", 0, True
    End If
    Name:  halt.png
Views: 173
Size:  12.1 KB
    Please see my attached file to see the result; the patch just halts and is doing nothing anymore.

    Thanks in advance for any help,


  2. #2
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008

    Re: MsgBox while Windows update

    I notice your first line is On Error Resume next

    This basically tells it that you do not want to know if any errors occur just pretend like they did not happen and keep going. Not a good idea.

    Aside from that I assume you mean that your update is hanging and if that be the case why would you think the VB Script is doing it? More likely a problem with the update program.
    Although it does look like you are killing a couple of Java related tasks as well so maybe that could be an issue.

    Hard to say as I do not do Java and I do not do scripting for stuff like this.
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Jan 2006
    Fox Lake, IL

    Re: MsgBox while Windows update

    why kill java updates in the first place?

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  4. #4
    Join Date
    Aug 2013
    Dallas, TX

    Re: MsgBox while Windows update

    Interesting article regarding Java from Microsoft’s view point.
    Most Java updates don’t remove older versions when updating, leaving a computer vulnerable with the older versions still installed.


    Best of luck!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.