算了,给你随便写点吧,你试试<br>uses registry;<br>var<br> reg: Tregistry;<br> s,f:string;<br><br>begin<br> reg := TRegistry.create;<br> try<br> s:='/.GB/Shell/我的程序/command';//可以改成你想要的文件扩展名<br> f:='d:/abc/abc.exe "%1"';<br> reg.rootkey := HKEY_CLASSES_ROOT;<br> if not reg.KeyExists(s) then<br> begin<br> reg.CreateKey(s);<br> reg.OpenKey(s,true);<br> reg.WriteString('',f);<br> end;<br><br> finally<br> reg.CloseKey;<br> reg.Destroy;<br> end;