急,急,急!!(5分)

  • 主题发起人 主题发起人 li_yu
  • 开始时间 开始时间
L

li_yu

Unregistered / Unconfirmed
GUEST, unregistred user!
有 copy directory 的一个过程,

procedure copydirectorytree(Ahandle:Thandle;
const AFromDirectory,AToDirectory:String);
var

................

................
end;  


怎样在一个 Button 中调用 (如将d:/xxx copy to f:/yyy)
 
copydirectorytree(application.handle,'d:/xxx','f:/yyy');
 
Try ShellExecute to call up a DOS batch file, although there might have other
better way for your problem.

1. Two procedures in Delphi:
procedure TForm2.CopyFiles;
begin
ShellExecute(Handle, 'open', PChar('command.com'),
PChar('/c test.bat'),
nil, SW_SHOW);
end;

procedure TForm2.btnCopyDirectoryClick(Sender: TObject);
begin
CopyFiles();
end;

2. test.bat in DOS, details as follow:

md h:/dest
copy h:/source/*.* h:/dest/*.*
 

Similar threads

后退
顶部