Question
batch file to collect host id for flexnet (6.0 and above) licensing
WITHOUT annoying your users too much. Supports collecting the information
and generating the license ahead of any Arbortext Administrator conducted
install so you're not waiting around the user's cubicle while the PTC
licensing application is chugging away on preparing your license file.
FYI: I modified the file contents here in my e-mail to obscure information
potentially considered proprietary. I may have introduced typos or errors
of logic. Read carefully and test well in a non-production environment blah
blah blah
=======
@echo off
rem Make a directory on the user's hard drive to store cpu_id.exe which
will not run from a UNC.
mkdir "c:\Arbortext\cpuid"
rem Copy the contents of a server directory which contains cpu_id.exe to
the directory you just created.
xcopy \\servername\sharename\cpuid "c:\Arbortext\cpuid" /s /y /i
rem Grab the MAC address reported by cpu_id.exe and start an Outlook e-mail
request with that information
rem in the subject line to two Arbortext admins at yourcompany.
rem Outlook path is based on Outlook 2003.
rem The following line (starting "for /f ..." and ending "...%20%%x")
should be all on one line with no breaks:
for /f "tokens=4" %%x in ('c:\Arbortext\cpuid\cpu_id.exe') do "C:\Program
Files\Microsoft Office\OFFICE11\outlook.exe" /c ipm.note /m
admin1@yourcompany.com%%
3Badmin2@yourcompany.com?subject=please%%20issue%%20me%%20a%%20new%%20Arbortext%%20Editor%%20license.%%20My%%20host_id%%20is%%3A%%20%%x
rem You are supposed to be able to add &body=bodytextofanemailgoeshere to
the end of the command above.
rem I could not, however, ever get it to work. (If I put
body=bodytextofanemailgoeshere before subject=subjecttext
rem and inserted the & in front of subject since it is now a second
operand, I only got body text ... no subject text.)
rem Probably remove pause before deploying.
pause
======
Enjoy.
--
Paul Nagai
and generating the license ahead of any Arbortext Administrator conducted
install so you're not waiting around the user's cubicle while the PTC
licensing application is chugging away on preparing your license file.
FYI: I modified the file contents here in my e-mail to obscure information
potentially considered proprietary. I may have introduced typos or errors
of logic. Read carefully and test well in a non-production environment blah
blah blah
=======
@echo off
rem Make a directory on the user's hard drive to store cpu_id.exe which
will not run from a UNC.
mkdir "c:\Arbortext\cpuid"
rem Copy the contents of a server directory which contains cpu_id.exe to
the directory you just created.
xcopy \\servername\sharename\cpuid "c:\Arbortext\cpuid" /s /y /i
rem Grab the MAC address reported by cpu_id.exe and start an Outlook e-mail
request with that information
rem in the subject line to two Arbortext admins at yourcompany.
rem Outlook path is based on Outlook 2003.
rem The following line (starting "for /f ..." and ending "...%20%%x")
should be all on one line with no breaks:
for /f "tokens=4" %%x in ('c:\Arbortext\cpuid\cpu_id.exe') do "C:\Program
Files\Microsoft Office\OFFICE11\outlook.exe" /c ipm.note /m
admin1@yourcompany.com%%
3Badmin2@yourcompany.com?subject=please%%20issue%%20me%%20a%%20new%%20Arbortext%%20Editor%%20license.%%20My%%20host_id%%20is%%3A%%20%%x
rem You are supposed to be able to add &body=bodytextofanemailgoeshere to
the end of the command above.
rem I could not, however, ever get it to work. (If I put
body=bodytextofanemailgoeshere before subject=subjecttext
rem and inserted the & in front of subject since it is now a second
operand, I only got body text ... no subject text.)
rem Probably remove pause before deploying.
pause
======
Enjoy.
--
Paul Nagai

