然后将此资产编号写回设备注册表中,作为soti注册表栈中的DeviceName。
ini文件的格式为:-
10184522501228=CITY7600A
我使用的代码是:-
;read registry for Serial Number
set MySerial=REG://HKEY_LOCAL_MACHINE\Software\MSP\IdentityAttributes?VN=serial
showmessagebox %MySerial%
;Lookup in INI
set MyAsset=INI://\temp\CityMC70Serial2Asset.ini?SC=Serial&NM=%MySerial%
showmessagebox %MyAsset%
set MyAsset=N/A%MyAsset%
if not %MyAsset%==N/A goto assetfound
set MyAsset=%MySerial%
goto continue
:assetfound
set MyAsset=substring %MyAsset% 4 -1
:continue
;Set in registry for Customer Data
regset HKEY_LOCAL_MACHINE\Software\Apps\SOTI\MobiControl\PDB\Device\DeviceName?VD=MyAsset
;rename device to asset tag
\windows\startup\CommLoader.exe -n %MyAsset%
\windows\startup\CommLoader.exe -n %MyAsset%
reset /s此代码接受序列号ok,但不会交换资产号,也不会重新写入soti reg。
任何帮助都将不胜感激。
发布于 2014-02-19 01:11:56
原来下面这行代码导致了这个错误...
:assetfound
set MyAsset=substring %MyAsset% 4 -1-1会导致资产被擦除,当我使用以下命令时,它工作得很好
:assetfound
set MyAsset=substring %MyAsset% 4 10https://stackoverflow.com/questions/21608287
复制相似问题