This VBScript simplifies the use of the application Problem Steps Recorder with a step-by-step workflow.
Supported Windows versions:
- Microsoft Windows 7 or higher
- Microsoft Windows 2008 R2 or higher
ProblemStepsRecorderHelper_v1.0.vbs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
' ############################################################################## ' # Lupi Gabriel # ' # www.lupigabriel.it # ' # info@lupigabriel.it # ' ############################################################################## ' # Copyright (c) 2014 Lupi Gabriel All rights reserved. # ' ############################################################################## ' # NAME : Problem Steps Recorder Helper # ' # VERSION : 1.0 # ' # FILE : ProblemStepsRecorderHelper_v1.0.vbs # ' # CLASS : Script # ' # LANGUAGE : VB Script # ' ############################################################################## On Error Resume Next Set objFSO = CreateObject("Scripting.FileSystemObject") Set objShell = CreateObject("WScript.Shell") If objFSO.FileExists(objShell.ExpandEnvironmentStrings("%SystemRoot%") & "\System32\psr.exe") = False Then Result = MsgBox("Warning! This Windows version is not supported!", vbOKOnly+vbExclamation, "Problem Steps Recorder Helper - Warning") Wscript.Quit End If If objFSO.FileExists(objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\PSR\" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip") = True Then objFSO.DeleteFile objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\PSR\" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip" End If Result = MsgBox("This application enable you to record their interactions with an application and provide a detailed screen-by-screen view with accompanying information. Learn how the recording can be used to quickly identify problems and help reduce time spent with the help desk." & vbCrLf & vbCrLf & "Typed data are not recorded, but if necessary you can use the" & vbCrLf & "[ Add Comment ] on the pop-up to add a description to the step." & vbCrLf & vbCrLf & "Close the pop-up recording when the procedure is finished.", vbOKCancel+vbInformation, "Problem Steps Recorder Helper - Info") If Result = 2 Then Wscript.Quit End If Result = MsgBox("Warning! Typed data are not recorded, however you have to be careful for confidential information that may be recorded in the captured screens!", vbOKCancel+vbExclamation, "Problem Steps Recorder Helper - Warning") If Result = 2 Then Wscript.Quit End If If objFSO.FolderExists(objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\PSR") = False Then objFSO.CreateFolder objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\PSR" End If objShell.run "psr.exe /start /output """ & objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\PSR\" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip""",1,1 If objFSO.FileExists(objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\PSR\" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip") = True Then Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set colProcessList = objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'OUTLOOK.EXE'") CheckOutlook = 0 For Each objProcess in colProcessList colProperties = objProcess.GetOwner(strNameOfUser,strUserDomain) If strNameOfUser = objShell.ExpandEnvironmentStrings("%USERNAME%") Then CheckOutlook = 1 Result = MsgBox("Do you want to send this registration with Outlook?", vbOKCancel+vbInformation, "Problem Steps Recorder Helper - Send") If Result = 1 Then Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.CreateItem(olMailItem) myItem.Attachments.Add(objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\PSR\" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip") myItem.Display Else objFSO.MoveFile objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\PSR\" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip", objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Desktop\" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip" Result = MsgBox("The recording is saved on your Desktop in the file named ''" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip'' and path of the file has been copied to your clipboard.", vbOKOnly+vbInformation, "Problem Steps Recorder Helper - Save") Set oExec = objShell.Exec("clip") Set oIn = oExec.stdIn oIn.WriteLine objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Desktop\" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip" oIn.Close Set oIn = Nothing Set oExec = Nothing End If End If Next If CheckOutlook = 0 Then objFSO.MoveFile objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\PSR\" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip", objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Desktop\" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip" Result = MsgBox("The recording is saved on your Desktop in the file named ''" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip'' and path of the file has been copied to your clipboard.", vbOKOnly+vbInformation, "Problem Steps Recorder Helper - Save") Set oExec = objShell.Exec("clip") Set oIn = oExec.stdIn oIn.WriteLine objShell.ExpandEnvironmentStrings("%USERPROFILE%") & "\Desktop\" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip" oIn.Close Set oIn = Nothing Set oExec = Nothing End If Else Result = MsgBox("Warning! The recording has not been created!", vbOKOnly+vbExclamation, "Problem Steps Recorder Helper - Warning") End If WScript.Sleep(3000) If objFSO.FileExists(objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\PSR\" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip") = True Then objFSO.DeleteFile objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\PSR\" & objShell.ExpandEnvironmentStrings("%COMPUTERNAME%") & "_" & objShell.ExpandEnvironmentStrings("%USERNAME%") & "_psr.zip" End If Set myItem = Nothing Set myOlApp = Nothing Set colProcessList = Nothing Set objWMIService = Nothing Set objShell = Nothing Set objFSO = Nothing |