Wingens Posted September 23, 2014 Share Posted September 23, 2014 I am using regwrite for editing computers register and adding our company's information in the system. But now I have a problem that what I wrote is not working. Nothing get added but only one thing is editted: the wallpaper key. I think it is because the other register keys are not created in the register. My understanding is that regwrite creates a key. Below is my script. Hope any one can point me in the right direction, have been busting my head on it all day. expandcollapse popup#RequireAdmin #include <GUIConstants.au3> #include <File.au3> ;========================================================================================================================================================================================= ; Creating Folders & Files ;========================================================================================================================================================================================= If not FileExists("C:\Windows\Web\Wallpaper\Levix") Then DirCreate("C:\Windows\Web\Wallpaper\Levix") If not FileExists("C:\Windows\Web\Wallpaper\Levix") Then MsgBox(4096, "Let op!", "Achtergrond map niet kunnen aanmaken." & @CRLF & "C:\Windows\Web\Wallpaper\Levix" & @CRLF & @CRLF & "Maak de map handmatig aan.") Exit EndIf EndIf If Not FileExists("C:\Windows\OEMLOGO") Then DirCreate("C:\Windows\OEMLOGO") If not FileExists("C:\Windows\OEMLOGO") Then MsgBox(4096, "Let op!", "OEMLOGO map niet kunnen aanmaken." & @CRLF & "C:\Windows\OEMLOGO" & @CRLF & @CRLF & "Maak de map handmatig aan.") Exit EndIf EndIf If not FileExists("C:\Windows\Temp")Then DirCreate("C:\Windows\Temp") If not FileExists("C:\Windows\Temp") Then MsgBox(4096, "Let op!", "Temp map niet kunnen aanmaken." & @CRLF & "C:\Windows\Temp" & @CRLF & @CRLF & "Maak de map handmatig aan.") EndIf EndIf FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\OEMLogo\oemlogo.BMP", "C:\Windows\OEMLOGO\oemlogo.BMP") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\Wallpaper\Levix Particulier.png", "C:\Windows\Web\Wallpaper\Levix\Levix Particulier.png") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\Wallpaper\Levix Particulier Black.png", "C:\Windows\Web\Wallpaper\Levix\Levix Particulier Black.png") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\Wallpaper\Levix Zakelijk.png", "C:\Windows\Web\Wallpaper\Levix\Levix Zakelijk.png") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\Wallpaper\Levix Zakelijk Black.png", "C:\Windows\Web\Wallpaper\Levix\Levix Zakelijk Black.png") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Software\Ninite.exe", "C:\Windows\Temp\Ninite.exe") ;========================================================================================================================================================================================= ; Creating Folders & Files ;========================================================================================================================================================================================= $GUI = GUICreate("", 197, 55, -1, -1, $WS_POPUPWINDOW) $COMPUTERSHOP = GUICtrlCreateButton("Computershop", 16, 16) $AUTOMATISERING = GUICtrlCreateButton("Automatisering", 104, 16) GUISetState(@SW_SHOW) ;========================================================================================================================================================================================= While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $COMPUTERSHOP Computershop() Case $AUTOMATISERING Automatisering() EndSwitch WEnd ;========================================================================================================================================================================================= Func Computershop() If FileExists("C:\WINDOWS\Web\Wallpaper\Levix") Then FileDelete("C:\Windows\Web\Wallpaper\Levix\Levix Zakelijk.png") FileDelete("C:\Windows\Web\Wallpaper\Levix\Levix Zakelijk Black.png") EndIf RegWrite("HKCU\Control Panel\Desktop" , "Wallpaper" , "REG_MULTI_SZ" , "C:\WINDOWS\Web\Wallpaper\Levix\Levix Particulier.png") RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Logo", "REG_MULTI_SZ", "C:\Windows\OEMLOGO\oemlogo.bmp") RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Manufacturer", "REG_MULTI_SZ", "Levix") RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportPhone", "REG_MULTI_SZ", "| Geffen: 073-5341325 | Oss: 0412-692090 | Uden: 0413-331536 | Rosmalen: 073-5220070 | 's Hertogenbosch: 073-6440576 |") RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportURL", "REG_MULTI_SZ", "https://webshop.levix.nl/bedrijfsinfo/bedrijfsprofiel/contact") Run("C:\Windows\Temp\Ninite.exe /repair") $TITLE = "Ninite" $SUB = "Close" WinWait($TITLE, $SUB) If Not WinActive($TITLE, $SUB) Then WinActivate($TITLE, $SUB) WinActive($TITLE, $SUB) ControlClick($TITLE, $SUB, "Button1") Sleep(1000) FileDelete("C:\Windows\Temp\Ninite.exe") MsgBox(4096, "Let op!", "Instellingen zijn voltooid, systeem gaat herstarten als er op OK geklikt wordt.") Stop() EndFunc ;========================================================================================================================================================================================= Func Automatisering() If FileExists("C:\WINDOWS\Web\Wallpaper\Levix") Then FileDelete("C:\Windows\Web\Wallpaper\Levix\Levix Particulier.png") FileDelete("C:\Windows\Web\Wallpaper\Levix\Levix Particulier Black.png") EndIf RegWrite("HKCU\Control Panel\Desktop" , "Wallpaper" , "REG_MULTI_SZ" , "C:\WINDOWS\Web\Wallpaper\Levix\Levix Zakelijk.png") RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Logo", "REG_MULTI_SZ", "C:\Windows\OEMLOGO\oemlogo.bmp") RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Manufacturer", "REG_MULTI_SZ", "Levix") RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportPhone", "REG_MULTI_SZ", "| Geffen: 073-5341131 |") RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportURL", "REG_MULTI_SZ", "http://www.levix.nl/automatisering/contact") Run("C:\Windows\Temp\Ninite.exe /repair") $TITLE = "Ninite" $SUB = "Close" WinWait($TITLE, $SUB) If Not WinActive($TITLE, $SUB) Then WinActivate($TITLE, $SUB) WinActive($TITLE, $SUB) ControlClick($TITLE, $SUB, "Button1") Sleep(1000) FileDelete("C:\Windows\Temp\Ninite.exe") MsgBox(4096, "Let op!", "Instellingen zijn voltooid, systeem gaat herstarten als er op OK geklikt wordt.") Stop() EndFunc ;========================================================================================================================================================================================= Func Stop() $DP = "herstart.cmd" If FileExists($DP) Then FileDelete($DP) EndIf If $DP = -1 Then MsgBox(4096, "Fout!", "herstart.cmd kon niet geopend worden") Else $var = FileOpen($DP, 1) FileWrite($VAR, "@ECHO OFF" & @CRLF) FileWrite($VAR, "TITLE Systeem herstart" & @CRLF) FileWrite($var, "net accounts /maxpwage:unlimited" & @CRLF) FileWrite($var, "shutdown -r -t 30" & @CRLF) FileWrite($var, "ECHO." & @CRLF) FileWrite($var, "del herstart.cmd" & @CRLF) EndIf Sleep(3000) Run(@ComSpec & " /c " & 'START /min herstart.cmd', "", @SW_HIDE) Sleep(500) Exit EndFunc ;========================================================================================================================================================================================= Setup.au3 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 23, 2014 Moderators Share Posted September 23, 2014 You need to add error checking to your script. You should be checking after every regwrite. Otherwise, as is the case here it seems, you don't know where your script first breaks. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Wingens Posted September 25, 2014 Author Share Posted September 25, 2014 (edited) I used RegRead and it is returning the values i need, but after the script is finished. The only value changed is the wallpaper one. Not the system information, but every RegRead returns what i put in the register. I also tried a version of my script using a .reg file but that would also not get inserted. See script below: (what am i doing wrong am i missing something?) expandcollapse popup#RequireAdmin #include <GUIConstants.au3> #include <File.au3> ;========================================================================================================================================================================================= ; Creating Folders & Files ;========================================================================================================================================================================================= If not FileExists("C:\Windows\Web\Wallpaper\Levix") Then DirCreate("C:\Windows\Web\Wallpaper\Levix") If not FileExists("C:\Windows\Web\Wallpaper\Levix") Then MsgBox(4096, "Let op!", "Achtergrond map niet kunnen aanmaken." & @CRLF & "C:\Windows\Web\Wallpaper\Levix" & @CRLF & @CRLF & "Maak de map handmatig aan.") Exit EndIf EndIf If Not FileExists("C:\Windows\OEMLOGO") Then DirCreate("C:\Windows\OEMLOGO") If not FileExists("C:\Windows\OEMLOGO") Then MsgBox(4096, "Let op!", "OEMLOGO map niet kunnen aanmaken." & @CRLF & "C:\Windows\OEMLOGO" & @CRLF & @CRLF & "Maak de map handmatig aan.") Exit EndIf EndIf If not FileExists("C:\Windows\Temp")Then DirCreate("C:\Windows\Temp") If not FileExists("C:\Windows\Temp") Then MsgBox(4096, "Let op!", "Temp map niet kunnen aanmaken." & @CRLF & "C:\Windows\Temp" & @CRLF & @CRLF & "Maak de map handmatig aan.") EndIf EndIf If not FileExists("C:\Temp") Then DirCreate("C:\Temp") EndIf FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\OEMLogo\oemlogo.BMP", "C:\Windows\OEMLOGO\oemlogo.BMP") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\Wallpaper\Levix Particulier.png", "C:\Windows\Web\Wallpaper\Levix\Levix Particulier.png") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\Wallpaper\Levix Particulier Black.png", "C:\Windows\Web\Wallpaper\Levix\Levix Particulier Black.png") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\Wallpaper\Levix Zakelijk.png", "C:\Windows\Web\Wallpaper\Levix\Levix Zakelijk.png") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\Wallpaper\Levix Zakelijk Black.png", "C:\Windows\Web\Wallpaper\Levix\Levix Zakelijk Black.png") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Register\Particulier.reg", "C:\Temp\Particulier.reg") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Register\Zakelijk.reg", "C:\Temp\Zakelijk.reg") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Software\Ninite.exe", "C:\Windows\Temp\Ninite.exe") ;========================================================================================================================================================================================= ; Creating Folders & Files ;========================================================================================================================================================================================= $GUI = GUICreate("", 197, 55, -1, -1, $WS_POPUPWINDOW) $COMPUTERSHOP = GUICtrlCreateButton("Computershop", 16, 16) $AUTOMATISERING = GUICtrlCreateButton("Automatisering", 104, 16) GUISetState(@SW_SHOW) ;========================================================================================================================================================================================= While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $COMPUTERSHOP Computershop() Case $AUTOMATISERING Automatisering() EndSwitch WEnd ;========================================================================================================================================================================================= Func Computershop() If FileExists("C:\WINDOWS\Web\Wallpaper\Levix") Then FileDelete("C:\Windows\Web\Wallpaper\Levix\Levix Zakelijk.png") FileDelete("C:\Windows\Web\Wallpaper\Levix\Levix Zakelijk Black.png") EndIf RegWrite("HKCU\Control Panel\Desktop" , "Wallpaper" , "REG_MULTI_SZ" , "C:\WINDOWS\Web\Wallpaper\Levix\Levix Particulier.png") $VAR = RegRead("HKCU\Control Panel\Desktop" , "Wallpaper") MsgBox(4096, "Register waarde", "Register waarde voor de achtergrond: " & @CRLF & @CRLF & $VAR) RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Logo", "REG_MULTI_SZ", "C:\Windows\OEMLOGO\oemlogo.bmp") $VAR = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Logo") MsgBox(4096, "Register waarde", "Register waarde voor het oemlogo: " & @CRLF & @CRLF & $VAR) RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Manufacturer", "REG_MULTI_SZ", "Levix") $VAR = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Manufacturer") MsgBox(4096, "Register waarde", "Register waarde voor het fabrikant: " & @CRLF & @CRLF & $VAR) RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportPhone", "REG_MULTI_SZ", "| Geffen: 073-5341325 | Oss: 0412-692090 | Uden: 0413-331536 | Rosmalen: 073-5220070 | 's Hertogenbosch: 073-6440576 |") $VAR = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportPhone") MsgBox(4096, "Register waarde", "Register waarde voor het telefoonnr.: " & @CRLF & @CRLF & $VAR) RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportURL", "REG_MULTI_SZ", "https://webshop.levix.nl/bedrijfsinfo/bedrijfsprofiel/contact") $VAR = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportURL") MsgBox(4096, "Register waarde", "Register waarde voor het support url: " & @CRLF & @CRLF & $VAR) Run("C:\Windows\Temp\Ninite.exe /repair") $TITLE = "Ninite" $SUB = "Close" WinWait($TITLE, $SUB) If Not WinActive($TITLE, $SUB) Then WinActivate($TITLE, $SUB) WinActive($TITLE, $SUB) ControlClick($TITLE, $SUB, "Button1") Sleep(1000) FileDelete("C:\Windows\Temp\Ninite.exe") MsgBox(4096, "Let op!", "Instellingen zijn voltooid, systeem gaat herstarten als er op OK geklikt wordt.") Stop() EndFunc ;========================================================================================================================================================================================= Func Automatisering() If FileExists("C:\WINDOWS\Web\Wallpaper\Levix") Then FileDelete("C:\Windows\Web\Wallpaper\Levix\Levix Particulier.png") FileDelete("C:\Windows\Web\Wallpaper\Levix\Levix Particulier Black.png") EndIf RegWrite("HKCU\Control Panel\Desktop" , "Wallpaper" , "REG_MULTI_SZ" , "C:\WINDOWS\Web\Wallpaper\Levix\Levix Zakelijk.png") $VAR = RegRead("HKCU\Control Panel\Desktop" , "Wallpaper") MsgBox(4096, "Register waarde", "Register waarde voor de achtergrond: " & @CRLF & @CRLF & $VAR) RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Logo", "REG_MULTI_SZ", "C:\Windows\OEMLOGO\oemlogo.bmp") $VAR = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Logo") MsgBox(4096, "Register waarde", "Register waarde voor het oemlogo: " & @CRLF & @CRLF & $VAR) RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Manufacturer", "REG_MULTI_SZ", "Levix") $VAR = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Manufacturer") MsgBox(4096, "Register waarde", "Register waarde voor het fabrikant: " & @CRLF & @CRLF & $VAR) RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportPhone", "REG_MULTI_SZ", "| Geffen: 073-5341131 |") $VAR = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportPhone") MsgBox(4096, "Register waarde", "Register waarde voor het telefoonnr.: " & @CRLF & @CRLF & $VAR) RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportURL", "REG_MULTI_SZ", "http://www.levix.nl/automatisering/contact") $VAR = RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportURL") MsgBox(4096, "Register waarde", "Register waarde voor het support url: " & @CRLF & @CRLF & $VAR) Run("C:\Windows\Temp\Ninite.exe /repair") $TITLE = "Ninite" $SUB = "Close" WinWait($TITLE, $SUB) If Not WinActive($TITLE, $SUB) Then WinActivate($TITLE, $SUB) WinActive($TITLE, $SUB) ControlClick($TITLE, $SUB, "Button1") Sleep(1000) FileDelete("C:\Windows\Temp\Ninite.exe") MsgBox(4096, "Let op!", "Instellingen zijn voltooid, systeem gaat herstarten als er op OK geklikt wordt.") Stop() EndFunc ;========================================================================================================================================================================================= Func Stop() $DP = "herstart.cmd" If FileExists($DP) Then FileDelete($DP) EndIf If $DP = -1 Then MsgBox(4096, "Fout!", "herstart.cmd kon niet geopend worden") Else $var = FileOpen($DP, 1) FileWrite($VAR, "@ECHO OFF" & @CRLF) FileWrite($VAR, "TITLE Systeem herstart" & @CRLF) FileWrite($var, "net accounts /maxpwage:unlimited" & @CRLF) FileWrite($var, "shutdown -r -t 30" & @CRLF) FileWrite($var, "ECHO." & @CRLF) FileWrite($var, "del herstart.cmd" & @CRLF) EndIf Sleep(3000) Run(@ComSpec & " /c " & 'START /min herstart.cmd', "", @SW_HIDE) Sleep(500) Exit EndFunc ;========================================================================================================================================================================================= Edited September 25, 2014 by Wingens Link to comment Share on other sites More sharing options...
Solution JohnOne Posted September 25, 2014 Solution Share Posted September 25, 2014 Try changing HKLM to HKLM64 if your OS is 64 bit. AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
jaberwacky Posted September 25, 2014 Share Posted September 25, 2014 Would you need to restart the computer afterwards? Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
SadBunny Posted September 25, 2014 Share Posted September 25, 2014 (edited) Tried this snippet from your script on my machine (W7 x64 NL): #RequireAdmin RegWrite("HKLM\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Logo", "REG_MULTI_SZ", "C:\Windows\OEMLOGO\oemlogo.bmp") $VAR = RegRead("HKLM64\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Logo") MsgBox(4096, "Register waarde", "Register waarde voor het oemlogo: " & @CRLF & @CRLF & $VAR) sleep(20) ... and I get the same result as you (correctly reads the value into the $VAR and prints it in the msgbox, but checking regedit the value is never there, even while the script is sleeping (but still active). Tried JohnOne's suggestion (changing HKLM to HKLM64) and then it runs like a charm.   /edit: Would you need to restart the computer afterwards?  No, luckily not. Having to restart Windows after any registry edit... *shudder* Edited September 25, 2014 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Wingens Posted September 25, 2014 Author Share Posted September 25, 2014 (edited) I am gonna try the HKLM64 tomorrow, let you know if it works The restart is for the wallpaper to change. We are planning to use this for notebook that come out of the box and changing this to our company settings. Â Many thanks for the help Really love the support on this forum. Edited September 25, 2014 by Wingens Link to comment Share on other sites More sharing options...
Wingens Posted September 27, 2014 Author Share Posted September 27, 2014 Thank for the help, changing the HKLM to HKLM64 did the trick. Below you see my changes. expandcollapse popup#RequireAdmin #include <GUIConstants.au3> #include <File.au3> ;========================================================================================================================================================================================= ; Creating Folders & Files ;========================================================================================================================================================================================= If not FileExists("C:\Windows\Web\Wallpaper\Levix") Then DirCreate("C:\Windows\Web\Wallpaper\Levix") If not FileExists("C:\Windows\Web\Wallpaper\Levix") Then MsgBox(4096, "Let op!", "Achtergrond map niet kunnen aanmaken." & @CRLF & "C:\Windows\Web\Wallpaper\Levix" & @CRLF & @CRLF & "Maak de map handmatig aan.") Exit EndIf EndIf If Not FileExists("C:\Windows\OEMLOGO") Then DirCreate("C:\Windows\OEMLOGO") If not FileExists("C:\Windows\OEMLOGO") Then MsgBox(4096, "Let op!", "OEMLOGO map niet kunnen aanmaken." & @CRLF & "C:\Windows\OEMLOGO" & @CRLF & @CRLF & "Maak de map handmatig aan.") Exit EndIf EndIf FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\OEMLogo\oemlogo.BMP", "C:\Windows\OEMLOGO\oemlogo.BMP") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\Wallpaper\Levix Particulier.png", "C:\Windows\Web\Wallpaper\Levix\Levix Particulier.png") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\Wallpaper\Levix Particulier Black.png", "C:\Windows\Web\Wallpaper\Levix\Levix Particulier Black.png") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\Wallpaper\Levix Zakelijk.png", "C:\Windows\Web\Wallpaper\Levix\Levix Zakelijk.png") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Graphics\Wallpaper\Levix Zakelijk Black.png", "C:\Windows\Web\Wallpaper\Levix\Levix Zakelijk Black.png") FileInstall("C:\Users\Beheerder\CloudStation\Scripting\Settings\Software\Ninite.exe", "C:\Windows\Temp\Ninite.exe") ;========================================================================================================================================================================================= ; Creating Folders & Files ;========================================================================================================================================================================================= $GUI = GUICreate("", 197, 55, -1, -1, $WS_POPUPWINDOW) $COMPUTERSHOP = GUICtrlCreateButton("Computershop", 16, 16) $AUTOMATISERING = GUICtrlCreateButton("Automatisering", 104, 16) If @OSArch = "X64" Then $HKLM = "HKLM64" Else $HKLM = "HKLM" EndIf GUISetState(@SW_SHOW) ;========================================================================================================================================================================================= While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $COMPUTERSHOP Computershop() Case $AUTOMATISERING Automatisering() EndSwitch WEnd ;========================================================================================================================================================================================= Func Computershop() ProgressOn("Levixisering", "Starten", "Laden...") Sleep(3500) ProgressSet(25, "OEMLogo") Sleep(1500) ProgressSet(50, "Levix Informatie") Sleep(1500) ProgressSet(75, "Achtergrond") Sleep(1500) ProgressSet(100, "Uitgevoerd") Sleep(1500) ProgressOff() If FileExists("C:\WINDOWS\Web\Wallpaper\Levix") Then FileDelete("C:\Windows\Web\Wallpaper\Levix\Levix Zakelijk.png") FileDelete("C:\Windows\Web\Wallpaper\Levix\Levix Zakelijk Black.png") EndIf RegWrite("HKCU\Control Panel\Desktop", "Wallpaper", "REG_SZ", "C:\WINDOWS\Web\Wallpaper\Levix\Levix Particulier.png") RegWrite($HKLM & "\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Logo", "REG_SZ", "C:\Windows\OEMLOGO\oemlogo.bmp") RegWrite($HKLM & "\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Manufacturer", "REG_SZ", "Levix") RegWrite($HKLM & "\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportPhone", "REG_SZ", "| Geffen: 073-5341325 | Oss: 0412-692090 | Uden: 0413-331536 | Rosmalen: 073-5220070 | 's Hertogenbosch: 073-6440576 |") RegWrite($HKLM & "\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportURL", "REG_SZ", "https://webshop.levix.nl/bedrijfsinfo/bedrijfsprofiel/contact") Run("C:\Windows\Temp\Ninite.exe /repair") $TITLE = "Ninite" $SUB = "Close" WinWait($TITLE, $SUB) If Not WinActive($TITLE, $SUB) Then WinActivate($TITLE, $SUB) WinActive($TITLE, $SUB) ControlClick($TITLE, $SUB, "Button1") Sleep(1000) FileDelete("C:\Windows\Temp\Ninite.exe") Beep(1000, 200) Beep(1000, 120) Beep(1000, 120) MsgBox(4096, "Let op!", "Instellingen zijn voltooid, systeem gaat herstarten als er op OK geklikt wordt.") Stop() EndFunc ;========================================================================================================================================================================================= Func Automatisering() ProgressOn("Levixisering", "Starten", "Laden...") Sleep(3500) ProgressSet(25, "OEMLogo") Sleep(1500) ProgressSet(50, "Levix Informatie") Sleep(1500) ProgressSet(75, "Achtergrond") Sleep(1500) ProgressSet(100, "Uitgevoerd") Sleep(1500) ProgressOff() If FileExists("C:\WINDOWS\Web\Wallpaper\Levix") Then FileDelete("C:\Windows\Web\Wallpaper\Levix\Levix Particulier.png") FileDelete("C:\Windows\Web\Wallpaper\Levix\Levix Particulier Black.png") EndIf RegWrite("HKCU\Control Panel\Desktop", "Wallpaper", "REG_SZ", "C:\WINDOWS\Web\Wallpaper\Levix\Levix Zakelijk.png") RegWrite($HKLM & "\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Logo", "REG_SZ", "C:\Windows\OEMLOGO\oemlogo.bmp") RegWrite($HKLM & "\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "Manufacturer", "REG_SZ", "Levix") RegWrite($HKLM & "\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportPhone", "REG_SZ", "| Geffen: 073-5341131 |") RegWrite($HKLM & "\Software\Microsoft\Windows\CurrentVersion\OEMInformation", "SupportURL", "REG_SZ", "http://www.levix.nl/automatisering/contact") Run("C:\Windows\Temp\Ninite.exe /repair") $TITLE = "Ninite" $SUB = "Close" WinWait($TITLE, $SUB) If Not WinActive($TITLE, $SUB) Then WinActivate($TITLE, $SUB) WinActive($TITLE, $SUB) ControlClick($TITLE, $SUB, "Button1") Sleep(1000) FileDelete("C:\Windows\Temp\Ninite.exe") Beep(1000, 200) Beep(1000, 120) Beep(1000, 120) MsgBox(4096, "Let op!", "Instellingen zijn voltooid, systeem gaat herstarten als er op OK geklikt wordt.") Stop() EndFunc ;========================================================================================================================================================================================= Func Stop() $DP = "herstart.cmd" If FileExists($DP) Then FileDelete($DP) EndIf If $DP = -1 Then MsgBox(4096, "Fout!", "herstart.cmd kon niet geopend worden") Else $var = FileOpen($DP, 1) FileWrite($VAR, "@ECHO OFF" & @CRLF) FileWrite($VAR, "TITLE Systeem herstart" & @CRLF) FileWrite($var, "net accounts /maxpwage:unlimited" & @CRLF) FileWrite($var, "shutdown -r -t 10" & @CRLF) FileWrite($var, "ECHO." & @CRLF) FileWrite($var, "del herstart.cmd" & @CRLF) EndIf Sleep(3000) Run(@ComSpec & " /c " & 'START /min herstart.cmd', "", @SW_HIDE) Sleep(500) Exit EndFunc ;========================================================================================================================================================================================= Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now