visaokoten Thành viên chính thức
Tiêu đề: Một số code hay để xem hệ thống máy tính Wed Feb 22, 2012 7:01 pm | |
| 1. Quick shutdownNhấn chuột phãi vào àmn hình Desktop -> New -> shortcut và nhập nội dung: - Code:
-
shutdown -s -t xx
Với xx là thời gian (thường là "05" giây) , -s = Shut Down , -r = Restart Sau đó các bạn nhấn chuột phãi vào Shortcut -> Properties -> Thẻ Shortcut -> Shortcut Key => Ðặt cho nó cái phím tắt , sau này có muốn tắt máy thì nhấn vào phím đó (có thể đặt cả tổ hợp phím). ví dụ: shutdown -s -t 05 với lệnh trên thì Máy tính sẽ tắt trong vòng 5 giây. 2. Thay đổi thông tin đăng ký người dùng trong System Properties
Bạn mới mua máy tính củ về khi bạn mở System Properties bạn sẽ thấy thông tin đăng ký (Registered to) của một người dùng nào đó . Thủ thuật sau sẽ giúp bạn điều chỉnh thông tin đăng ký này rất dể dàng . Bạn mở Notepad của mình và chép đọan mã sau vào : - Code:
-
Option Explicit
Set ws = WScript.CreateObject("WScript.Shell")
Dim ws, t, p1, p2, n, g, cn, cg
Dim itemtype
p1 = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\"
n = ws.RegRead(p1 & "RegisteredOwner")
g = ws.RegRead(p1 & "RegisteredOrganization")
t = "Change Owner and Organization Utility"
cn = InputBox("Type new Owner and click OK", t, n)
If cn <> "" Then
ws.RegWrite p1 & "RegisteredOwner", cn
End If
cg = InputBox("Type new Organization and click OK.", t, g)
If cg <> "" Then
ws.RegWrite p1 & "RegisteredOrganization", cg
End If
Lưu lại và đặt tên là changeinfouser.vbs3. Nhận biết USB 2.0 có trên máy tính của mìnhBạn mới vừa mua máy tính , người bán họ nói máy tính của bạn có gắn cổng USB 2.0 . Còn bạn , “dân mới vào nghề” không biết đâu mà lần , thôi thì tin vào chính mình vậy . Đoạn code sau sẽ giúp bạn nhận biết được USB 2.0 có cài đặt trên máy tính của bạn hay không . Mở Notepad chép và dán đọan code này vào . Đặt tên cho nó là testusb.vbs - Code:
-
On Error Resume Next
RegKey = "HKLM\SYSTEM\CurrentControlSet\Enum\USB\ROOT_HUB20"
CreateObject("WScript.Shell").RegRead(RegKey & "\")
If Err Then
If InStr(LCase(Err.Description), "invalid root") > 0 Then
MsgBox "This computer does not seem to be USB 2 enabled."
Else
MsgBox "This computer appears to be USB 2 enabled."
End If
End If
4. Thêm một số công cụ khi nhấn chuột phải vào My ComputerBạn có muốn thêm các chức năng có trong hệ điều hành Windows XP chẳng hạn như Control Panel , Service , Registry Editor , LogOff , Shutdown , Add/Remove Programs , Drive Cleanup , System Restore , Device Manager , Reset khi bạn nhấn chuột phải vào My Computer hay không . Bạn mở trình soạn thảo văn bản Notepad lên sau đó bạn chép và dán đọan mã này vào trong Notepad . Đọan mã như sau : - Code:
-
Windows Registry Editor Version 5.00
;Them Control Panel khi nhan chuot phai o My Computer
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-
08002B30309D}\shell\Control Panel\command]
@="rundll32.exe shell32.dll,Control_RunDLL"
;Them Registry Editor khi nhan chuot phai o My Computer
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-
08002B30309D}\shell\regedit]
@=hex(2):52,00,65,00,67,00,69,00,73,00,74,00,72,00,79,00,20,00,45,00,64,00,\
69,00,74,00,6f,00,72,00,00,00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-
08002B30309D}\shell\regedit\command]
@=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,72,00,65,\
00,67,00,65,00,64,00,69,00,74,00,2e,00,65,00,78,00,65,00,00,00
;Them Add/Remove khi nhan chuot phai o My Computer
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-
08002B30309D}\shell\Add/Remove\command]
Welcome To VNECHIP http://www.vnechip.com - Where People Go To Know
VNECHIP – Advanced Technologies , 24/7 Support , Free Fastest Online
@="control appwiz.cpl"
;Them Drive Cleanup khi nhan chuot phai o My Computer
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Drive
Cleanup\command]
@="cleanmgr"
;Them Services khi nhan chuot phai o My Computer
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Services]
@=hex(2):53,00,65,00,72,00,76,00,69,00,63,00,65,00,73,00,00,00
"SuppressionPolicy"=dword:4000003c
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-
08002B30309D}\shell\services\command]
@=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,73,00,79,00,73,\
00,74,00,65,00,6d,00,33,00,32,00,5c,00,6d,00,6d,00,63,00,2e,00,65,00,78,00,\
65,00,20,00,2f,00,73,00,20,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,\
00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,\
32,00,5c,00,73,00,65,00,72,00,76,00,69,00,63,00,65,00,73,00,2e,00,6d,00,73,\
00,63,00,20,00,2f,00,73,00,00,00
;Them System Restore khi nhan chuot phai o My Computer
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\System
Restore\command]
@=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,73,00,79,00,73,\
00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,65,00,73,00,74,00,6f,00,72,00,\
65,00,5c,00,72,00,73,00,74,00,72,00,75,00,69,00,2e,00,65,00,78,00,65,00,00,\
00
;Them Device Manager khi nhan chuot phai o My Computer
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-
08002B30309D}\shell\DevMgr]
@="Device Manager"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-
08002B30309D}\shell\DevMgr\command]
@="mmc.exe %%SYSTEMDRIVE%%\\WINDOWS\\SYSTEM32\\devmgmt.msc"
;Them LogOff khi nhan chuot phai o My Computer
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-
08002B30309D}\shell\[LogOff]\command]
@="shutdown -l -f -t 5"
;Them Reset khi nhan chuot phai o My Computer
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-
08002B30309D}\shell\[Reboot]\command]
@="shutdown -r -f -t 5"
;Them Shutdown khi nhan chuot phai o My Computer
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-
08002B30309D}\shell\[Shutdown]\command]
@="shutdown -s -f -t 5"
Bây giờ bạn lưu lại với tên là addonmycomputer.reg Tiến hành chạy tập tin này , thật tuyệt khi có các công cụ hổ trợ được thêm vào khi bạn nhấn phím phải chuột và chọn My Computer . 5. Bạn đang sống tuần thứ mấy trong một nămĐể biết vị trí tuần thứ mấy trong trong một năm bạn làm như sau : Mở Notepad và chép đọan mã sau vào : - Code:
-
Wscript.Echo("Week=" & DatePart("ww",Date,vbSunday,vbFirstFourDays)) Lưu tập tin này mang tên là week.vbs 6.Thay đổi Thông tin đăng ký người dùngBạn mở Notepad và chép đọan mã sau vào : - Code:
-
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
"RegisteredOwner"="KTMT08"
"RegisteredOrganization"="Dien dan KTMT08" Lưu tập tin này với tên là changeid.reg7. Thêm chức năng System Information vào menu ngữ cảnhSystem Information hiển thị thông tin về máy tính của bạn . Hổ trợ bạn về thông tin trên máy tính của bạn vì thế bạn có thể giãi quyết những sự cố trên máy tính của bạn . Để sử dụng nó cách đơn giản bạn vào Start – Run gỏ MSINFO32.EXE và nhấn phím Enter , tập tin msinfo32.exe nằm ở đường dẩn Program Files\Common Files\Microsoft Shared\MSInfo . Thủ thuật sau sẽ giúp bạn thêm chức năng System Information vào menu ngữ cảnh khi bạn nhấn chuột phải vào tập tin hay thư mục nào đó . Mở Notepad và chép đọan mã sau vào . - Code:
-
Option Explicit
On Error Resume Next
Dim WSHShell, MyBox, p1, q1, t
Dim jobfunc, strName
Set WSHShell = WScript.CreateObject("WScript.Shell")
strName = InputBox("Enter the name you would like for the entry.","Add System Information to
right click","System Information")
p1 = "HKEY_CLASSES_ROOT\Directory\shell\MSINFO32\"
q1="%CommonProgramFiles%\Microsoft Shared\MSInfo\msinfo32.exe"
jobfunc = "System Information has been added to the" & vbCR
jobfunc = jobfunc & "right click context menu in Explorer."
WSHShell.RegWrite p1, strName, "REG_SZ"
WshShell.RegWrite p1 & "command\", q1, "REG_EXPAND_SZ"
t = "Confirmation"
MyBox = MsgBox (jobfunc, 4096, t)
Set WshShell = Nothing Lưu tập tin này lại với tên là addoninfo.vbs8. Kiểm tra thời điểm log on máy tínhBạn muốn biết lượng thời gian mà mình đã log on vào máy tính, user nào đã đăng nhập vào máy tính của bạn lần cuối cùng. Hãy để script sau giúp đỡ bạn làm điều này Bạn hãy copy đoạn mã sau vào Notepad và l ưu lại dưới tên lastlogon.vbs - Code:
-
Option Explicit
Dim objWMIService, colItems, WshNetwork, strComputer
Dim objUser, objItem, dtmLastLogin, strLogonInfo
Set WshNetwork = CreateObject("Wscript.Network")
strComputer = WshNetwork.ComputerName
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_UserAccount Where Domain = '" & strComputer & "'")
For Each objItem in colItems
dtmLastLogin = ""
On Error Resume Next
Set objUser = GetObject("WinNT://" & strComputer _
& "/" & objItem.Name & ",user")
dtmLastLogin = objUser.lastLogin
On Error Goto 0
strLogonInfo = strLogonInfo & vbCrLf & objItem.Name & ": " & dtmLastLogin
Next
MsgBox strLogonInfo, vbOKOnly + vbInformation, "Last Logon Information for Local Users" Nếu bạn cần biết các thông tin đăng nhập lần cuối cùng, bạn hãy đặt script này vào thư mục Startup Để mở thư mục Startup: Run > "shell:startup" (không có dấu ngoặc kép) và nhấn ENTER. Kéo tập tin lastlogon.vbs vào thư mục Startup. |
| |