@echo off SetLocal set PROG=%~n0%~x0 if !%1! == !! goto usage set Dest=%1 REM Strip double-quotes set Dest=%Dest:"=% if exist SerenaLM.exe goto lm_dir_ok if not exist MerantLM.exe goto whichdir :lm_dir_ok if exist "%Dest%" goto target_exists md "%Dest%" if not exist "%Dest%" goto create_error REM Get the Fully Qualified Path pushd "%Dest%" set Dest=%CD% popd echo Copying files... REM Use FOR to avoid errors on missing files FOR %%i in (*.lic *.lst *.ini *.opt) DO copy %%i "%Dest%\%%i.txt" > NUL: FOR %%i in (*.log) DO copy %%i "%Dest%\%%i" > NUL: dir /od > "%Dest%\licdir.txt" REM Check if there's a VirtualStore entry for the current directory set VirtualStore=%LOCALAPPDATA%\VirtualStore\%CD:~3% if not exist "%VirtualStore%" goto GetServerInfo pushd "%VirtualStore%" FOR %%i in (*.lic *.lst *.ini *.opt) DO copy %%i "%Dest%\VirtualStore_%%i.txt" > NUL: FOR %%i in (*.log) DO copy %%i "%Dest%\VirtualStore_%%i" > NUL: popd dir /od "%VirtualStore%" > "%Dest%\VirtualStore_licdir.txt" :GetServerInfo echo Obtaining License Server info... call .\get_concurrent_usage.bat > "%Dest%\current_usage.log" .\lmutil lmhostid > "%Dest%\lmhostid.txt" .\lmutil lmstat > "%Dest%\lmstat.txt" ver > "%Dest%\os.txt" set > "%Dest%\vars.txt" echo Finished. echo. echo Please ZIP up all files in directory "%Dest%" and send them to Customer Support. echo. goto end :usage echo ************************* USAGE **************************** echo * Run %PROG% from a Windows Command Prompt (CMD.EXE) echo * in the SLM (Serena License Manager) directory and supply echo * the case number as a parameter. For example, if your case echo * number is 1234567 then, at the command prompt, type: echo * echo * %0 1234567 echo * echo * This will create a subdirectory named 1234567 and echo * populate it with the files necessary to diagnose the echo * problem. Please ZIP together all of the files found in echo * the new sub-directory and email them to Customer Support. echo ************************************************************ REM The person seeing this likely double-clicked the batch file from Windows Explorer. REM To give them a chance to read the text above, ask them to press a key to continue. pause goto end :whichdir echo ********************** ERROR ******************************* echo * %PROG% must be run from the directory where SLM echo * (Serena License Manager) is installed. The current echo * directory does not hold SerenaLM.exe or MerantLM.exe. echo * Please change to the directory containing either echo * SerenaLM.exe or MerantLM.exe and re-run: echo * %0 %* echo ************************************************************ goto end :target_exists echo ********************** ERROR ******************************* echo * The target directory "%Dest%" already exists. echo * Please remove this directory first (rmdir /s "%Dest%") echo * or pick a different name before running %0 echo ************************************************************ goto end :create_error echo ********************** ERROR ******************************* echo * %PROG% could not create the directory "%Dest%". echo * You may have to run this script as an Administrator. echo * Use right-click - Run as Administator on Command Prompt echo * (CMD.EXE) to launch it as an administrator, then re-run: echo * %0 %* echo ************************************************************ goto end :end EndLocal