Data Execution Protection
DEP wir duch ändern einer einzelnen Zeile permanent aktiviert.
Die BOOT.INI wird zunächst komplett in ein Array eingelesen. Danach wird zeilenweise nacheinander nach zwei Strings gesucht und diese dann geändert.
Zum Schluss dann abspeichern unter neuem Namen und das Kopieren/Umbenennen der BOOT.INI
option expliciton error resume nextDim fso, filein, fileout, i, return, str Set fso = CreateObject("Scripting.FileSystemObject")Set filein = fso.GetFile("C:\BOOT.INI")Set fileout = fso.createtextfile("C:\BOOT_ORG.INI")function edit_ini ()filein.attributes = 32set filein=fso.opentextfile ("C:\BOOT.INI",1)i=0redim preserve zeile(i)do while not (filein.AtEndOfStream) zeile(i) = lcase(filein.readline) if instr (zeile(i), "/noexecute=") then if instr (zeile(i), "/noexecute=alwaysoff") then wscript.quit else if instr (zeile(i), "/noexecute=optin") then zeile(i)=replace (zeile(i),"/noexecute=optin", "/noexecute=alwaysoff") return = true end if end if end iffileout.writeline (zeile(i))loopfileout.closefilein.closeif return then fso.copyfile "C:\BOOT.INI", "C:\BOOT_ORIGINAL.INI" fso.copyfile "C:\BOOT_ORG.INI", "C:\BOOT.INI", true fso.deletefile "C:\BOOT_ORG.INI" Set filein = fso.GetFile("C:\BOOT.INI") Set fileout = fso.GetFile("C:\BOOT_ORIGINAL.INI") filein.attributes = 39 fileout.attributes = 39end ifend functionfunction restore_origif fso.FileExists("C:\BOOT_ORIGINAL.INI") then Set filein = fso.GetFile("C:\BOOT.INI") Set fileout = fso.GetFile("C:\BOOT_ORIGINAL.INI") filein.attributes = 32 fileout.attributes = 32 fso.copyfile "C:\BOOT_ORIGINAL.INI","C:\BOOT.INI"  fso.deletefile "C:\BOOT_ORIGINAL.INI" if fso.FileExists("C:\BOOT_ORG.INI") then fso.DeleteFile "C:\BOOT_ORG.INI" end iffilein.attributes = 39end ifend function