Home > Software design >  Open PDF with Edge in Fullscreen through Batch
Open PDF with Edge in Fullscreen through Batch

Time:10-16

at the moment im trying to open a pdf file %UserInputID%.pdf in fullscreen but i dont quite get it to work.

At the moment im just doing start "" /max "path\%UserInputID%.pdf".

I did find out about outdated workarounds with powershell that use SendKeys but as that is not completly supported anymore (?) i thought about using the startparameter of edge/chromium. But how? How to use --start-fullscreen as a parameter? Just appending it like -parameter \%UserInputID%.pdf" ---start-fullscreen does not work, neither does /parameter \%UserInputID%.pdf" /--start-fullscreen. Happy for every answer or hint. *Edge is the standard pdf programm

*Edit / Addendum: After KJ's Answer I also figured

start "name" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --start-fullscreen file:///"path\%UserInputID%.pdf" 

as a (partial) valid answer. Partial because if only a single (partial) instance of edge is still open (normal x doesnt do the job) it wont work, as it seem like it cant "start" in fullscreen if it is already open in non fullscreen mode.

CodePudding user response:

There are in your case two ways to use MSEdge

The first as you know is if it is the default pdf application then it will use current edge profile to open the pdf so as you describe we can simply use

start "" /max "mydemo.pdf"

And Edge will use its default settings to display MyDemo.PDF in a window but will ignore the /MAX request.

It is the same if we call it directly

start "" /max msedge "file:///C:\mypath\mydemo.pdf"

However we can use it in Kiosk mode

start "" "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"  --kiosk --no-first-run --edge-kiosk-type=fullscreen file:///C:\mypath\mydemo.pdf

if you wish you can also add a minute timer for auto release to normal mode but it is minutes not seconds

--kiosk-idle-timeout-minutes=1

  • Related