home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2005 May
/
PCWorld_2005-05_cd.bin
/
software
/
vyzkuste
/
zastupci
/
zastupci.exe
/
pcwMultilink.VBS
< prev
next >
Wrap
Text File
|
2005-03-13
|
3KB
|
106 lines
dim menuname(40)
dim ziel(40)
dim Parameter(40)
dim Symbol(40)
Set myfiles = CreateObject("Scripting.FileSystemObject")
Set myshell = CreateObject("Wscript.Shell")
mydesktop=myShell.SpecialFolders("Desktop")
on error resume next
lnkfolder=mydesktop & "\Links.TMP"
set lnkfolder=MyFiles.Getfolder(mydesktop & "\Links.TMP")
set linkfiles=lnkfolder.Files
for each link in linkfiles
check=ucase(right(link.name,4))
if check=".LNK" Or check=".PIF" then
clink=clink+1
menuname(clink)=left(link.name,len(link.name)-4)
set multilink=MyShell.CreateShortcut(link.path)
ziel(clink)=multilink.Targetpath
Parameter(clink)=multilink.Arguments
Symbol(clink)=multilink.IconLocation
end if
next
if clink=0 then
msgbox "Ve slo₧ce " & mydesktop & "\LINKS.TMP nejsou ₧ßdnφ zßstupci, kterΘ by bylo mo₧nΘ p°enΘst do kontextovΘho menu novΘho typu souboru."
wscript.quit
end if
for temp=1 to clink
allmenus=allmenus & "(" & temp & ") " & menuname(temp) & chr(13)
next
mainjob=inputbox(clink & " odkaz(y) nalezeny. Vyberte hlavnφ odkaz, kter² se mß provΘst p°i poklepßnφ na zßstupce:" & chr(13) & chr(13) & allmenus)
for temp=1 to clink
if mainjob = cstr(temp) then
mainok=1
exit for
end if
next
if mainok=0 then wscript.quit
if Parameter(mainjob)="" then
MainCommand=ziel(mainjob) & " %*"
else
MainCommand=ziel(mainjob) & " " & Parameter(mainjob) & " %*"
end if
if len(symbol(mainjob))<4 then
set IsEXE=MyFiles.GetFile(ziel(mainjob))
if ucase(right(IsEXE.Name,3))="EXE" then symbol(mainjob)=IsEXE.path & ",0"
end if
if len(symbol(mainjob))<4 then
err.clear
set IsFolder=MyFiles.GetFolder(ziel(mainjob))
if err.number=0 then symbol(mainjob)="Shell32.dll,3"
end if
if len(symbol(mainjob))<4 then
symbol(mainjob)="pifmgr.dll," & counter + 3
end if
counter=myshell.regRead("HKCR\V00File\V00Links")
if counter="" then
counter=0
myshell.regwrite("HKCR\V00File\V00Links"),"0"
Erweiterung="V00"
else
counter=counter + 1
if counter < 10 then
Erweiterung="V0" & counter
else
Erweiterung="V" & counter
end if
myshell.regwrite("HKCR\V00File\V00Links"),counter
end if
Dateityp=Erweiterung & "File"
msgbox "Registr nynφ obsahuje nov² datov² typ souboru - " & Dateityp
myshell.regwrite("HKCR\." & Erweiterung & "\"),Dateityp
myshell.regwrite("HKCR\" & Dateityp & "\"),"VBScript"
myshell.regwrite("HKCR\" & Dateityp & "\NeverShowExt"),""
myshell.regwrite("HKCR\" & Dateityp & "\DefaultIcon\"),symbol(mainjob)
myshell.regwrite("HKCR\" & Dateityp & "\ScriptEngine\"),"VBScript"
myshell.regwrite("HKCR\" & Dateityp & "\Shell\"),""
myshell.regwrite("HKCR\" & Dateityp & "\Shell\Open\"),""
myshell.regwrite("HKCR\" & Dateityp & "\Shell\Open\Command\"),maincommand
myshell.regwrite("HKCR\" & Dateityp & "\ShellEx\"),""
myshell.regwrite("HKCR\" & Dateityp & "\ShellEx\DropHandler\"),"{60254CA5-953B-11CF-8C96-00AA00B8708C}"
for temp=1 to clink
if not cstr(temp) = mainjob then
myshell.regwrite("HKCR\" & Dateityp & "\Shell\" & menuname(temp) & "\"),""
myshell.regwrite("HKCR\" & Dateityp & "\Shell\" & menuname(temp) & "\Command\"),ziel(temp) & " " & parameter(temp)
end if
next
datei=mydesktop & "\" & menuname(mainjob) & "." & Erweiterung
set multilink=myFiles.CreateTextFile(datei)
multilink.writeline "-- Poznßmky --"