Bật/ tắt Registry Editor trong Windows XP
Bật/ tắt Registry Editor trong Windows XP
- Như bạn đã biết Registry là một cơ sở dữ liệu phức tạp, nó chứa các thông tin về cấu hình hệ thống và thông tin về các chương trình. Để tránh tình trạng người là sử dụng máy tính của mình để chỉnh sửa Registry, bạn có thể dùng đoạn mã sau để khóa/ mở Registry Editor (trình biên tập Registry).
Option Explicit
Dim WSHShell, n, MyBox, p, t, mustboot, errnum, vers
Dim enab, disab, jobfunc, itemtype
Set WSHShell=WScript.CreateObject("WScript.Shell")
p="HKCU\Software=\Microsoft\Windows\CurrentVersion\Policies\System\"
p=p&"DisableRegistryTools"
itemtype="REG_DWORD"
mustboot="Log off and back on, or restart your pc to"&vbCR&"effect the chages"
enab="ENABLED"
disab="DISABLED"
jobfunc="Registry Editing Tools are now"
t="Confirmation"
Err.Clear
On Error Resume Next
n=WSHShell.RegRead(p)
On Error Goto 0
errnum=Err.Number
If errnum0 Then
WSHShell.RegWrite p, 0, itemtype
End If
If n=0 Then
n=1
WSHShell.RegWrite p, 0, itemtype
Mybox=MsgBox(jobfunc&disab&vbCR&mustboot, 4096, t)
ElseIf n=1 Then
n=0
WSHShell.RegWrite p, 0, itemtype
Mybox=MsgBox(jobfunc&enab&vbCR&mustboot, 4096, t)
End If
- Lưu tập tin này lại với tên DisEnableReg.vbs và chạy tập tin này. Nếu Registry đang mở thì chương trình sẽ khóa Registry lại và ngược lại.
Cám ơn bạn đã ủng hộ forum. Chúc bạn luôn vui vẻ!
Option Explicit
Dim WSHShell, n, MyBox, p, t, mustboot, errnum, vers
Dim enab, disab, jobfunc, itemtype
Set WSHShell=WScript.CreateObject("WScript.Shell")
p="HKCU\Software=\Microsoft\Windows\CurrentVersion\Policies\System\"
p=p&"DisableRegistryTools"
itemtype="REG_DWORD"
mustboot="Log off and back on, or restart your pc to"&vbCR&"effect the chages"
enab="ENABLED"
disab="DISABLED"
jobfunc="Registry Editing Tools are now"
t="Confirmation"
Err.Clear
On Error Resume Next
n=WSHShell.RegRead(p)
On Error Goto 0
errnum=Err.Number
If errnum0 Then
WSHShell.RegWrite p, 0, itemtype
End If
If n=0 Then
n=1
WSHShell.RegWrite p, 0, itemtype
Mybox=MsgBox(jobfunc&disab&vbCR&mustboot, 4096, t)
ElseIf n=1 Then
n=0
WSHShell.RegWrite p, 0, itemtype
Mybox=MsgBox(jobfunc&enab&vbCR&mustboot, 4096, t)
End If
- Lưu tập tin này lại với tên DisEnableReg.vbs và chạy tập tin này. Nếu Registry đang mở thì chương trình sẽ khóa Registry lại và ngược lại.
Cám ơn bạn đã ủng hộ forum. Chúc bạn luôn vui vẻ!
Similar topics
» Thiết Lập Tự Động Mã Hóa EFS Trong Windows
» Tăng tốc Shutdown và Restart trong Windows 8
» Mẹo nhỏ giúp tăng tốc ổ đĩa cứng trong windows xp/ 2003
» Làm Việc Với Cửa Sổ Trong Windows
» Tăng tốc nén thư mục tập tin trong Windows XP
» Tăng tốc Shutdown và Restart trong Windows 8
» Mẹo nhỏ giúp tăng tốc ổ đĩa cứng trong windows xp/ 2003
» Làm Việc Với Cửa Sổ Trong Windows
» Tăng tốc nén thư mục tập tin trong Windows XP
Permissions in this forum:
Bạn không có quyền trả lời bài viết
|
|