Hello. The program was written in Embarcadero RAD Studio Delphi 2010, Windows 7 32-bit OS ... When you start the program on Vista, errors of a different kind come out ... What to do? ...

For example in FormCreate ...

dir:='c:/Dir'; fileName:='c:/Dir/files.txt'; if (DirectoryExists(dir)) then {провСряСм Π½Π°Π»ΠΈΡ‡ΠΈΠ΅ Π΄ΠΈΡ€Π΅ΠΊΡ‚ΠΎΡ€ΠΈΠΈ} begin if (FileExists(fileName)) then {провСряСм Π½Π°Π»ΠΈΡ‡ΠΈΠ΅ Ρ„Π°ΠΉΠ»Π°} begin AssignFile(usersfile, fileName); Reset(usersfile); while not Eof(usersfile) do begin i:=i+1; ReadLn(usersfile, temp[i]);{Ρ‡ΠΈΡ‚Π°Π΅ΠΌ ΠΈΠ· Ρ„Π°ΠΉΠ»Π° ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Ρ} end; CloseFile(usersfile); end; end else begin ForceDirectories(dir); AssignFile(usersfile, fileName); ReWrite(usersfile); CloseFile(usersfile); end; 

when you press a button

  AssignFile(usersfile, fileName); Append(usersfile); WriteLn(usersfile, edit1.text); // значСния ΠΈΠ· тСкстовых ΠΏΠΎΠ»Π΅ΠΉ WriteLn(usersfile, edit2.text); WriteLn(usersfile, edit3.text); WriteLn(usersfile, edit4.Text); CloseFile(usersfile); 

An error occurs invalid specification files% s ...

Also, an error occurs when connecting to the server ...

Thank.

  • It will be possible to clarify what the error is and what server you are trying to connect to. - ichbinkubik

3 answers 3

You are trying to access files that only the admin has access to. In Vista and Seven, you need to increase privileges (dig in the direction of UAC). So do all the installers.

If it is critical for you to use these paths, then raise the privileges of the application (again, UAC + Delphi + Google), if not, create files in the TEMP folder, the Documents folder, in other words, where you have access.

    Can you try using a more familiar for windows format path?

     dir:='c:\Dir'; fileName:='c:\Dir\files.txt'; 

      As far as I remember, in win7 you need to be given full rights of use (properties - security - change -% username% - full access). There was the same problem, it was solved in this way.