Results 1 to 4 of 4

Thread: ( ). ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Mar:2008
    Location: BG
    Posts: 162

    ( ). ?

    , .... Windows 7, .... , :

    strComputer = .
    Set objWMIService = GetObject(winmgmts: & {impersonationLevel=impersonate}!\\ & strComputer & \root\cimv2″)

    Part 1 Acquire serial/service tag number
    Set colSMBIOS = objWMIService.ExecQuery (Select * from Win32_SystemEnclosure)
    For Each objSMBIOS in colSMBIOS
    strSN = objSMBIOS.SerialNumber
    If strSN <> Then exit For
    Next

    Part 2 Assign computer name to serial/service tag number
    Name = strSN

    Set colComputers = objWMIService.ExecQuery (Select * from Win32_ComputerSystem)

    For Each objComputer in colComputers
    err = objComputer.Rename(name)

    if err <> 0 then
    wscript.echo There was an error renaming the machine. Please restart, and try again.
    else
    wscript.echo Machine successfully renamed: & Name
    end if

    Next

    .

  2. #2
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167

  3. #3
    Registered User
    Join Date: Mar:2008
    Location: BG
    Posts: 162

  4. #4
    Registered User
    Join Date: Dec:2005
    Location: yvr
    Posts: 5,167
    ,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |