{"record":{"id":"9d932e0d4b5111a3","repo":"microsoft/ailab","slug":"the-specified-file-is-blocked-and-can-not-be-unblocked","errorCode":null,"errorMessage":"The specified file is blocked and can not be unblocked. {pptPath}","messagePattern":"The specified file is blocked and can not be unblocked\\. (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"VirtualStage/Speaker.Recorder/Speaker.Recorder/PowerPoint/PowerPointHelper.cs","lineNumber":65,"sourceCode":"            }\n            catch (Exception e)\n            {\n                Debug.WriteLine($\"Exception finding program for {extension}: {e}\");\n                return null;\n            }\n        }\n\n        public static void Initilize()\n        {\n            powerPointPath = FindExtensionExe(\".pptx\");\n        }\n\n        public static Process StartPowerPoint(string pptPath)\n        {\n            var success = FileUnblocker.Unblock(pptPath);\n            if (!success)\n            {\n                throw new InvalidOperationException($\"The specified file is blocked and can not be unblocked. {pptPath}\");\n            }\n\n            if (powerPointPath == null)\n            {\n                powerPointPath = FindExtensionExe(Path.GetExtension(pptPath));\n            }\n\n            var processName = Path.GetFileNameWithoutExtension(powerPointPath);\n            var existingProcesses = Process.GetProcessesByName(processName);\n            foreach (var item in existingProcesses)\n            {\n                var cmd = GetCommandLine(item);\n                if (cmd?.Contains(\"/s\", StringComparison.InvariantCultureIgnoreCase) == true)\n                {\n                    item.Kill();\n                }\n            }\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/microsoft/ailab/blob/89fe2fc62081145ec5408d42059cbcb7c4a033c8/VirtualStage/Speaker.Recorder/Speaker.Recorder/PowerPoint/PowerPointHelper.cs#L47-L83","documentation":"StartPowerPoint must first remove the Windows Mark-of-the-Web zone identifier from the presentation via FileUnblocker.Unblock; PowerPoint refuses to open files downloaded from the internet unless they are unblocked. When Unblock reports failure, the method throws this InvalidOperationException rather than launching a blocked file. It fires when the pptx retains a blocked zone identifier that cannot be removed — typically due to file permissions, the file being locked by another process, or an unblocker implementation failure.","triggerScenarios":"Thrown at VirtualStage/Speaker.Recorder/Speaker.Recorder/PowerPoint/PowerPointHelper.cs:65 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check file permissions and that no other process holds the pptx open before unblocking","Unblock the file manually (file Properties > Unblock, or PowerShell Unblock-File) to confirm it is the unblock step failing","Catch the InvalidOperationException in the recording workflow, log pptPath, and skip or prompt the user instead of crashing","Copy the file to a local temp location before opening, which often drops the zone identifier"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"89fe2fc62081145ec5408d42059cbcb7c4a033c8","analyzedAt":"2026-09-13T20:10:53.835Z","contentChangedAt":"2026-09-13T20:10:53.835Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}