Advertisement
AnarchyOnline

RegIcons 0.1

Apr 13th, 2013
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.99 KB | None | 0 0
  1. "_Initialize"
  2.  global $g_RegPath;
  3.  $g_RegPath = "<xypath>\Data\Scripts\RegIcons.reg";
  4.  
  5.  if (exists ($g_RegPath)){
  6.   delete ("0", "0", $g_RegPath);
  7.  } else {
  8.   writefile ($g_RegPath, "Windows Registry Editor Version 5.00<crlf 2>", "o", );
  9.  }
  10.  
  11.  
  12. "Main"
  13.  global $g_RegPath;
  14.  
  15.  $Exts = input ("RegIcons", "Enter file extensions without dot and separated by a comma For example:", "mp3,mkv,avi", "s", , , );
  16.  $Icon = inputfile ("C:", , "Select desired icon. If no separate icon file is available select .exe file");
  17.  $Icon = replace ($Icon, '\', '\\', , , );
  18.  
  19. foreach ($Ext, $Exts, ","){
  20.  //purge old entries
  21.  writefile ($g_RegPath, "[-HKEY_CLASSES_ROOT\.$Ext]<crlf 2>", "a", );
  22.  writefile ($g_RegPath, "[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.$Ext]<crlf 2>", "a", );
  23.  
  24.  //write new entries
  25.  writefile ($g_RegPath, "[HKEY_CLASSES_ROOT\.$Ext\DefaultIcon]<crlf>", "a", );
  26.  writefile ($g_RegPath, "@=".quote($Icon, "0")."<crlf 2>", "a", );  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement