copy2sys.dpr

来自「一个用Delphi编写的很好的屏保程序」· DPR 代码 · 共 38 行

DPR
38
字号
program copy2sys;
{this is a tiny wee console utility which is useful for installing
screensavers. A list of files passed in as command line parameters
will be copied to the windows system directory. Won't work for filenames
with spaces (And I don't care). Can be used in a batch file without having to
worry about where windows is installed or whether you are on NT or 95

usage eg

copy2sys camphill.scr

}

uses
  SysUtils,
  Windows;
{$APPTYPE Console}

var
  SysDir: array[0..255] of Char;
  i: Integer;
  SrcPath, SrcFile: String;
  TargPath, TargFile: String;
begin
  GetSystemDirectory(SysDir, SizeOf(SysDir));
  TargPath:= SysDir;
  SrcPath:= ExtractFilePath(ParamStr(0));
  for i:= 1 to ParamCount do
  begin
    SrcFile:= SrcPath + ParamStr(i);
    TargFile:= TargPath+ '\' + ParamStr(i);
    if CopyFile(PChar(SrcFile), PChar(TargFile), false) then
      Writeln(Format('%s copied to %s ok', [SrcFile, TargFile]))
    else
      Writeln(Format('could not copy %s to %s', [SrcFile, TargFile]))
  end
end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?