1

特定のユーザーでEXEを実行する必要があります。そこでCreateProcAsUser、JCL Library の下で関数 JclMiscel を使用しました。しかし、コードを実行すると実行時例外が発生します。ここにあります

「NT バージョン 3.51 ビルド 1057 以降が必要です」というメッセージを含む例外クラス EjdError

ここに私のコードがあります

var
  Command2, TemExtractPath, x,TargetDirectory: String;
begin
  try
    TemExtractPath := 'C:\MtntopDispense\Updates\HICOnline\temp';
    TargetDirectory := 'D:\Test';
    Command2 := 'Robocopy "' + TemExtractPath + '" "' + TargetDirectory +
      '" /MIR /dcopy:T';
    CreateProcAsUser('.', 'nexusdb', 'mtntop', Command2);

  except
    on E: Exception do

      ShowMessage(E.StackTrace + '-' + E.Message);
  end;
end;
4

0 に答える 0