I would like a batch file to take the service tag from pc and set it to the system description
Answer Summary:
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

1
Hi ddonaldson,

you can get the service tag via wmi, see powershell example below. but i think this is vendor dependent!

Powershell:
Get-WmiObject win32_SystemEnclosure | select serialnumber

kind regards,
raginx
Answered 03/20/2012 by: RaginX
Orange Belt

  • yes but I also needto change the system description
Please log in to comment

Answers

0
Yeah, not sure if this works. couldn't check this at the moment:
have a look at registry path HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\lanmanserver\parameters\srvcomment
Answered 03/20/2012 by: RaginX
Orange Belt

  • you can with for exemple this script in autoit :

    #include
    #include
    #include
    Dim $assettag
    RunWait("cmd.exe /c " & "wmic /node:localhost systemenclosure get smbiosassettag > c:\Temp\assettag.txt", "",@SW_HIDE)
    $file = FileOpen("C:\Temp\assettag.txt", 0)
    $assettag = FileReadLine($file,2)
    FileClose($file)
    RegWrite ("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters", "srvcomment", "REG_SZ", $assettag)
    FileDelete ("C:\Temp\assettag.txt")
  • Now this, I'm keeping in my stash. Nice one nekkar.
Please log in to comment
Answer this question or Comment on this question for clarity