4

I am trying to open a local HTML file but I get an error every time that I do. The error message is as follow:

Error: Windows cannot access the specified device, path, or file. You may not have the appropriate permission to access the item

I have checked the properties of the file and I do have access to everything about it and I have tried other HTML files too. These files open perfectly on Microsoft edge and internet explorer, but not with Chrome. I have updated, repaired and reinstalled google chrome but to no avail. I remember a while back I was tinkering with RegEdit so that may be the issue? I am not 100% sure though as I was not editing Google Chrome files.

Thanks.

1
  • How are you trying to open the files? RIght click and "open with" ? Just double click due to file type association? Are you typing in a file path to the URL bar manually? This is something that should Just Work (unless maybe there are dynamic includes, etc. but for a simple static HTML file it should just work)
    – ivanivan
    Jun 30, 2019 at 14:00

1 Answer 1

2

Easy way:

  1. Create a new shortcut for chrome.exe.
  2. Right click > Properties
  3. Change Target from "c:\path\to\chrome.exe" to "c:\path\to\chrome.exe" --allow-file-access-from-file. Click OK to save.
  4. Run chrome using this shortcut
  5. Drag & drop html files to open.

https://stackoverflow.com/questions/18586921/how-to-launch-html-using-chrome-at-allow-file-access-from-files-mode

Easier way:

  • If you have python installed, run cmd, change directory to your folder, run python -m http.server
  • Or download Caddy server, run caddy -port 80
3
  • That worked perfectly. Thanks a million. Weird how it wont work normally.. thanks again!
    – Jordan
    Jun 30, 2019 at 14:11
  • It's a security measure to prevent malicious website from reading files on your PC, that's why it's hidden behind a flag.
    – abdusco
    Jun 30, 2019 at 16:55
  • Oh, thank you so much. I did not expect to find answer for this specific problem. Jun 30, 2020 at 9:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .