Tự động chạy ứng dụng hay file patch mỗi khi mở cửa sổ CMD

Người đăng: buonkhongem on Thứ Ba, 14 tháng 5, 2013


Bạn có thể kích hoạt một chương trình hay chạy một file patch tự động mỗi lần chạy lệnh cmd (cửa sổ dòng lệnh Dos) của Windows theo cách dưới đây:
- Mở menu Start > chọn All Programs > chọn Accessories > chọn Notepad.
- Trong cửa sổ Notepad, bạn nhập nội dung sau:

Option Explicit

Dim WSHShell, n, MyBox, p, itemtype

Set WSHShell = WScript.CreateObject("WScript.Shell")
p = "HKCU\Software\Microsoft\Command Processor\"
p = p & "AutoRun"
itemtype = "REG_SZ"
n = ""

WSHShell.RegWrite p, n, itemtype

Set ws = WScript.CreateObject("WScript.Shell")
Dim ws, t, p1, p2, n2, cn

p1 = "HKCU\Software\Microsoft\Command Processor\"

n2 = ws.RegRead(p1 & "AutoRun")
t = "CMD AutoRun"
cn = InputBox("Enter exact path to batch file and click OK", t, n)
If cn "" Then
Đọc thêm »

{ 0 nhận xét... read them below or add one }

Đăng nhận xét