No DLL error is found, and no DOS window is flashed. Perfect. Find out what is difficult for others on the Internet, or install software to set it.
So let me do it myself. Although I only had a few lines of code, it took me 6 hours.
There are no elevate, hideexec, and BAT files on your computer,
Download the required files and place them in c: \ windows.
If you want to put it in another directory, modify the corresponding Registry path.
Download http://code.kliu.org/misc/ for elevate and hideexec
In XP, right-click to register the DLL import registry method. In win7, unless you disable UAC, it cannot be used.
I wrote this article in win7.
Register DLL. Reg
Windows Registry Editor Version 5.00 [hkey_classes_root \ dllfile \ shell] [hkey_classes_root \ dllfile \ shell \ RunAs] @ = "register DLL file" [hkey_classes_root \ dllfile \ shell \ RunAs \ command] @ = "regsvr32 \" % 1 \ "" [hkey_classes_root \ dllfile \ shell \ Uninstall] @ = "Uninstall DLL file" [hkey_classes_root \ dllfile \ shell \ Uninstall \ command] @ =" hideexec elevate regsvr32/U \ "% 1 \""
Do not use the hideexec and elevate methods:
Copy the regsvr32 file to the root directory of the C drive to obtain other non-system folders, right-click the regsvr32 attribute, select Use Management permission in compatibility settings, and then modify the preceding command in the registry
C: \ regsvr32.exe % 1 and C: \ regsvr32.exe/U % 1. If you modify the reg file directly, note the escape character.
Right-click to copy the file (folder) path. Reg
Windows Registry Editor Version 5.00 [hkey_classes_root \ * \ shell \ copypath] @ = "copy file path" "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] @ = "Copy folder path" "icon" = "C: \ Windows \ system32 \ shell32.dll, 68 "[hkey_classes_root \ directory \ shell \ copypath \ command] @ =" hideexec \ "C: \ WINDOWS \ copypath. BAT \ "\" % L \""
Right-click
Copy file (folder) name. Reg
Windows Registry Editor Version 5.00 [hkey_classes_root \ * \ shell \ copyname] "icon" = "C: \ WINDOWS \ system32 \ shell32.dll, 68 "@ =" copy file name "[hkey_classes_root \ * \ shell \ copyname \ command] @ =" hideexec \ "C :\\ WINDOWS \ copyfilename. BAT \ "\" % 1 \ "" [hkey_classes_root \ directory \ shell \ copyname] @ = "Copy folder name" "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
Save the required files and place them in c: \ windows.