echo off REM Script to rip out UUID from Creo and send it to a text file. Based on the script below. REM https://community.ptc.com/t5/Performance-Advisor/How-to-identify-a-user-in-Performance-Advisor/m-p/382262#M179%3F&art_lang=en&posno=2&q=collect%20UUID&source=search REM 180829 matsbj New REM 190301 matsbj Updated Creo 5 version REM 200506 matsbj Added Creo 5.0.6.0 and 7.0.0.0. Removed Creo 3 REM 201117 matsbj Removed 5.0.5.0, changed 7.0.0.0 to 7.0.2.0 REM 210315 matsbj Added machine_type REM 220602 matsbj Removed 5.0. added 7.0.8.0 REM 220922 Added 7.0.9.0 REM 221123 Added 9.0.2.0 :: Set folder where to put the file set NETWORK_LOC=\\file_server\creo_log if not exist %NETWORK_LOC%\uuids.txt goto END cd /d c:\ :: Check that the PTC Diagnostic tool has done its job. if not exist %LOCALAPPDATA%\PTC\QualityAgent\SentFiles goto END cd %LOCALAPPDATA%\PTC\QualityAgent\SentFiles :: Change the versions below at update if exist PTC_Creo_Parametric_7_0_7020.xml set CP=PTC_Creo_Parametric_7_0_7020.xml if exist PTC_Creo_Parametric_7_0_7080.xml set CP=PTC_Creo_Parametric_7_0_7080.xml if exist PTC_Creo_Parametric_7_0_7090.xml set CP=PTC_Creo_Parametric_7_0_7090.xml if exist PTC_Creo_Parametric_9_0_9020.xml set CP=PTC_Creo_Parametric_9_0_9020.xml :: Search for the User id. for /F "tokens=1-3 delims=<> " %%b in (%CP%) do ( if %%b==User_ID ( set UID=%%c )) if not defined UID goto END :: Search for the Computer id. for /F "tokens=1-3 delims=<> " %%i in (%CP%) do ( if %%i==UUID ( set CID=%%j )) if not defined CID goto END :: Search for the type of computer. for /f "delims=" %%m in ('wmic csproduct get name ^| findstr "HP"') do @set machine_type=%%m for /f "delims=" %%m in ('wmic csproduct get name ^| findstr "Surface"') do @set machine_type=%%m if not defined machine_type goto END :: This section is to check if the info is already recorded. If so then skip it. for /F "tokens=1-5 delims=, " %%a in (%NETWORK_LOC%\uuids.txt) do ( if /I %%b==%UID% ( if /I %%c==%CID% ( goto END ))) :: Finally submit the user and computer data to remote location. echo %username%,%UID%,%CID%,%computername%,%machine_type%>> %NETWORK_LOC%\uuids.txt :END