本文不适用小白
不會出現什麼找不到dll的錯誤,沒有dos視窗閃過。堪稱完美級别。網上找到别人的不好用,要麼還要安裝個什麼軟體來設定。
于是自己動手吧,雖然隻有簡單幾行代碼,不過用了我6個小時的時間。
你的計算機裡是沒有elevate 和hideexec、後面的bat這些檔案的,
下載下傳所需的檔案後放到c:\windows
如果你想放在其他目錄,請修改對應的系統資料庫路徑。
elevate 和hideexec的下載下傳 http://code.kliu.org/misc/
xp下的右鍵注冊dll 的導入系統資料庫的方法, 在win7下除非你禁用uac,要不沒法用的。
下面我寫的這個在win7 杠杠的。
注冊dll.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\dllfile\shell]
[HKEY_CLASSES_ROOT\dllfile\shell\runas]
@="注冊DLL檔案"
[HKEY_CLASSES_ROOT\dllfile\shell\runas\command]
@="regsvr32 \"%1\""
[HKEY_CLASSES_ROOT\dllfile\shell\uninstall]
@="解除安裝DLL檔案"
[HKEY_CLASSES_ROOT\dllfile\shell\uninstall\command]
@="hideexec elevate regsvr32 /u \"%1\""
不使用hideexec和elevate的方法:
把regsvr32 這個檔案複制到 c盤根目錄擷取其他非系統檔案夾,然後右鍵regsvr32屬性,相容設定中選中使用管理權限啟動,之後在系統資料庫中修改上述指令為
c:\regsvr32.exe %1 和c:\regsvr32.exe /u %1 如果你直接修改reg檔案,注意 \ 字元轉義。
右鍵 複制檔案(夾)路徑.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\copypath]
@="複制檔案路徑"
"icon"="C:\\Windows\\system32\\SHELL32.dll,68"
[HKEY_CLASSES_ROOT\*\shell\copypath\command]
@="hideexec \"C:\\Windows\\copypath.bat\" \"%1\""
[HKEY_CLASSES_ROOT\Directory\shell\copypath]
@="複制檔案夾路徑"
"icon"="C:\\Windows\\system32\\SHELL32.dll,68"
[HKEY_CLASSES_ROOT\Directory\shell\copypath\command]
@="hideexec \"C:\\Windows\\copypath.bat\" \"%l\""
右鍵 複制檔案(夾)名稱.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\copyname]
"icon"="C:\\Windows\\system32\\SHELL32.dll,68"
@="複制檔案名"
[HKEY_CLASSES_ROOT\*\shell\copyname\command]
@="hideexec \"C:\\Windows\\copyfilename.bat\" \"%1\""
[HKEY_CLASSES_ROOT\Directory\shell\copyname]
@="複制檔案夾名"
"icon"="C:\\Windows\\system32\\SHELL32.dll,68"
[HKEY_CLASSES_ROOT\Directory\shell\copyname\command]
@="hideexec \"C:\\Windows\\copydirectoryname.bat\" \"%1\""
---------------------------------------copydirectoryname.bat--------------------------------------------------------------
set/p"=%~nx1"<nul |clip
---------------------------------------copyfilename.bat --------------------------------------------------------------
set/p"=%~n1"<nul |clip
---------------------------------------copypath.bat --------------------------------------------------------------
cmd /u /c set/p"=%1"<nul |clip
儲存所需的檔案後放到c:\windows