AutoHotkey Community

It is currently May 27th, 2012, 1:39 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 62 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
 Post subject:
PostPosted: September 26th, 2008, 5:32 pm 
Offline

Joined: August 12th, 2008, 10:13 pm
Posts: 16
Now it's fixed. But i every time get the first byte. MoveFilePointerEx don't work, i don't know why. It don't exit with errorlevel.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2009, 8:39 am 
Offline

Joined: May 31st, 2008, 3:22 pm
Posts: 47
sorry, but that codes very not simple for me, too big and i dont understand what do there :( i guess code in Delphi less & easier than in AHK...
i need one simple thing, i know about WinHex, thanks..
Find all "D:\" and Replace with "E:\" in below file
Code:
%A_AppData%\uTorrent\Resume.dat


Delphi example

Code:
procedure TForm1.Button1Click(Sender: TObject);
var
  f: file;
  l: Longint;
  FileName, oldstring, newstring, s: string;
begin
  oldstring := 'old string';
  newstring := 'new string';
  FileName  := 'c:\YourFileName.xyz';
   
  s := oldstring;
  AssignFile(f, FileName);
  Reset(f, 1);
  for l := 0 to FileSize(f) - Length(oldstring) - 1 do
  begin
    Application.ProcessMessages;
    Seek(f, l);
    BlockRead(f, oldstring[1], Length(oldstring));
    if oldstring = s then
    begin
      Seek(f, l);
      BlockWrite(f, newstring[1], Length(newstring));
      ShowMessage('String successfully replaced!');
    end;
    Application.ProcessMessages;
  end;
  CloseFile(f);
end;


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 62 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 21 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group