I am a newbie to software deployment with KACE, but I'd like to see if I can make this work.

We use SAS 9.3 in both the 64 abd 32bit versions in our environment.  I'd like to be able to renew the license using KACE.  I have a batch file that works for each version of the software.  They both call the sasrenew.exe file from a different directory based on which version is installed.  If possible, I'd like for it to check for the existing of the directory and file (i.e. "C:\Program Files\SASHome\x86\SASRenewalUtility\9.3\SASRenew.exe", or "C:\Program Files\SASHome\SASRenewalUtility\9.3\SASRenew.exe" ) then run the batch file that uses the right version of the license file ("-skipadmincheck -s "datafile:\\server\install\SAS_Software_Depot\sid_files\SAS93_***_***_Win_Wrkstn.txt", or -skipadmincheck -s "datafile:\\server\install\SAS_Software_Depot\sid_files\SAS93_***_***_Win_X64_Wrkstn.txt"). 

2 Comments   [ - ] Hide Comments


  • It's not the processor that would determine the version in this case, it is the installed version of the software. Some of the machines have the 32bit version installed even though their processor is 64bit, and some of them have the 64bit version of the software installed.
  • ...so detect the installed version by interrogating the 'Uninstall\[ProductCode]' entry in the registry.

    Personally, I'd be doing that in VBScript rather than batch, mostly because of its superior error-handling.
Please log in to comment

Answer this question or Comment on this question for clarity


not sure on the exact verbage but this will give the right idea.  rewrite your batch file like this:

if "%PROCESSOR_ARCHITECTURE%"=="x86"  C:\Program Files\SASHome\x86\SASRenewalUtility\9.3\SASRenew.exe -skipadmincheck -s "datafile:\\server\install\SAS_Software_Depot\sid_files\SAS93_***_***_Win_Wrkstn.txt

if "%PROCESSOR_ARCHITECTURE%"=="AMD64" C:\Program Files\SASHome\SASRenewalUtility\9.3\SASRenew.exe -skipadmincheck -s "datafile:\\server\install\SAS_Software_Depot\sid_files\SAS93_***_***_Win_X64_Wrkstn.txt
Answered 11/19/2014 by: SMal.tmcc
Red Belt

Please log in to comment
Oh sorry you can use this in batch processing

if exist {insert file name here} {action}

for example, this opens notepad on autoexec.bat, if the file exists:

if exist c:\autoexec.bat notepad c:\autoexec.bat
Answered 11/21/2014 by: SMal.tmcc
Red Belt

Please log in to comment

 We use SCCM + a batch file

The line that checks the SAS version in our renewal script is :
"dir "c:\program files\sasHome\licenses\*Win_X64_Wrkstn.txt" /b /a | find /v "nofiles">nul || goto 32Bit"

Basically does a dir, if it doesn't find any files that end in Win_X64_Wrkstn.txt it assumes it is the 32bit version and uses the appropriate update path/file 

Below is the full script: 


@echo off

:: SAS Annual License renewal.

set SAS32bitKey=SAS93_XXXXXXXXXXXX_Win_Wrkstn.txt
set SAS64bitKey=SAS93_XXXXXXXXXXXX_Win_X64_Wrkstn.txt

echo. >>%windir%\temp\SAS-Renewal.log
echo %date% %time% Starting >>%windir%\temp\SAS-Renewal.log

:: check that SAS is the right version (currently 9.3)
dir "c:\program files\sas_license\SAS93*" /b /a | find /v "nofiles">nul || goto abort
::check if SAS install is 32 or 64bit
dir "c:\program files\sasHome\licenses\*Win_X64_Wrkstn.txt" /b /a | find /v "nofiles">nul || goto 32Bit

echo 64bit license being renewed >>%windir%\temp\SAS-Renewal.log
::Copy renewal license
copy  %SAS64bitKey% "C:\Program Files\Sas_license" /y >>%windir%\temp\SAS-Renewal.log
::Renew License - note path is different to 32bit install
"C:\Program Files\SASHome\SASRenewalUtility\9.3\SASRenew.exe" -s "datafile:C:\Program Files\Sas_license\%SAS64bitKey%"
goto eof

echo 32bit license being renewed >>%windir%\temp\SAS-Renewal.log
::Copy renewal license
copy %SAS32bitKey% "C:\Program Files\Sas_license" /y >>%windir%\temp\SAS-Renewal.log
::Renew License - note path is different to 64bit install.
"C:\Program Files\SASHome\x86\SASRenewalUtility\9.3\SASRenew.exe" -s "datafile:C:\Program Files\Sas_license\%SAS32bitKey%"
goto eof

echo wrong SAS version aborting >>%windir%\temp\SAS-Renewal.log
exit 1603


::force a 15 sec delay
timeout /t 5 /nobreak >null
set SAS32bitKey=
set SAS64bitKey=
echo %date% %time% Finished >>%windir%\temp\SAS-Renewal.log


Answered 11/23/2014 by: Utterly
Yellow Belt

Please log in to comment