Send an URL with anchor (#) from cmd to default internet browser

Started by elhiero, March 24, 2025, 06:29:19 PM

Previous topic - Next topic

elhiero

I'm adding some "help" links to my CCE software.

When I tried to send "https://exiftool.org/exiftool_pod.html#Utilities" to my internet browser from a cmd window, (or, in fact from my CCE.jar program) , the cmd utility intercepts the # character.

cmd /c start "" "https://exiftool.org/exiftool_pod.html#Utilities" -> the anchor will be lost.
None of the AIs found a simple solution ...

The workaround is :
set xyz="#Utilities"
cmd /c start "" "https://exiftool.org/exiftool_pod.html%xyz%"

StarGeek

Maybe it's a browser problem? My default is Firefox, and copy/pasting your first command to CMD/PowerShell properly opens the link at the correct anchor point.

Maybe try escaping the hashtag with a caret ^
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

elhiero

Right, I made a mistake in my scripts, a full Internet url can be send through cmd.
Thanks for your feedback, I can now clean my program for Internet links.

The problem stays for local urls
( start "" "file:///C:/CCE/test/ExiftoolComplements/html/exiftool_pod.html#Utilities" ) : the anchor is deleted.
No workaround neither esc character , I'll use another process ...