home *** CD-ROM | disk | FTP | other *** search
/ PC World 2004 September / PCWorld_2004-09_cd.bin / software / vyzkuste / stehujemewin / stehujemewin.exe / pcwSysFolds.HTA < prev    next >
Text File  |  2004-07-06  |  11KB  |  169 lines

  1. <HTML><!--
  2.  
  3. Licence:
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License as
  6. published by the Free Software Foundation; either version 2 of
  7. the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. http://www.gnu.org/copyleft/gpl.html
  13.  
  14. Requirements:
  15. Microsoft Windows 98/ME/2000/XP, IE 5.0, 5.5, 6.0
  16.  
  17. -->
  18. <HEAD>
  19. <TITLE>Skript PC WORLDu : Nastavenφ systΘmov²ch slo₧ek</TITLE>
  20. <HTA:APPLICATION ID="pcwMyfiles" APPLICATIONNAME="pcwMyfiles" BORDER = "normal" CAPTION = "yes" SHOWINTASKBAR = "yes" SINGLEINSTANCE = "yes" SYSMENU = "yes" WINDOWSTATE = "normal" SCROLL = "no" SCROLLFLAT = "no" VERSION = "1.0" INNERBORDER = "no" SELECTION = "no" MAXIMIZEBUTTON = "no" MINIMIZEBUTTON = "no" NAVIGABLE = "no" CONTEXTMENU = "no" BORDERSTYLE = "normal" ICON="idg.ico"/>
  21. <STYLE type="text/css">
  22. body     {font-family:Tahoma,Verdana,Arial,Geneva;font-size:14;background-color:Buttonface;}
  23. table    {font-family:Tahoma,Verdana,Arial,Geneva;font-size:14;}
  24. </STYLE>
  25. </HEAD>
  26. <SCRIPT language="JScript">
  27. //shell object
  28. var wshShell =  new ActiveXObject("WScript.Shell");
  29. var strpersonal   = "";
  30. var strmypictures = "";
  31. var strmymusic    = "";
  32. var strmyvideos   = "";
  33. var strmydesktop   = "";
  34. var strmystartmenu   = "";
  35. var strmystartprogs = "";
  36. var strmystartup = "";
  37. var strmytemplates = "";
  38. var strmysendto = "";
  39. var strmyfavorites = "";
  40. var strmycookies = "";
  41. var strmyhistory = "";
  42.  
  43. function main() {
  44.   //read paths from registry  
  45.   try {
  46.     strpersonal   = wshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Personal"); 
  47.     strmypictures = wshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\My Pictures");
  48.     }
  49.     catch(error){}
  50.       if (strmypictures == "") { strmypictures = strpersonal +"\\Obrßzky"; }
  51.   try {
  52.     strmymusic    = wshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\My Music");
  53.     }
  54.      catch(error){}
  55.      if (strmymusic    == "") { strmymusic    = strpersonal +"\\Hudba";  }
  56.   try {
  57.     strmyvideos   = wshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\My Video");
  58.     }
  59.     catch(error){}
  60.     if (strmyvideos   == "") { strmyvideos   = strpersonal +"\\Filmy"; }  
  61.      try {
  62.     strmydesktop   = wshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Desktop");
  63.     strmystartmenu   = wshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Start Menu");
  64.     strmystartprogs   = wshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Programs");
  65.     strmystartup   = wshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Startup");
  66.     }
  67.     catch(error){}
  68.      if (strmystartup   == "") { strmystartup   = strmystartmenu +"\\Programme\\Autostart"; }  
  69.     strmytemplates   = wshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Templates");
  70.     strmysendto   = wshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\SendTo");
  71.     strmyfavorites   = wshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Favorites");
  72.     strmycookies   = wshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Cookies");
  73.     strmyhistory   = wshShell.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\History");
  74.      
  75.   MyMusic.value     = strmymusic;
  76.   MyVideos.value    = strmyvideos;
  77.   MyPictures.value  = strmypictures;
  78.   MyDesktop.value = strmydesktop;
  79.   MyStartMenu.value = strmystartmenu;
  80.   MyStartProgs.value = strmystartprogs;
  81.   MyStartup.value = strmystartup;
  82.   MyTemplates.value = strmytemplates;
  83.   MySendTo.value = strmysendto;
  84.   MyFavorites.value  = strmyfavorites;
  85.   MyCookies.value = strmycookies;
  86.   MyHistory.value = strmyhistory;
  87.   
  88. }
  89. function save() {
  90.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\My Pictures",MyPictures.value,"REG_SZ");
  91.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\My Music",MyMusic.value,"REG_SZ");
  92.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\My Video",MyVideos.value,"REG_SZ");
  93.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Desktop",MyDesktop.value,"REG_SZ");
  94.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Start Menu",MyStartMenu.value,"REG_SZ");
  95.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Programs",MyStartProgs.value,"REG_SZ");
  96.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Startup",MyStartup.value,"REG_SZ");
  97.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Templates",MyTemplates.value,"REG_SZ");
  98.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\SendTo",MySendTo.value,"REG_SZ");
  99.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Favorites",MyFavorites.value,"REG_SZ");
  100.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Cookies",MyCookies.value,"REG_SZ");
  101.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\History",MyHistory.value,"REG_SZ"); 
  102.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\My Pictures",MyPictures.value,"REG_SZ");
  103.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\My Music",MyMusic.value,"REG_SZ");
  104.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\My Video",MyVideos.value,"REG_SZ");
  105.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Desktop",MyDesktop.value,"REG_SZ");
  106.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Start Menu",MyStartMenu.value,"REG_SZ");
  107.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Programs",MyStartProgs.value,"REG_SZ");
  108.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Startup",MyStartup.value,"REG_SZ");
  109.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Templates",MyTemplates.value,"REG_SZ");
  110.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\SendTo",MySendTo.value,"REG_SZ");
  111.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Favorites",MyFavorites.value,"REG_SZ");
  112.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Cookies",MyCookies.value,"REG_SZ");
  113.   wshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\History",MyHistory.value,"REG_SZ");
  114.   alert("Zm∞ny budou zapsßny do registru");
  115.    //update window's content
  116.   main();
  117. }
  118. function browse(inputname) {
  119.   var objShell = new ActiveXObject("Shell.Application");
  120.   var ssfWINDOWS = 36;
  121.   var objFolder;
  122.   objFolder = objShell.BrowseForFolder(0, "Vyberte slo₧ku", 17);
  123.   if (objFolder != null) {
  124.   //this statement returns the selected folder as a value for 'inputname'
  125.   document.all.item(inputname).value = objFolder.items().item().Path;
  126.   }
  127. }
  128. </SCRIPT>
  129. <BODY scroll=no onload="javascript:window.resizeTo(700, 600);main();">
  130. <B>Obrßzky:</B><BR>
  131. <INPUT type=Text ID="MyPictures" Name="MyPictures" size=78>
  132. <INPUT Type=button Value="Zvolit" onclick="browse('MyPictures')">
  133. <BR><B>Hudba:</B><BR>
  134. <INPUT type=Text ID="MyMusic" size=78>
  135. <INPUT Type=button Value="Zvolit" onclick="browse('MyMusic')">
  136. <BR><B>Filmy:</B><BR>
  137. <INPUT type=Text ID="MyVideos" size=78>
  138. <INPUT Type=button Value="Zvolit" onclick="browse('MyVideos')">
  139. <BR><b>Pracovnφ plocha:</b><BR>
  140. <INPUT type=Text ID="MyDesktop" size=78>
  141. <INPUT Type=button Value="Zvolit" onclick="browse('MyDesktop')">
  142. <BR><B>Nabφdka Start:</B><BR>
  143. <INPUT type=Text ID="MyStartMenu" size=78>
  144. <INPUT Type=button Value="Zvolit" onclick="browse('MyStartMenu')">
  145. <BR><b>Nabφdka Start/Programy:</b><BR>
  146. <INPUT type=Text ID="MyStartProgs" size=78>
  147. <INPUT Type=button Value="Zvolit" onclick="browse('MyStartProgs')">
  148. <BR><B>Po spuÜt∞nφ:</B><BR>
  149. <INPUT type=Text ID="MyStartup" size=78>
  150. <INPUT Type=button Value="Zvolit" onclick="browse('MyStartup')">
  151. <BR><b>èablony:</b><BR>
  152. <INPUT type=Text ID="MyTemplates" size=78>
  153. <INPUT Type=button Value="Zvolit" onclick="browse('MyTemplates')">
  154. <BR><B>Odeslat:</B><BR>
  155. <INPUT type=Text ID="MySendTo" size=78>
  156. <INPUT Type=button Value="Zvolit" onclick="browse('MySendTo')">
  157. <BR><b>OblφbenΘ:</b><BR>
  158. <INPUT type=Text ID="MyFavorites" size=78>
  159. <INPUT Type=button Value="Zvolit" onclick="browse('MyFavorites')">
  160. <BR><B>Cookies:</B><BR>
  161. <INPUT type=Text ID="MyCookies" size=78>
  162. <INPUT Type=button Value="Zvolit" onclick="browse('MyCookies')">
  163. <BR><b>Historie:</b><BR>
  164. <INPUT type=Text ID="MyHistory" size=78>
  165. <INPUT Type=button Value="Zvolit" onclick="browse('MyHistory')"><BR><BR>
  166. <INPUT Type=button Value="Potvrdit" onclick="save()">
  167. <INPUT Type=button Value="Konec"       onclick="javascript:window.close();">
  168. </BODY>
  169. </HTML>