public static void Main(string[] args) { bool retVal; retVal = SeBackupPrivilegeUtils.isSeBackupPrivilegeEnabled(); Console.WriteLine(retVal ? "Yes!" : "no"); SeBackupPrivilegeUtils.setSeBackupPrivilege(true); retVal = SeBackupPrivilegeUtils.isSeBackupPrivilegeEnabled(); Console.WriteLine(retVal ? "Yes!" : "no"); if (!retVal) { Console.WriteLine("SeBackupPrivilege is not enabled, giving up"); return; } uint bytesCopied = 0; retVal = SeBackupPrivilegeUtils.CopyFile("c:/temp/x.txt", "c:/temp/y.txt", ref bytesCopied, true); if (retVal) { Console.WriteLine("Copied " + bytesCopied.ToString() + " bytes"); } }
protected override void EndProcessing() { bool retVal = SeBackupPrivilegeUtils.isSeBackupPrivilegeEnabled(); Console.WriteLine("SeBackupPrivilege is " + (retVal ? "enabled" : "disabled")); }