I need to keep users from changing the screen saver on win9x machines. I know that the screen saver pathe is in the system.ini and that is where Windows looks for the current saver. I have tried to use the getprivateprofilestring on a timer with the writeprivateprofilestring if the screen saver is changed. The problem is that it looks like it is reading the file from cache and of wirting to the file in cache. Maybe I am heading in the wrong direction or I am missing something with the I/O on the ini file thing. Help?
Private Sub Form_Load()
timeStamp = FileDateTime(WinPath & "\system.ini")
End Sub
Private Sub RegTimer_Timer()
Dim Ret As Variant
Dim RetStr As String
Dim NetPath As String
Dim NowStamp

NowStamp = FileDateTime(WinPath & "\system.ini")
If NowStamp = timeStamp Then
Exit Sub
End If

Const BufSize = 500
RetStr = Space(BufSize)
Ret = GetPrivateProfileString("boot", "scrnsave.exe", "", RetStr, BufSize, WinPath & "\system.ini")
NetPath = Left(RetStr, Ret)

If NetPath = WinPath & "\My.scr" Then
' Reset the time stamp check on file.
timeStamp = FileDateTime(WinPath & "\system.ini")
Exit Sub
Else
WritePrivateProfileString "boot", "scrnsave.exe", WinPath & "\My.scr", WinPath & "\system.ini"
MsgBox "The Screen Saver cannot be changed!", vbCritical, "Notice:"
timeStamp = FileDateTime(WinPath & "\system.ini")
End If
End Sub