Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "_Initialize"
- global $g_RegPath;
- $g_RegPath = "<xypath>\Data\Scripts\RegIcons.reg";
- if (exists ($g_RegPath)){
- delete ("0", "0", $g_RegPath);
- } else {
- writefile ($g_RegPath, "Windows Registry Editor Version 5.00<crlf 2>", "o", );
- }
- "Main"
- global $g_RegPath;
- $Exts = input ("RegIcons", "Enter file extensions without dot and separated by a comma For example:", "mp3,mkv,avi", "s", , , );
- $Icon = inputfile ("C:", , "Select desired icon. If no separate icon file is available select .exe file");
- $Icon = replace ($Icon, '\', '\\', , , );
- foreach ($Ext, $Exts, ","){
- //purge old entries
- writefile ($g_RegPath, "[-HKEY_CLASSES_ROOT\.$Ext]<crlf 2>", "a", );
- writefile ($g_RegPath, "[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.$Ext]<crlf 2>", "a", );
- //write new entries
- writefile ($g_RegPath, "[HKEY_CLASSES_ROOT\.$Ext\DefaultIcon]<crlf>", "a", );
- writefile ($g_RegPath, "@=".quote($Icon, "0")."<crlf 2>", "a", );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement