This was a bit painful to do with regedit, so ended up creating reg.exe commands - This is for docx to .md or .html. Either in the global context or specific for Docx file.
- Pandoc is installed via Scoop - change the path if it isnt the same as yours
- Word icon
"Global area" HKCU\SOFTWARE\Classes*\shell\
reg add "HKCU\SOFTWARE\Classes\*\shell\Pandoc" /ve /t REG_EXPAND_SZ /d "Pandoc to MD" /f
reg add "HKCU\SOFTWARE\Classes\*\shell\Pandoc" /v "Icon" /t REG_EXPAND_SZ /d "%ProgramFiles%\Microsoft Office\Root\VFS\Windows\Installer\{90160000-000F-0000-1000-0000000FF1CE}\wordicon.exe" /f
reg add "HKCU\SOFTWARE\Classes\*\shell\Pandoc\command" /ve /t REG_EXPAND_SZ /d "\"%UserProfile%\scoop\shims\pandoc.exe\" \"%1\" --extract-media=. --from=docx --to=gfm -o \"%1\".md" /f
"Just show for docx files" HKCU\SOFTWARE\Classes\SystemFileAssociations.docx
reg add "HKCU\SOFTWARE\Classes\SystemFileAssociations\.docx\shell\Pandoc" /ve /t REG_EXPAND_SZ /d "Pandoc to MD" /f
reg add "HKCU\SOFTWARE\Classes\SystemFileAssociations\.docx\shell\Pandoc" /v "Icon" /t REG_EXPAND_SZ /d "%ProgramFiles%\Microsoft Office\Root\VFS\Windows\Installer\{90160000-000F-0000-1000-0000000FF1CE}\wordicon.exe" /f
reg add "HKCU\SOFTWARE\Classes\SystemFileAssociations\.docx\shell\Pandoc\command" /ve /t REG_EXPAND_SZ /d "\"%UserProfile%\scoop\shims\pandoc.exe\" \"%1\" --extract-media=. --from=docx --to=gfm -o \"%1\".md" /f
Variant with HTML
reg add "HKCU\SOFTWARE\Classes\SystemFileAssociations\.docx\shell\Pandoc2" /ve /t REG_EXPAND_SZ /d "Pandoc to HTML" /f
reg add "HKCU\SOFTWARE\Classes\SystemFileAssociations\.docx\shell\Pandoc2" /v "Icon" /t REG_EXPAND_SZ /d "%ProgramFiles%\Microsoft Office\Root\VFS\Windows\Installer\{90160000-000F-0000-1000-0000000FF1CE}\wordicon.exe" /f
reg add "HKCU\SOFTWARE\Classes\SystemFileAssociations\.docx\shell\Pandoc2\command" /ve /t REG_EXPAND_SZ /d "\"%UserProfile%\scoop\shims\pandoc.exe\" \"%1\" --embed-resources=true --from=docx --to=html -o \"%1\".html" /f
more info gathered here: https://mrlixm.github.io/blog/windows-explorer-context-menu/#footnote-reference-1
Alternatively install the .reg files but i dont like how Expanded_sz converts to hex, so you dont really know what is in them