{"record":{"id":"c26683b05cab258f","repo":"peass-ng/PEASS-ng","slug":"notv1supportedexception-c26683","errorCode":null,"errorMessage":"NotV1SupportedException","messagePattern":"NotV1SupportedException","errorType":"exception","errorClass":"NotV1SupportedException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/TaskScheduler/TaskFolder.cs","lineNumber":94,"sourceCode":"                string parentPath = System.IO.Path.GetDirectoryName(path);\n                if (string.IsNullOrEmpty(parentPath))\n                    return null;\n                return TaskService.GetFolder(parentPath);\n            }\n        }\n\n        /// <summary>\n        /// Gets the path to where the folder is stored.\n        /// </summary>\n        [NotNull]\n        public string Path => (v2Folder == null) ? rootString : v2Folder.Path;\n\n        [NotNull]\n        internal TaskFolder GetFolder([NotNull] string path)\n        {\n            if (v2Folder != null)\n                return new TaskFolder(TaskService, v2Folder.GetFolder(path));\n            throw new NotV1SupportedException();\n        }\n\n        /// <summary>\n        /// Gets or sets the security descriptor of the task.\n        /// </summary>\n        /// <value>The security descriptor.</value>\n        [Obsolete(\"This property will be removed in deference to the GetAccessControl, GetSecurityDescriptorSddlForm, SetAccessControl and SetSecurityDescriptorSddlForm methods.\")]\n        public GenericSecurityDescriptor SecurityDescriptor\n        {\n#pragma warning disable 0618\n            get { return GetSecurityDescriptor(); }\n            set { SetSecurityDescriptor(value); }\n#pragma warning restore 0618\n        }\n\n        /// <summary>\n        /// Gets all the subfolders in the folder.\n        /// </summary>","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/TaskScheduler/TaskFolder.cs#L76-L112","documentation":"TaskFolder.GetFolder resolves subfolders through the v2 (Task Scheduler 2.0) COM API. When the instance wraps only a 1.0 (XP/2003) task service, v2Folder is null and the library throws NotV1SupportedException because folder hierarchies don't exist in Task Scheduler 1.0.","triggerScenarios":"Calling taskFolder.GetFolder(\"sub\") on a TaskFolder obtained from a TaskService connected to a Task Scheduler 1.0 system (Windows XP / Server 2003), where v2Folder == null.","commonSituations":"Enumeration tools like winPEAS walking task folders on XP/2003 hosts; code assuming v2 folder paths when targeting mixed Windows fleets.","solutions":["Check TaskService.HighestSupportedVersion / connect target OS before calling GetFolder and skip folder traversal on 1.0 systems","Catch NotV1SupportedException and treat the folder tree as flat (root only) on legacy systems","Only use subfolder APIs when the service is v2 (folder == null implies root on 1.0)"],"exampleFix":"// before\nvar sub = rootFolder.GetFolder(\"MyFolder\");\n// after\ntry { var sub = rootFolder.GetFolder(\"MyFolder\"); }\ncatch (NotV1SupportedException) { /* Task Scheduler 1.0: no folder tree */ }","handlingStrategy":"try-catch","validationCode":"bool v2 = TaskService.Instance.HighestSupportedVersion >= TaskService.V2_0; // or check target OS >= Vista","typeGuard":null,"tryCatchPattern":"try { var f = folder.GetFolder(name); }\ncatch (NotV1SupportedException) { /* treat as flat/root-only on 1.0 */ }","preventionTips":["Treat folder trees as a v2-only feature","Guard folder traversal with a supported-version check","Skip subfolder enumeration on XP/2003 hosts"],"tags":["taskscheduler","notv1supported","windows-xp","folders"],"backgroundTag":"task-scheduler-v1-unsupported","analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}