home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2005 May
/
PCWorld_2005-05_cd.bin
/
software
/
vyzkuste
/
zastupci
/
zastupci.exe
/
PCWLnkjp.vbs
< prev
next >
Wrap
Text File
|
2004-02-18
|
2KB
|
56 lines
Set myfiles = CreateObject("Scripting.FileSystemObject")
Set myshell = CreateObject("Wscript.Shell")
Set umgebung=MyShell.Environment("PROCESS")
Set arg=wscript.arguments
on error resume next
Datei = arg(0)
mode = arg(1)
windir=umgebung("windir")
installpath=windir & "\PCWlnkjp.vbs"
neu="wscript.exe " & windir & "\PCWlnkjp.vbs " & chr(34) & "%1" & chr(34)
If Datei = "" then
a = myshell.regread("HKEY_CLASSES_ROOT\lnkfile\Shell\Otev°φt cφlovou slo₧ku \Command\")
If a="" Then
pcwscript=wscript.scriptfullname
Set pcwcopy=MyFiles.GetFile(pcwscript)
pcwcopy.copy(installpath)
myshell.regwrite("HKEY_CLASSES_ROOT\lnkfile\Shell\Otev°φt cφlovou slo₧ku \Command\"), neu & " -tg"
myshell.regwrite("HKEY_CLASSES_ROOT\lnkfile\Shell\Otev°φt pracovnφ slo₧ku\Command\"), neu & " -wk"
MsgBox "Utilita byla nainstalovßna"
wscript.quit
Else
Weg=Myfiles.Deletefile(installpath, true)
myshell.regdelete("HKEY_CLASSES_ROOT\lnkfile\Shell\Otev°φt cφlovou slo₧ku \Command\")
myshell.regdelete("HKEY_CLASSES_ROOT\lnkfile\Shell\Otev°φt cφlovou slo₧ku \")
myshell.regdelete("HKEY_CLASSES_ROOT\lnkfile\Shell\Otev°φt pracovnφ slo₧ku\Command\")
myshell.regdelete("HKEY_CLASSES_ROOT\lnkfile\Shell\Otev°φt pracovnφ slo₧ku\")
MsgBox "Utilita byla odinstalovßna"
wscript.quit
End If
End If
Set lnk = myfiles.GetFile(Datei)
Set Verk = myshell.CreateShortcut(lnk)
Target = Verk.TargetPath
If not (myfiles.FolderExists(Target)) then
Targetfolder = myfiles.GetParentFolderName(Target)
Else
Targetfolder = Target
End If
Workfolder = Verk.WorkingDirectory
Select Case mode
Case "-tg"
If not (myfiles.FolderExists(Targetfolder)) Then
MsgBox "Äßdnß platnß cφlovß slo₧ka nebyla nalezena"
Else
myshell.run Chr(34) & Targetfolder & "\" & Chr(34)
End If
Case "-wk"
If not (myfiles.FolderExists(Workfolder)) Then
MsgBox "Äßdnß platnß pracovnφ slo₧ka nebyla nalezena"
Else
myshell.run Chr(34) & Workfolder & "\" & Chr(34)
End if
End Select