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

    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.

    Code:
    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")
    oEnv("SEE_MASK_NOZONECHECKS") = 1
    
    '---------------------------------------------------------------------------------
    ' 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
    Else
    	'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: 730
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,

    Regards,
    Bent

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    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
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: MsgBox while Windows update

    why kill java updates in the first place?
    David

    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
    Location
    Dallas, TX
    Posts
    2

    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.

    http://www.zdnet.com/microsoft-updat...it-7000001650/

    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
  •  





Click Here to Expand Forum to Full Width

Featured