' Script to update the file attributes of 2 folios to fix a slow startup problem in WIN ME
' Rick Johnson
' 2/8/2001

' make sure the user really wants to do this
Continue = Msgbox("This script will modify file attributes.  Is this OK?", vbOKCancel)
if Continue = 2 then
	Wscript.Quit
end if

Dim A(2)

On Error Resume Next ' catch any errors

' get the directory where the folios are held
Set WshShell = WScript.CreateObject("WScript.Shell")
foliodir = WshShell.RegRead("HKEY_CURRENT_USER\Software\EGWhite\4\Directories\Infobase")

' check for errors
Call CheckErr

' set the 2 files that need to have attributes changed
A(0) = foliodir & "\EGWINDEX.NFO"
A(1) = foliodir & "\EGW-COMP.NFO"

Set fso = CreateObject("Scripting.FileSystemObject")
For i = 0 to 1
	Set f = fso.GetFile(A(i))
	' check for any errors
	Call CheckErr
	' if the Read-Only bit is already set then don't mess with it
	if NOT (f.Attributes AND 1) then
		f.Attributes = f.Attributes + 1
	end if
Next

Wscript.Echo "The Files have been updated."

' check for any errors
Sub CheckErr
	if Err > 0 then
		Wscript.Echo "Cannot Find Installed Files.  Please Contact Tech Support."
		Wscript.Quit
	end if
End Sub