Issue Recorder (VBScript)
- Details
- Category: Scripts and Code
- Published on Monday, 27 January 2014 22:11
- Written by Christian Dunn
One of the biggest challenges for IT Support engineer's is understanding the issues that end users are experiencing. Without being able to see their actions getting them to provide the steps they take to perform a function prior to an error occurring is a constant challenge. Fortunately Microsoft have added a fantastic tool called the Problem Steps Recorder to Windows 7 and 8 that solves this challenging by capturing every step that a user takes when replicating an issue.
While this tool is fantastic it is not accessible in the start menu and does not provide a useful wizard to step end users through the process they need to follow to capture then forward their issue steps to your help desk. This script resolves this issue by providing a wizard to capture the steps of a problem and email them to the relevant people in a few simple steps and without any extra programs or plugins required.
This procedure requires Windows 7 or later and Office 2007 or later.
This script uses VBScript but is actually written as a simple batch (.bat) or command (.cmd) file which generates and runs all of the required scripts and functions. Simply copy the code below to notepad and save the file as a batch or command file to run. You can also download the script file as attached.
@ECHO OFF ECHO Launching Issue Recorder ECHO @ECHO OFF > %TEMP%\oneclick-action.cmd ECHO mshta javascript:alert("Welcome to the Issue Recorder\n------------------------------------\nThis will record your actions and prepare an email\nto be sent for support\n------------------------------------\nRequires Windows 7/8\nand Office 2007/2010/2013");close(); >> %TEMP%\oneclick-action.cmd ECHO Call :YesNoBox "Are you ready to start recording?" "Issue Recorder" >> %TEMP%\oneclick-action.cmd ECHO if "%%YesNo%%"=="7" ( >> %TEMP%\oneclick-action.cmd ECHO Call :MessageBox "Closing Issue Recorder" "Issue Recorder" >> %TEMP%\oneclick-action.cmd ECHO exit >> %TEMP%\oneclick-action.cmd >> %TEMP%\oneclick-action.cmd ECHO ) >> %TEMP%\oneclick-action.cmd ECHO ECHO Recording Steps >> %TEMP%\oneclick-action.cmd ECHO psr.exe /start /output %TEMP%\error.zip /sc 1 /gui 1 /exitonsave 1 >> %TEMP%\oneclick-action.cmd ECHO ECHO Creating Email >> %TEMP%\oneclick-action.cmd ECHO start outlook.exe /c ipm.note /m "&subject=Support Issue&body=Hi Support, See the attached steps for the issue I am experiencing." /a "%TEMP%\error.zip" >> %TEMP%\oneclick-action.cmd ECHO exit >> %TEMP%\oneclick-action.cmd ECHO :YesNoBox >> %TEMP%\oneclick-action.cmd ECHO REM returns 6 = Yes, 7 = No. Type=4 = Yes/No >> %TEMP%\oneclick-action.cmd ECHO set YesNo= >> %TEMP%\oneclick-action.cmd ECHO set MsgType=4 >> %TEMP%\oneclick-action.cmd ECHO set heading=%%~2 >> %TEMP%\oneclick-action.cmd ECHO set message=%%~1 >> %TEMP%\oneclick-action.cmd ECHO echo wscript.echo msgbox(WScript.Arguments(0),%%MsgType%%,WScript.Arguments(1)) ^>"%temp%\input.vbs" >> %TEMP%\oneclick-action.cmd ECHO for /f "tokens=* delims=" %%%%a in ('cscript //nologo "%temp%\input.vbs" "%%message%%" "%%heading%%"') do set YesNo=%%%%a>> %TEMP%\oneclick-action.cmd ECHO exit /b >> %TEMP%\oneclick-action.cmd ECHO :MessageBox >> %TEMP%\oneclick-action.cmd ECHO set heading=%%~2 >> %TEMP%\oneclick-action.cmd ECHO set message=%%~1 >> %TEMP%\oneclick-action.cmd ECHO echo msgbox WScript.Arguments(0),0,WScript.Arguments(1) ^>"%temp%\input.vbs" >> %TEMP%\oneclick-action.cmd ECHO cscript //nologo "%temp%\input.vbs" "%%message%%" "%%heading%%" >> %TEMP%\oneclick-action.cmd ECHO exit /b >> %TEMP%\oneclick-action.cmd start /min %TEMP%\oneclick-action.cmd exit
You can edit the descriptions for all messages throughout the script. You can also pre-define an email address for the email to send to by editing the command to start Outlook as shown below.
ECHO start outlook.exe /c ipm.note /m "<emailaddress>&subject=Support Issue&body=Hi Support, See the attached steps for the issue I am experiencing." /a "%TEMP%\error.zip" >> %TEMP%\oneclick-action.cmd
This script is a great demonstration of how you can use a simple command file to generate multiple vb script and command files to perform a series of functions from a single simple file.