{"record":{"id":"709ddee9e6c47722","repo":"peass-ng/PEASS-ng","slug":"the-delayuntilreboot-flag-is-invalid-for-this-meth","errorCode":null,"errorMessage":"The DelayUntilReboot flag is invalid for this method.","messagePattern":"The DelayUntilReboot flag is invalid for this method\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/DirectoryInfo Class/DirectoryInfo CopyToMoveTo/DirectoryInfo.MoveTo.cs","lineNumber":192,"sourceCode":"      /// <exception cref=\"ArgumentNullException\"/>\n      /// <exception cref=\"DirectoryNotFoundException\"/>\n      /// <exception cref=\"IOException\"/>\n      /// <exception cref=\"NotSupportedException\"/>\n      /// <exception cref=\"UnauthorizedAccessException\"/>\n      /// <param name=\"destinationPath\">\n      ///   <para>The name and path to which to move this directory.</para>\n      ///   <para>The destination cannot be another disk volume unless <paramref name=\"moveOptions\"/> contains <see cref=\"MoveOptions.CopyAllowed\"/>, or a directory with the identical name.</para>\n      ///   <para>It can be an existing directory to which you want to add this directory as a subdirectory.</para>\n      /// </param>\n      /// <param name=\"moveOptions\"><see cref=\"MoveOptions\"/> that specify how the directory is to be moved. This parameter can be <c>null</c>.</param>\n      /// <param name=\"progressHandler\">A callback function that is called each time another portion of the directory has been moved. This parameter can be <c>null</c>.</param>\n      /// <param name=\"userProgressData\">The argument to be passed to the callback function. This parameter can be <c>null</c>.</param>\n      [SecurityCritical]\n      public CopyMoveResult MoveTo(string destinationPath, MoveOptions moveOptions, CopyMoveProgressRoutine progressHandler, object userProgressData)\n      {\n         // Reject DelayUntilReboot.\n         if ((moveOptions & MoveOptions.DelayUntilReboot) != 0)\n            throw new ArgumentException(\"The DelayUntilReboot flag is invalid for this method.\", \"moveOptions\");\n\n         string destinationPathLp;\n\n         var cmr = CopyToMoveToCore(destinationPath, false, null, moveOptions, null, progressHandler, userProgressData, out destinationPathLp, PathFormat.RelativePath);\n\n         UpdateSourcePath(destinationPath, destinationPathLp);\n\n         return cmr;\n      }\n\n\n      /// <summary>[AlphaFS] Moves a <see cref=\"DirectoryInfo\"/> instance and its contents to a new path, <see cref=\"MoveOptions\"/> can be specified,\n      ///   <para>and the possibility of notifying the application of its progress through a callback function.</para>\n      /// </summary>\n      /// <remarks>\n      ///   <para>Use this method to allow or prevent overwriting of an existing directory.</para>\n      ///   <para>This method does not work across disk volumes unless <paramref name=\"moveOptions\"/> contains <see cref=\"MoveOptions.CopyAllowed\"/>.</para>\n      ///   <para>Whenever possible, avoid using short file names (such as <c>XXXXXX~1.XXX</c>) with this method.</para>","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/DirectoryInfo Class/DirectoryInfo CopyToMoveTo/DirectoryInfo.MoveTo.cs#L174-L210","documentation":"An argument validation error inside DirectoryInfo.MoveTo: the code validates the MoveOptions flags and rejects MoveOptions.DelayUntilReboot because a move of an existing directory object cannot be deferred to reboot (that flag only applies to file-copy style APIs). It fires when the caller's moveOptions contain DelayUntilReboot.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/DirectoryInfo Class/DirectoryInfo CopyToMoveTo/DirectoryInfo.MoveTo.cs:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove MoveOptions.DelayUntilReboot from the moveOptions argument","Perform the move immediately without the deferral flag, retrying later at application level if needed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}