protected override void EndProcessing() { uint bytesCopied = 0; bool retVal; string cwd = this.SessionState.Path.CurrentFileSystemLocation.Path; retVal = SeBackupPrivilegeUtils.CopyFile(FileUtils.expandPath(cwd, InFile), FileUtils.expandPath(cwd, OutFile), ref bytesCopied, Overwrite.ToBool()); if (retVal) { Console.WriteLine("Copied " + bytesCopied.ToString() + " bytes"); } }
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.setSeBackupPrivilege(!Disable.ToBool()); }
protected override void EndProcessing() { bool retVal = SeBackupPrivilegeUtils.isSeBackupPrivilegeEnabled(); Console.WriteLine("SeBackupPrivilege is " + (retVal ? "enabled" : "disabled")); }