参考一下这个吧(声明: 此代码出自本论坛 PcBar 大侠之手, 本人略作修改使其可以右键打开所选文件所在目录): RegWrite('Hkcr\*\Shell\OpenTagDir','','Reg_Sz','&K. 打开所在目录')
RegWrite('Hkcr\*\Shell\OpenTagDir\Command','','Reg_Sz',@ScriptFullPath&' "%1" ')
_OpenTagDir()
Func _OpenTagDir()
If $CmdLineRaw <> '' Then
$TagDir = StringMid(StringLeft($CmdLineRaw,StringInStr($CmdLineRaw,'\',2,-1) -1),2,-1)
If $TagDir <> '' Then
ShellExecute('Explorer',' /E, '&$TagDir,'','',@Sw_ShowMaxiMized)
Else
Exit
EndIf
EndIf
EndFunc
#Cs
$Ask=MsgBox(36+262144,'右键显示文件路径','提示,请问是否添加右键菜单?点【是】将添加,点【否】将删除!',2)
If $Ask=6 Or $Ask = -1 Then
Else
RegDelete('Hkcr\*\Shell\OpenTagDir')
RegDelete('Hkcr\LnkFile\Shell\Open Folder')
EndIf
;刷新系统:
DllCall('Shell32.Dll', 'none', 'SHChangeNotify', 'int', 0x08000000, 'int', 0x00000000 + 0x00001000, 'ptr', 0, 'ptr', 0)
#Ce
|