anchor.diff:  goto zipit
   
   :zipit
  +REM Write a VBS script to zip the directory
   echo Set objArgs = WScript.Arguments > _zipIt.vbs
   echo InputFolder = objArgs(0) >> _zipIt.vbs
   echo ZipFile = objArgs(1) >> _zipIt.vbs
  
positive.code: @echo off
  REM XenTools bugtool generator - v1.7 by Blaine A. Anaya
  REM This script collects necessary files used to identify where a XenTools installation issue has occurred
  REM and places them in a ZIP file determined at runtime.
  REM Usage: xtbugtool.bat <Destination Path for ZIP file>
  REM Copyright (c) Citrix Systems Inc.
  
negative.code: copy "C:\Program Files\Citrix\XenTools\Installer\*.install*" programfiles  > NUL 2>&1
  echo Capturing pnputil -e output...
  pnputil.exe -e > pnputil-e.out
  if NOT %ERRORLEVEL%==0 echo "pnputil failed" >> xtbugtool.log
  echo Capturing state of WMI repository (will fail if not ran as administrator)...
  C:\Windows\System32\wbem\winmgmt /verifyrepository > wmistate.out
  if NOT %ERRORLEVEL%==0 echo "wmi failed" >> xtbugtool.log
  echo Exporting System event log...
  wevtutil epl System system.evtx
  if NOT %ERRORLEVEL%==0 echo "system log failed" >> xtbugtool.log
  echo Exporting Application event log...
  wevtutil epl Application application.evtx
  if NOT %ERRORLEVEL%==0 echo "application log failed" >> xtbugtool.log
  cd ..
  echo Finalizing process and creating ZIP file...
  exit /b
  