home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2003 October
/
PCWorld_2003-10_cd.bin
/
Software
/
Vyzkuste
/
windowsxxl
/
windowsxxl.exe
/
Index.vbs
< prev
next >
Wrap
Text File
|
2003-07-19
|
3KB
|
148 lines
dim n
dim pfad(50000)
dim suche(10)
Set myshell = CreateObject("wscript.shell")
Set MyFiles = CreateObject("Scripting.FileSystemObject")
Set AppShell = CreateObject("Shell.Application")
set C = MyShell.Environment("PROCESS")
Quicklinks = C("windir") & "\Links\"
Liste = C("windir") & "\INDEX.LST"
on error resume next
if Not MyFiles.FolderExists(QuickLinks) then
MyFiles.CreateFolder(QuickLinks)
end if
set Linkfolder = MyFiles.getFolder(QuickLinks)
set Links = Linkfolder.Files
if Not MyFiles.FileExists(Liste) then
Index
end if
temp=myshell.popup("Chcete vytvo°it nov² seznam?",2,"",4)
if temp=6 then index
set liste=MyFiles.OpenTextfile(liste)
Do until liste.AtEndOfStream
n = n + 1
pfad(n)=ucase(liste.readline)
loop
liste.close
Suchen
'----------------------------------------------------------------------------
Sub Suchen()
frage=inputbox("Zadej v²raz(y) pro vyhledßvßnφ: ","",frage,1,1)
if frage="" then wscript.quit
frage=trim(ucase(frage))
if len(frage) < 4 then
i=Msgbox ("Chcete skuteΦn∞ hledat: " & frage,4, "")
if i=7 then suchen ""
end if
do
s=s+1
i=instr(frage," ")
if i > 0 then
suche(s)=left(frage, i - 1)
frage=mid(frage,i+1)
frage=ltrim(frage)
else
suche(s)=frage
end if
loop until i = 0
for each datei in Links
set del=myFiles.getfile(datei)
del.delete
next
FOR p = 1 to n
for i = 1 to s
if instr(pfad(p),suche(i)) then
if i = s then
if found = 50 then
i=myshell.run ("explorer.exe " & Quicklinks)
myshell.sendkeys "{F5}"
end if
found = found + 1
song=pfad(p)
do
x=instr(song,"\")
if x > 0 then song=mid(song,x+1)
loop until x = 0
lnk = song & ".LNK"
Do
L = L + 1
if myFiles.FileExists(QuickLinks & Lnk) then lnk = song & "(" & L & ")" & ".LNK"
loop while myFiles.FileExists(QuickLinks & lnk)
L = 0
set link = MyShell.CreateShortcut(QuickLinks & lnk)
link.TargetPath=pfad(p)
link.save
end if
else
exit for
end if
next
next
if found=0 then
set link = MyShell.CreateShortcut(QuickLinks & "Äßdn² soubor nenalezen.LNK")
link.TargetPath="notepad.exe"
link.save
end if
i=myshell.run ("explorer.exe " & Quicklinks)
myshell.sendkeys "{F5}"
Suchen
end sub
'---------------------------------------------------------------------------
sub Index ()
Set AppFolder = Appshell.BrowseForFolder(0, "", &H0001, 17)
verz = AppFolder.ParentFolder.ParseName(AppFolder.Title).Path
If err.number > 0 then
i=instr(AppFolder, ":")
verz = mid(AppFolder, i - 1, 1) & ":\"
End If
If verz="" Then wscript.quit
Set drive = MyFiles.GetFolder(verz)
Set dat = drive.Files
For Each datei In dat
n = n + 1
pfad(n) = datei.Path
Next
Search drive
i=MsgBox (n & " soubor∙ zadßno. " & chr(13) & "Budete zadßvat dalÜφ slo₧ku?",4,"")
if i=6 then
index
end if
set indexlist=MyFiles.createtextfile(liste,TRUE)
For p = 1 To n
indexlist.writeline pfad(p)
Next
indexlist.close
end sub
'-------------------------------------------------------------------
Sub Search(ByVal StartFolder)
Set Weitere = StartFolder.SubFolders
For Each AktuellerOrdner In Weitere
Set dat = AktuellerOrdner.Files
For Each datei In dat
n = n + 1
pfad(n) = datei.Path
Next
Search AktuellerOrdner
Next
End Sub