分类: WINDOWS
2008-01-05 17:24:53
echo off echo SERVER >tempfile ipconfig /all |sed -n "/Host Name/p"|sed "s/-//g"|sed "s/.*: \(.*\)/\1/g" >>tempfile ipconfig /all |sed -n "/Physical Address/p"|sed "s/-//g"|sed "s/.*: \(.*\)/\1/g" >>tempfile echo 1055 >>tempfile sed -i "N;N;N;s/\n/\t/g" tempfile sed "1d" ansys.dat>>tempfile copy tempfile ansys.dat ansys.exe -i ansys.dat -o license.dat if not exist "C:\Program Files\Ansys Inc\Shared Files\Licensing". mkdir "C:\Program Files\Ansys Inc\Shared Files\Licensing" copy license.dat "C:\Program Files\Ansys Inc\Shared Files\Licensing" echo Windows Registry Editor Version 5.00 >tempfile echo [HKEY_CURRENT_USER\Environment] >>tempfile echo -ANSYSLMD_LICENSE_FILE- = -1055@ >temp ipconfig /all |sed -n "/Host Name/p"|sed "s/-//g"|sed "s/.*: \(.*\)/\1/g" >>temp echo - >>temp sed -i "s/-/\"/g" temp sed -i -e "2N" -e "s/\n//" temp sed -i -e "N" -e "s/\n//" temp sed -i "s/ //g" temp type temp>>tempfile reg import tempfile del tempfile del temp del ansys.txt |
rem this bat file is used to create keygen file and add user environment ANSYSLMD_LICENSE_FILE automatically. @echo off & Setlocal EnableDelayedExpansion rem get mac address from the output of command GETMAC; :: get rid of charactor - in %mac% rem replace the computer name and mac in ansys.dat with yours echo SERVER %ComputerName% %mac% 1055>tempfile :: create keygen file ansys.exe -i tempfile -o license.dat :: copy keygen file to "C:\Program Files\Ansys Inc\Shared Files\Licensing" if not exist "C:\Program Files\Ansys Inc\Shared Files\Licensing". mkdir "C:\Program Files\Ansys Inc\Shared Files\Licensing" copy license.dat "C:\Program Files\Ansys Inc\Shared Files\Licensing" :: add user environment set regpath=HKEY_CURRENT_USER\Environment
|