AnsweredAssumed Answered

How do you build a batch file in order to swap the license over on the computers I manage

Question asked by Bidiak Amana on Jan 12, 2016

Hello!

 

I was hoping to get some help with swapping a license over between Solidworks 2014 and 2015. I am in the process of setting the license server up (which I am not having trouble with), but what I am having trouble with is changing the license in the registry. I built a piece of code that just redefines SW_D_LICENSE_FILE to the correct value, but pushing that out didn't work. In the past, I've had some success by adding a key to Active Setup in order to force the computer to check if the key had been replaced- so I build a batch file on a past-successful framework. Problem is, this doesn't work as written and I can't figure out why. The final step reports a syntax error, but I'm not sure what it is going wrong.

 

I figure it's likely something trivial, but I can't see something wrong and I need a fresh set of eyes to point out what I've done wrong.

 

Any help would be appreciated!

 

Below is the code from the batch file.

 

@echo off

:: Fixes Network License for every user for Solidworks 2015

:: 1/11/2016 SoE

 

:: RegFix

:: Make license default for every user

 

REG ADD "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\SolidworksActivesetupLicenseFix" /f

IF NOT "%ERRORLEVEL%"=="0" EXIT /B %ERRORLEVEL%

 

REG ADD "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\SolidworksActivesetupLicenseFix" /v Version /t REG_SZ /d 1,0 /f

IF NOT "%ERRORLEVEL%"=="0" EXIT /B %ERRORLEVEL%

 

REG ADD "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\SolidworksActivesetupLicenseFix" /v Stubpath /t REG_SZ /d "REG ADD "HKLM\SOFTWARE\FLEXLM LICENSE MANAGER" /v SW_D_LICENSE_FILE /t REG_SZ /d 00000@licenses.example.edu /f" /f

IF NOT "%ERRORLEVEL%"=="0" EXIT /B %ERRORLEVEL%

Outcomes