{"record":{"id":"453f929ccbdf16d3","repo":"peass-ng/PEASS-ng","slug":"the-operation-is-not-supported-on-this-version-of-453f92","errorCode":null,"errorMessage":"The operation is not supported on this version of Windows.","messagePattern":"The operation is not supported on this version of Windows\\.","errorType":"exception","errorClass":"PlatformNotSupportedException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/File Class/File Core Methods/File.CreateSymbolicLinkCore.cs","lineNumber":54,"sourceCode":"      /// <para>When creating a symbolic link, the operating system does not check to see if the target exists.</para>\n      /// <para>Symbolic links are reparse points.</para>\n      /// <para>There is a maximum of 31 reparse points (and therefore symbolic links) allowed in a particular path.</para>\n      /// <para>See <see cref=\"Security.Privilege.CreateSymbolicLink\"/> to run this method in an elevated state.</para>\n      /// </remarks>\n      /// <exception cref=\"ArgumentException\"/>\n      /// <exception cref=\"ArgumentNullException\"/>\n      /// <exception cref=\"IOException\"/>\n      /// <exception cref=\"PlatformNotSupportedException\">The operating system is older than Windows Vista.</exception>\n      /// <param name=\"transaction\">The transaction.</param>\n      /// <param name=\"symlinkFileName\">The name of the target for the symbolic link to be created.</param>\n      /// <param name=\"targetFileName\">The symbolic link to be created.</param>\n      /// <param name=\"targetType\">Indicates whether the link target, <paramref name=\"targetFileName\"/>, is a file or directory.</param>\n      /// <param name=\"pathFormat\">Indicates the format of the path parameter(s).</param>\n      [SecurityCritical]\n      internal static void CreateSymbolicLinkCore(KernelTransaction transaction, string symlinkFileName, string targetFileName, SymbolicLinkTarget targetType, PathFormat pathFormat)\n      {\n         if (!NativeMethods.IsAtLeastWindowsVista)\n            throw new PlatformNotSupportedException(new Win32Exception((int) Win32Errors.ERROR_OLD_WIN_VERSION).Message);\n\n\n         if (pathFormat != PathFormat.LongFullPath)\n         {\n            const GetFullPathOptions options = GetFullPathOptions.RemoveTrailingDirectorySeparator | GetFullPathOptions.FullCheck;\n\n            symlinkFileName = Path.GetExtendedLengthPathCore(transaction, symlinkFileName, pathFormat, options);\n            targetFileName = Path.GetExtendedLengthPathCore(transaction, targetFileName, pathFormat, options);\n         }\n\n\n         // Don't use long path notation, as it will be empty upon creation.\n         targetFileName = Path.GetRegularPathCore(targetFileName, GetFullPathOptions.None, false);\n\n\n         if (targetType == SymbolicLinkTarget.Directory)\n         {\n            ThrowIOExceptionIfFsoExist(transaction, false, targetFileName, pathFormat);","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/3rdParty/AlphaFS/Filesystem/File Class/File Core Methods/File.CreateSymbolicLinkCore.cs#L36-L72","documentation":"CreateSymbolicLinkCore throws PlatformNotSupportedException when the OS is older than Windows Vista (Win32 error ERROR_OLD_WIN_VERSION). Symbolic link creation requires APIs (CreateSymbolicLink) that only exist on Vista+, so AlphaFS blocks execution before calling native code. This is an OS-capability gate, not a data error.","triggerScenarios":"Calling File.CreateSymbolicLink or File.CreateSymbolicLinkTransacted on Windows XP/Server 2003 or a non-Windows/restricted environment where NativeMethods.IsAtLeastWindowsVista is false.","commonSituations":"Running winPEAS/AlphaFS-based tooling on legacy Windows XP images, embedded/industrial boxes, or under a compatibility shim that reports an old version.","solutions":["Run the application on Windows Vista or later","Check NativeMethods.IsAtLeastWindowsVista (or Environment.OSVersion) before calling CreateSymbolicLink and use an alternative (e.g. hardlink/junction or copy)","Wrap the call in try-catch for PlatformNotSupportedException and degrade gracefully"],"exampleFix":"// before\nFile.CreateSymbolicLink(linkPath, targetPath, SymbolicLinkTarget.File);\n// after\nif (NativeMethods.IsAtLeastWindowsVista)\n    File.CreateSymbolicLink(linkPath, targetPath, SymbolicLinkTarget.File);\nelse\n    File.Copy(targetPath, linkPath); // fallback on legacy OS","handlingStrategy":"validation","validationCode":"if (!NativeMethods.IsAtLeastWindowsVista) throw/return; // or Environment.OSVersion.Version.Major >= 6","typeGuard":"bool SupportsSymbolicLinks => Environment.OSVersion.Version.Major >= 6;","tryCatchPattern":"try { File.CreateSymbolicLink(link, target, SymbolicLinkTarget.File); }\ncatch (PlatformNotSupportedException ex) { Log(ex.Message); UseCopyFallback(); }","preventionTips":["Check IsAtLeastWindowsVista once at startup and cache the capability","Maintain a fallback path (copy/junction) for legacy OS","Document minimum OS requirement for the tool"],"tags":["platform","windows","symbolic-link","version-compatibility"],"backgroundTag":"os-version-not-supported","analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}