Code: Alles auswählen
; *******************************************
; Tool zum Branden eines PCs mit Vista oder 7
; by Katana Seiko
; *******************************************
Procedure RegistrySetValue(topKey, sKeyName.s, sValueName.s, vValue.s, lType, ComputerName.s = "")
Protected lpData.s=Space(255)
Protected GetHandle.l, hKey.l, lReturnCode.l, lhRemoteRegistry.l, lpcbData, lValue.l, ergebnis.l
If Left(sKeyName, 1) = "\"
sKeyName = Right(sKeyName, Len(sKeyName) - 1)
EndIf
If ComputerName = ""
GetHandle = RegOpenKeyEx_(topKey, sKeyName, 0, #KEY_ALL_ACCESS, @hKey)
Else
lReturnCode = RegConnectRegistry_(ComputerName, topKey, @lhRemoteRegistry)
GetHandle = RegOpenKeyEx_(lhRemoteRegistry, sKeyName, 0, #KEY_ALL_ACCESS, @hKey)
EndIf
If GetHandle = #ERROR_SUCCESS
lpcbData = 255
Select lType
Case #REG_SZ
GetHandle = RegSetValueEx_(hKey, sValueName, 0, #REG_SZ, @vValue, Len(vValue) + 1)
Case #REG_DWORD
lValue = Val(vValue)
GetHandle = RegSetValueEx_(hKey, sValueName, 0, #REG_DWORD, @lValue, 4)
EndSelect
RegCloseKey_(hKey)
ergebnis = 1
ProcedureReturn ergebnis
Else
MessageRequester("Fehler", "Ein Fehler ist aufgetreten", 0)
RegCloseKey_(hKey)
ergebnis = 0
ProcedureReturn ergebnis
EndIf
EndProcedure
DataSection
Logo:
IncludeBinary "logo.bmp" ;may not be larger than 120x120 px
EndLogo:
EndDataSection
;change these values according to your needs (need to be strings)
#Manufacturer = "Katana Seiko"
#Model = "Seiko One"
#SupportHours = "24 hours, 7 days a week"
#SupportPhone = "None"
#SupportURL = "http://www.seiko-center.net"
If CreateFile(1, "C:\Windows\Media\logo.bmp")
WriteData(1, ?Logo, ?EndLogo-?Logo)
CloseFile(1)
Debug Reg_SetValue(#HKEY_LOCAL_MACHINE, "\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation", "Logo", "C:\Windows\Media\logo.bmp", #REG_SZ)
EndIf
Reg_SetValue(#HKEY_LOCAL_MACHINE, "\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation", "Manufacturer", #Manufacturer, #REG_SZ)
Reg_SetValue(#HKEY_LOCAL_MACHINE, "\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation", "Model", #Model, #REG_SZ)
Reg_SetValue(#HKEY_LOCAL_MACHINE, "\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportHours", #SupportHours, #REG_SZ)
Reg_SetValue(#HKEY_LOCAL_MACHINE, "\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportPhone", #SupportPhone, #REG_SZ)
Reg_SetValue(#HKEY_LOCAL_MACHINE, "\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportURL", #SupportURL, #REG_SZ)