home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2004 December (Special)
/
PCWorld_2004-12_Special_cd.bin
/
Windows
/
tipyatriky
/
tipyatriky.exe
/
deskini.vbs
< prev
next >
Wrap
Text File
|
2003-07-13
|
3KB
|
77 lines
set MyShell = CreateObject("Wscript.Shell")
set MyFiles = CreateObject("Scripting.FileSystemObject")
windir = MyShell.ExpandEnvironmentStrings("%WINDIR%")
If Wscript.Arguments.Count = 0 Then
WoBinIch=Wscript.ScriptFullName
MyFiles.CopyFile WoBinIch, windir & "\"
If Not KeyExists("HKCR\directory\shell\desktop.ini\") Then
MyShell.RegWrite "HKCR\directory\shell\desktop.ini\", "Na&stavenφ slo₧ky"
MyShell.RegWrite "HKCR\directory\shell\desktop.ini\Command\", "wscript.exe " & Windir & "\deskini.vbs " & Chr(34) & "%1" & Chr(34) & ""
MsgBox "RozÜφ°enß nastavenφ slo₧ky byla ·sp∞Ün∞ nainstalovßna. V kontextovΘm menu ka₧dΘ slo₧ky se objevφ novß polo₧ka " & Chr(34) & "Nastavenφ slo₧ky" & Chr(34) & ", s nφ₧ m∙₧ete editovat soubor Desktop.ini libovolnΘ slo₧ky", 64, "Skript PC WORLDu: RozÜφ°enß nastavenφ slo₧ky"
Else
MyShell.RegDelete("HKCR\directory\shell\desktop.ini\Command\")
MyShell.RegDelete("HKCR\directory\shell\desktop.ini\")
MsgBox "RozÜφ°enß nastavenφ slo₧ky byla ·sp∞Ün∞ odinstalovßna", 64, "Skript PC WORLDu: Odinstalovßnφ rozÜφ°enφ slo₧ek"
End If
wscript.quit
End if
eingabe=wscript.arguments(0)
If Not MyFiles.FileExists(Eingabe & "\desktop.ini") Then
Set DesktopINI = MyFiles.CreateTextFile(Eingabe & "\desktop.ini", False)
DesktopINI.WriteLine "[.ShellClassInfo]"
DesktopINI.WriteLine "InfoTip="
DesktopINI.WriteLine "IconFile="
DesktopINI.Writeline "IconIndex="
DesktopINI.WriteLine "ConfirmFileOp=0"
DesktopINI.WriteLine
DesktopINI.WriteLine ";Tato Üablona vßm nabφzφ nejb∞₧n∞jÜφ konfiguraci Desktop.INI:"
DesktopINI.WriteLine ";"
DesktopINI.WriteLine ";InfoTip="
DesktopINI.WriteLine ";Sem m∙₧ete napsat popis nastavenφ."
DesktopINI.WriteLine ";Nap°φklad: InfoTip=Moje slo₧ka"
DesktopINI.WriteLine ";"
DesktopINI.WriteLine ";IconFile="
DesktopINI.WriteLine ";Tento °ßdek udßvß soubor, jeho₧ ikona mß b²t p°i°azena tΘ slo₧ce,"
DesktopINI.WriteLine ";ve kterΘ le₧φ soubor Desktop.INI."
DesktopINI.WriteLine ";Nap°φklad: IconFile=C:\WINDOWS\SYSTEM\SHELL32.DLL"
DesktopINI.WriteLine ";"
DesktopINI.WriteLine ";IconIndex="
DesktopINI.WriteLine ";Z ka₧dΘho souboru ikon, kter² je napsßn za polo₧kou IconFile=, musφ"
DesktopINI.WriteLine ";b²t vybrßna konkrΘtnφ ikona. ╚φslovßnφ ikon zaΦφnß nulou."
DesktopINI.WriteLine ";Nap°φklad: IconIndex=12"
DesktopINI.WriteLine ";"
DesktopINI.WriteLine ";Poslednφ °ßdek s ConfirmFileOP=0 nenφ bezpodmφneΦn∞ nutn²,"
DesktopINI.WriteLine ";ale nem∞l by b²t odstra≥ovßn, proto₧e potlaΦuje chybovΘ hlßÜenφ,"
DesktopINI.WriteLine "; pokud by se slo₧ka odstra≥ovala."
DesktopINI.Close
End If
set handle = MyFiles.GetFolder(Eingabe)
n=handle.attributes
x = n - 16
if x - 32 => 0 then x = x - 32
if x mod 2 = 1 then x = x - 1
if x < 4 then handle.attributes = n + 4
n=handle.attributes
MyShell.Run windir & "\notepad.exe " & Eingabe & "\desktop.ini"
Function KeyExists(key)
on error resume next
wert = MyShell.RegRead(key)
if err.Number=0 then
KeyExists = true
else
KeyExists = false
err.Clear
end if
end function