Question : PPT Taskkill Command VBS MsgBox

I need to add a Kill command to the below MsgBox. If the user clicks Cancel I want the ppt on the desktop to stop.

Here is the Kill command: Taskkill /f /im POWERPNT.EXE

Dim strMbox


            strMbox = MsgBox("You have 10 days to take the training or your account will be locked. Click OK to start the training or Click Cancel to take the training at the next login.", _
                vbQuestion + vbOKCancel, _
                "IMPORTANT Mandatory Training")

Answer : PPT Taskkill Command VBS MsgBox

So next add this to your declared variable:
Dim oShell

Then add this under the last line of your script:

If strMbox = "vbcancel" Then
Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run "cmd /c Taskkill /f /im POWERPNT.EXE"
Set oShell = Nothing
End If
Random Solutions  
 
programming4us programming4us