home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2005 July & August
/
PCWorld_2005-07-08_cd.bin
/
software
/
vyzkuste
/
tipy
/
tipy.exe
/
pcwLnkjas.HTA
< prev
next >
Wrap
Text File
|
2005-05-14
|
5KB
|
121 lines
<HTML><!--
License:
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
http://www.gnu.org/copyleft/gpl.html
Requirements:
Windows 98, ME, 2000, XP
IE 5.0, 5.5, 6.0
*/-->
<HEAD>
<TITLE>Skript PC-WORLDu: P°ejmenovßnφ zßstupc∙</TITLE>
<HTA:APPLICATION ID="pcwLnkjas" APPLICATIONNAME="pcwLnkjas" BORDER="normal" CAPTION = "Yes" SHOWINTASKBAR = "yes" SINGLEINSTANCE = "yes" SYSMENU = "yes" WINDOWSTATE = "normal" SCROLL = "yes" SCROLLFLAT = "no" VERSION = "1.0" INNERBORDER = "no" SELECTION = "yes" MAXIMIZEBUTTON = "no" MINIMIZEBUTTON = "yes" NAVIGABLE = "yes" CONTEXTMENU = "yes" BORDERSTYLE = "normal" ICON="%WINDIR%\kill.exe"/>
<STYLE type="text/css">
body {font-family:Tahoma,Verdana,Arial,Geneva; font-size:12; background-color:Buttonface }
table {font-family:Tahoma,Verdana,Arial,Geneva; font-size:12; background-color:Buttonface }
</STYLE>
</HEAD>
<SCRIPT language="JScript">
var Fs = new ActiveXObject("Scripting.FileSystemObject");
var Ws = new ActiveXObject("WScript.Shell");
var i=0; j=0; //reset counters
var tabledata = "";
var buttondata= "";
function init() {
window.resizeTo(510, 330);
setTimeout("startsuche()", 500); //forces an update of the application form
}
/*
function name: startsuche()
parameters: void
returns: void
global vars: none, but expects a <DIV ID=keytable> to exist
purpose: calls all the consecutive functions to search through folders that may contain hotkey-enabled URLs and LNKs
*/
function startsuche() {
var driveletter = new Enumerator(Fs.Drives);
for (;!driveletter.atEnd(); driveletter.moveNext()) {
if (driveletter.item().DriveType == "2") {
findlnks(driveletter.item()+"\\");
}
}
document.all.keytable.innerHTML = "<TABLE width=\"100%\" border=\"2\" rules=\"rows\">"+tabledata+"</TABLE>";
document.all.statuszeile.innerHTML="<DIV style=font-size:12\"><B>ProhledanΘ soubory: </B>"+j+"</DIV>";
if (tabledata == "") {
document.all.keytable.innerHTML = "Nebyli nalezeni ₧ßdnφ zßstupci, kterΘ by bylo nutno p°ejmenovat.";
}
}
function findlnks(folder) {
var f = Fs.GetFolder(folder);
var fnum = new Enumerator(f.Files);
for (;!fnum.atEnd(); fnum.moveNext()) {
if (Fs.GetExtensionName(fnum.item()).toLowerCase() == "lnk") {
j++
if (fnum.item().name.toLowerCase().indexOf("zßstupce - ")>-1) {
i++;
tabledata += "<TR><TD style=\"width:50px\"><Input Type=\"checkbox\" ID=B"+i+" onclick=\"renamentry(\'"+fnum.item().path.replace(/\\/g,"\\\\")+"\',\'"+i+"\')\" title=\"P°ejmenovat zßstupce\"/></TD><TD><SPAN ID=S"+i+" title=\""+fnum.item().path+"\">"+fnum.item().path+"</SPAN></TD></TR>"
}
}
}
fnum = new Enumerator(f.SubFolders);
for (;!fnum.atEnd(); fnum.moveNext()) {
findlnks(fnum.item());
}
document.all.btnok.style.visibility = "visible";
}
/*
function name: renamentry(pfad, intval)
parameters: pfad (string, path of an LNK file that will be renamed), intval (integer, a reference to it┤s HTML span element)
returns:
global vars:
*/
function renamentry(pfad, intval) {
if (document.all.item("B"+intval).checked == true ) {
document.all.item("S"+intval).innerText = document.all.item("S"+intval).innerText.replace(/Zßstupce - /g,"");
}
else { document.all.item("S"+intval).innerText = pfad; }
}
function renamefiles() {
for (intval=1; intval < i+1; intval++) {
if (document.all.item("B"+intval).checked == true) {
document.all.item("B"+intval).style.visibility = "hidden";
try {
Fs.MoveFile(document.all.item("S"+intval).title, document.all.item("S"+intval).title.replace(/Zßstupce - /g,""));
document.all.item("S"+intval).innerText = document.all.item("S"+intval).innerText.replace(/Zßstupce - /g,"");
document.all.item("S"+intval).title = document.all.item("S"+intval).title.replace(/Zßstupce - /g,"");
}
catch(e) {
alert('\"' + document.all.item("S"+intval).title + '\" nelze p°ejmenovat.');
}
}
}
}
</SCRIPT>
<BODY scroll="no" onload="init()">
<DIV ID=statuszeile></DIV><BR>
<DIV ID=keytable style="overflow:auto; height:80%;"><B>Vyhledßvßm zßstupce na vÜech diskov²ch oddφlech.<BR>Bude to chvφli trvat...</B></DIV>
<Input type="button" name="btnok" value="OK" style="visibility:hidden" onclick="renamefiles()">
<HR style="height:2px; color:black">
</BODY>
</HTML>