Цитата ferget:
проще ставить им владельца system, а остальным разрешение только чтение »
|
Устанавливал Владеьца System на ветвь Winlogon, а остальным чтение! ну конечно,кроме самой System полный доступ,так после этого система не запускается, не на всех ветвях это работает
Что то вроде такого на Vbs
Код:
wsh.Run("""subinacl"" /keyreg ""HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"" /grant=%username%=r /grant=system=f /setowner=system"), 0 ,True
Видел не которые Программы, устанавливают защиту на ветви и дают им доступ Только чтение, после выгрузки программы их можно изменить.
Вот что мне интересно!
На файлах я делал так:
Iska, спасибо за разъеснение! опять же на vbs, хотелось бы это реализовать на C++ и такие же действия с реестром
Код:
Option Explicit
Const ReadOnly = &H01
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim strFile
Dim fso, a, b, c, d, e, f, w
With wscript.CreateObject("Scripting.FileSystemObject")
Set fso = CreateObject("Scripting.FileSystemObject")
For Each strFile In Array("c:\boot.ini", "c:\ntldr", "c:\windows\explorer.exe", "c:\windows\system32\userinit.exe", "c:\windows\system32\drivers\etc\hosts", "c:\NTDETECT.COM", "c:\WINDOWS\win.ini")
If .FileExists(strFile) Then
With .GetFile(strFile)
.Attributes = .Attributes And Not ReadOnly
End With
End If
Next
End With
Set a = fso.OpenTextFile("C:\windows\system32\drivers\etc\hosts", ForAppending, True)
Set b = fso.OpenTextFile("C:\ntldr", ForAppending, True)
Set c = fso.OpenTextFile("C:\boot.ini", ForAppending, True)
Set d = fso.OpenTextFile("C:\windows\explorer.exe", ForReading, True)
Set e = fso.OpenTextFile("C:\Windows\system32\userinit.exe", ForAppending, True)
Set f = fso.OpenTextFile("c:\NTDETECT.COM", ForAppending, True)
Set w = fso.OpenTextFile("c:\windows\win.ini", ForAppending, True)
Do
With wscript.CreateObject("Scripting.FileSystemObject")
For Each strFile In Array("C:\boot.ini", "c:\ntldr", "c:\windows\explorer.exe", "c:\windows\system32\userinit.exe", "c:\windows\system32\drivers\etc\hosts", "c:\NTDETECT.COM", "c:\WINDOWS\win.ini")
If .FileExists(strFile) Then
With .GetFile(strFile)
.Attributes = .Attributes Or ReadOnly
End With
End If
Next
End With
wscript.Sleep 1
Loop