2009年11月7日土曜日

VBS License File & Product Key Install Tool


Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Dim osselect , oempath , oemeespath
Dim pn(3)
Dim pk(3)
pn(0) = "Windows Vista (Ultimate)"
pn(1) = "Windows Server 2008 (Enterprise)"
pn(2) = "Windows 7 (Ultimate)"
pn(3) = "Windows Server 2008 R2 (Standard)"
pk(0) = "Product Key"
pk(1) = "Product Key"
pk(2) = "Product Key"
pk(3) = "Product Key"
oempath = "%USERPROFILE%\Desktop\OEM.XRM-MS"
oemeespath = WshShell.ExpandEnvironmentStrings("%USERPROFILE%")&"\Desktop\OEM.XRM-MS"
MsgBox "UAC(User Account Control) : Never notify" &Chr(10) & _
"OEM.XRM-MS On Desktop" &Chr(10) & _
"BIOS Have SLIC(2.0:Vista&2008 2.1:7&2008 R2)" , 0 , "License File & Product Key Install Tool"
Do
osselect = InputBox("1 = " &pn(0) &Chr(10) & _
"2 = " &pn(1) &Chr(10) & _
"3 = " &pn(2) &Chr(10) & _
"4 = " &pn(3) &Chr(10) , "Select Windows Version (0 = Exit)" , "Input A Numeric For Your Choice")
Loop While IsNumeric(osselect) = flase
Select Case osselect
Case 0
Case 1
Call sharesetting
Return = WshShell.run("SLMGR.VBS -IPK " &pk(0) , 1 , True)
Case 2
Call sharesetting
Return = WshShell.run("SLMGR.VBS -IPK " &pk(1) , 1 , True)
Case 3
Call sharesetting
Return = WshShell.run("SLMGR.VBS -IPK " &pk(2) , 1 , True)
Case 4
Call sharesetting
Return = WshShell.run("SLMGR.VBS -IPK " &pk(3) , 1 , True)
Case else
MsgBox "Error Input & Exit" , 0 , "Message"
End select

Sub sharesetting
If (fso.FileExists(oemeespath)) Then
Return = WshShell.run("SLMGR.VBS -ILC " &oempath , 1 , True)
Else
MsgBox "Can't Find OEM.XRM-MS On Desktop & Exit" , 0 , "Message"
WScript.Quit
End If
Exit Sub
End Sub

0 件のコメント: