' Windows 起動時に ttfCache を自動削除 v1.1
' (C)2000-2001 Windows.FAQ
' http://homepage2.nifty.com/winfaq/
WScript.Echo "Windows9x/Me のフォントキャッシュをクリアします。"
Set FS = CreateObject("Scripting.FileSystemObject")
Set WShell = CreateObject("WScript.Shell")
SysRootPath = FS.GetSpecialFolder(WindowsFolder)
CachePath = SysRootPath+"\ttfCache"
initpath = SysRootPath+"\wininit.ini"
if FS.FileExists(CachePath) then
  Set Cachef = FS.GetFile(CachePath)
  Cachef.Attributes = 0
else
  WScript.echo "フォントキャッシュファイルがありません。"+vbCrlf+"処理を終了します。"
  WScript.Quit
end if
if FS.FileExists(initpath) then
  WScript.echo "すでに Wininit.ini ファイルが存在します。"+vbCrlf+"Windows を再起動してからやり直してください。"
  WScript.Quit
end if
Set Inifile = FS.CreateTextFile(initpath,true)
inittxt = "[Rename]" + vbCrLf
inittxt = inittxt + "NUL=" + CachePath + vbCrLf
Inifile.Write(inittxt)
Inifile.Close
if WShell.popup("自動的に再起動しますか？",0,"確認",4+32) = 6 then
 Wshell.Run(SysRootPath+"\rundll32.exe "+SysRootPath+"\System\Shell32.dll,SHExitWindowsEx 2")
else
 WScript.echo "再起動後に、変更が反映されます。"
end if