Question : Error in findfirst file size

Hi, I'm having problems with displaying the correct sum of files in a folder.

I've used

for some reason when I use the code below on a folder it brings back negative, even though the list that its adding is all positive.

I'm having trouble with both ways of getting the size.

is there a way of doing it so all files bring back the true size?
 
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
function Search(path:string;o:integer):string;
var
  sr : tsearchrec;
  res: integer;
  i  :integer;
  z:int64;
begin
  path:= includetrailingpathdelimiter(path);
  res:= findfirst(path+'*.*',faAnyfile,sr);
  while res = 0 do begin
    application.processmessages;
    if (sr.name <> '.') and (sr.name <> '..') then
      if DirectoryExists(path + sr.name) then begin


        Form32.Richedit1.lines.add('Folders: '+path+sr.name);
        Search(path + sr.name,o);
      end else begin

    //z:=Int64(sr.FindData.nFileSizeHigh) shl Int64(32) + Int64(sr.FindData.nFileSizeLow)+z;
      z:=Sr.Size;

        Filesizes:=Filesizes+z;

        Form32.Richedit1.lines.add('Files: '+path+sr.name);
      end;

    res := findnext(sr);
  end;
  findclose(sr);

end;

Answer : Error in findfirst file size

Their isn't a setting in group policy itself to do this, but there is a registry key for it:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\ScreenSaverGracePeriod : REG_SZ
You could push out the registry key itself with Group Policy Preferences though.

You may need to play around with it to get it working in your environment, some say it needs to be a DWORD others say REG_SZ, some say HKLM work s others say HKCU. I included articles from Microsoft and some discusssions links on it below as well.

http://support.microsoft.com/kb/221784

http://social.technet.microsoft.com/Forums/en-US/w7itproui/thread/37ee5887-8b18-4514-b0f5-e81e60b6ccf4
Random Solutions  
 
programming4us programming4us