Join me in the fight to stop Internet censorship: http://americancensorship.org/
– Soli Deo Gloria
There are 10 types of people in the world: those are understand binary and those who do not.
Join me in the fight to stop Internet censorship: http://americancensorship.org/
– Soli Deo Gloria
Poached parts of this script from
Set Shell = CreateObject("WScript.Shell") Set oFSO = CreateObject("Scripting.FileSystemObject") strComputer = Shell.ExpandEnvironmentStrings("%computername%") Set objWMIService = GetObject("winmgmts://" & strComputer & "/root/cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_Battery",,48) IsLaptop = False For Each objItem in colItems IsLaptop = True Next If IsLaptop Then wscript.stdout.write "Laptop, running PowerLinkTSIcon()" PowerLinkTSIcon() Else wscript.stdout.write "Not a laptop, not running PowerLinkTSIcon()" End If Sub PowerLinkTSIcon() OSType = FindOSType(strComputer) wscript.echo OSType If OSType = "Windows XP" Then oFSO.CopyFile "PowerLink Terminal Services.lnk", "C:documents and settingsall usersdesktop" End If If OSType = "Windows 7" Then oFSO.CopyFile "PowerLink Terminal Services.lnk", "C:userspublicdesktop" End If oFSO.CopyFile "Powerlink.ico", "C:windowssystem32" End Sub Function FindOSType(strComputer) 'Defining Variables Dim objWMI, objItem, colItems Dim OSVersion, OSName, ProductType 'Get the WMI object and query results Set objWMI = GetObject("winmgmts://" & strComputer & "/root/cimv2") Set colItems = objWMI.ExecQuery("Select * from Win32_OperatingSystem",,48) 'Get the OS version number (first two) and OS product type (server or desktop) For Each objItem in colItems OSVersion = Left(objItem.Version,3) ProductType = objItem.ProductType Next 'Time to convert numbers into names Select Case OSVersion Case "6.1" OSName = "Windows 7" Case "6.0" OSName = "Windows Vista" Case "5.2" OSName = "Windows 2003" Case "5.1" OSName = "Windows XP" Case "5.0" OSName = "Windows 2000" Case "4.0" OSName = "Windows NT 4.0" Case Else OSName = "Windows 9x" End Select 'Return the OS name FindOSType = OSName 'Clear the memory Set colItems = Nothing Set objWMI = Nothing End Function
– Soli Deo Gloria