Пример #1
0
        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");
            }
        }
Пример #2
0
        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");
            }
        }
Пример #3
0
 protected override void EndProcessing()
 {
     bool retVal = SeBackupPrivilegeUtils.setSeBackupPrivilege(!Disable.ToBool());
 }
Пример #4
0
        protected override void EndProcessing()
        {
            bool retVal = SeBackupPrivilegeUtils.isSeBackupPrivilegeEnabled();

            Console.WriteLine("SeBackupPrivilege is " + (retVal ? "enabled" : "disabled"));
        }