I am trying to package up Symantec Endpoint Encryption… One of the things that needs done prior to install is having a vbs script run which prompts the user to click OK…
Here is the script that runs when clicking ok:
' Copyright (C) 2014 Symantec Corporation. All rights reserved.
'
' THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE SECRETS OF SYMANTEC
' CORPORATION. USE, DISCLOSURE OR REPRODUCTION IS PROHIBITED WITHOUT THE PRIOR
' EXPRESS WRITTEN PERMISSION OF SYMANTEC CORPORATION.
'
' The Licensed Software and Documentation are deemed to be commercial computer
' software as defined in FAR 12.212 and subject to restricted rights as defined
' in FAR Section 52.227-19 "Commercial Computer Software - Restricted Rights"
' and DFARS 227.7202, "Rights in Commercial Computer Software or Commercial
' Computer Software Documentation", as applicable, and any successor
' regulations. Any use, modification, reproduction release, performance,
' display or disclosure of the Licensed Software and Documentation by the
' U.S. Government shall be solely in accordance with the terms of this
' Agreement.
'
' Modified to only shutdown processes.
Const DISPLAYTIME = 1
Set objShell = Wscript.CreateObject( "WScript.Shell" )
Set WshShell = Wscript.CreateObject( "WScript.Shell" )
Set objFSO = CreateObject("Scripting.FileSystemObject")
objShell.Popup "ATTENTION: This install will stop and close PGP AND OUTLOOK. Please Save and close anything you need to prior to Clicking OK to Continue."
' Check to see if tray is running
trayRunning = 0
Set netob = CreateObject( "Wscript.Network" )
Set service = GetObject ("winmgmts:")
For Each Process in Service.InstancesOf ("Win32_Process")
If (Process.Name = "PGPtray.exe") Or (Process.Name = "PGPdesk.exe") Or (Process.Name="OUTLOOK.EXE") Then
pOwner = Process.GetOwner(userName, userDomain)
' Only kill the process if we own it
If userName = netob.UserName Then
trayPath = Process.ExecutablePath
End If
If Process.Terminate() <> 0 Then
Wscript.echo "ERROR: Unable to kill process " & Process.Name & ", cannot continue; Please Contact Helpdesk for assistance."
Wscript.quit
End If
trayRunning = 1
End If
Next
dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
dim strdir
set WshShell2 = WScript.CreateObject("WScript.Shell")
'pgp corporation folder backup and if desired deletion
strdir = WshShell2.ExpandEnvironmentStrings("%appdata%")
dim strdir2
strdir2 = strdir & "\PGP Corporation\PGP"
dim strdir3
strdir3 = strdir2 & "_" & Right("0" & Month(Now), 2) & "-" & Right("0" & Day(Now), 2) & "-" & Year(Now) & "-" & Hour(Now) & "-" & Minute(Now)
If filesys.FolderExists(strdir2) Then
If filesys.FolderExists(strdir3) Then
filesys.DeleteFolder strdir3
End If
filesys.CopyFolder strdir2, strdir3
' uncomment following line if you need to delete the PGP Corporation\PGP folder.
'filesys.DeleteFolder strdir2
End If
'delete user\pgp backup and if desired deletion folder
strdir = WshShell2.ExpandEnvironmentStrings("%USERPROFILE%")
strdir2 = strdir & "\PGP"
strdir3 = strdir2 & "_" & Right("0" & Month(Now), 2) & "-" & Right("0" & Day(Now), 2) & "-" & Year(Now) & "-" & Hour(Now) & "-" & Minute(Now)
If filesys.FolderExists(strdir2) Then
If filesys.FolderExists(strdir3) Then
filesys.DeleteFolder strdir3
End If
filesys.CopyFolder strdir2, strdir3
' uncomment following line if you need to delete the user\PGP folder.
'filesys.DeleteFolder strdir2
End If
I would just use PSADT’s feature of closing applications but this script appears to do a little more…
I tried using this code:
Execute-ProcessAsUser -Path 'cscript.exe' -Parameters '"$dirSupportFiles\Close_PGP_outlook.vbs"'
Here is the output:
[Pre-Installation] :: Create scheduled task to run the process [cscript.exe "$dirSupportFiles\Close_PGP_outlook.vbs"] as the logged-on user [Domain\User]... Execute-ProcessAsUser 6/24/2020 3:17:15 PM 105288 (0x19B48)
[Pre-Installation] :: [C:\WINDOWS\System32\schtasks.exe] is a valid fully qualified path, continue. Execute-Process 6/24/2020 3:17:15 PM 105288 (0x19B48)
[Pre-Installation] :: Working Directory is [C:\WINDOWS\System32]. Execute-Process 6/24/2020 3:17:15 PM 105288 (0x19B48)
[Pre-Installation] :: Executing [C:\WINDOWS\System32\schtasks.exe /create /f /tn PSAppDeployToolkit-ExecuteAsUser /xml "C:\Users\Public\PSAppDeployToolkit\PSAppDeployToolkit-ExecuteAsUser.xml"]... Execute-Process 6/24/2020 3:17:15 PM 105288 (0x19B48)
[Pre-Installation] :: Execution completed with exit code [0]. Execute-Process 6/24/2020 3:17:15 PM 105288 (0x19B48)
[Pre-Installation] :: Trigger execution of scheduled task with command [cscript.exe "$dirSupportFiles\Close_PGP_outlook.vbs"] as the logged-on user [Domain\user]... Execute-ProcessAsUser 6/24/2020 3:17:15 PM 105288 (0x19B48)
[Pre-Installation] :: [C:\WINDOWS\System32\schtasks.exe] is a valid fully qualified path, continue. Execute-Process 6/24/2020 3:17:15 PM 105288 (0x19B48)
[Pre-Installation] :: Working Directory is [C:\WINDOWS\System32]. Execute-Process 6/24/2020 3:17:15 PM 105288 (0x19B48)
[Pre-Installation] :: Executing [C:\WINDOWS\System32\schtasks.exe /run /i /tn PSAppDeployToolkit-ExecuteAsUser]... Execute-Process 6/24/2020 3:17:15 PM 105288 (0x19B48)
[Pre-Installation] :: Execution completed with exit code [0]. Execute-Process 6/24/2020 3:17:15 PM 105288 (0x19B48)
[Pre-Installation] :: Delete scheduled task [PSAppDeployToolkit-ExecuteAsUser]. Execute-ProcessAsUser 6/24/2020 3:17:16 PM 105288 (0x19B48)
[Pre-Installation] :: [C:\WINDOWS\System32\schtasks.exe] is a valid fully qualified path, continue. Execute-Process 6/24/2020 3:17:16 PM 105288 (0x19B48)
[Pre-Installation] :: Working Directory is [C:\WINDOWS\System32]. Execute-Process 6/24/2020 3:17:16 PM 105288 (0x19B48)
[Pre-Installation] :: Executing [C:\WINDOWS\System32\schtasks.exe /delete /tn PSAppDeployToolkit-ExecuteAsUser /f]... Execute-Process 6/24/2020 3:17:16 PM 105288 (0x19B48)
[Pre-Installation] :: Execution completed successfully with exit code [0]. Execute-Process 6/24/2020 3:17:16 PM 105288 (0x19B48)
I do see a window flash quickly but no option to click OK…
Any ideas? Thanks