--获取网卡列表(所有的)
if object_id('tempdb..#tb') is not null drop table #tb
create table #tb(re varchar(255))
exec sp_configure 'show advanced options', 1;reconfigure;exec sp_configure 'xp_cmdshell', 1;
reconfigure
insert into #tb exec master..xp_cmdshell 'ipconfig /all'
if object_id('tempdb..#tb') is not null drop table #tb
create table #tb(re varchar(255))
exec sp_configure 'show advanced options', 1;reconfigure;exec sp_configure 'xp_cmdshell', 1;
reconfigure
insert into #tb exec master..xp_cmdshell 'ipconfig /all'
select ltrim(rtrim(substring(re,charindex(':',re)+1,255))) as wkmac from #tb where re like '%physical address. . . . . . . . . :%'
--获取cpu ProcessorId
if object_id('tempdb..#tb') is not null drop table #tb
create table #tb(id [int] IDENTITY(1,1),re varchar(255))
exec sp_configure 'show advanced options', 1;reconfigure;exec sp_configure 'xp_cmdshell', 1;
reconfigure
insert into #tb exec master..xp_cmdshell 'wmic cpu get ProcessorId'
select ltrim(rtrim(re)) as ProcessorId from #tb where id =2--注意空格