0

Please tell me how to open .lnk files

it is not opening this:

import webbrowser as wb
wb.open('dir_path/ Microsoft Edge.lnk')

But when i do this:

import webbrowser as wb
wb.open('dir_path/ picture.png')

or any thing else it opens the path

Frantisek Kossuth
  • 3,524
  • 2
  • 23
  • 42
help102
  • 32
  • 4
  • Do you mean .ink or .lnk files? What file type are these anyway? – 9769953 Jun 30 '20 at 15:07
  • I think you mean `.lnk`. Those are windows shortcut files. Python cannot open and read their content as they only hold reference to another file on your machine. Check this: https://stackoverflow.com/questions/397125/reading-the-target-of-a-lnk-file-in-python – Mezbaul Haque Jun 30 '20 at 15:12
  • Thank you very much. I wrote the file extension as .ink but it is .lnk – help102 Jul 01 '20 at 03:49

0 Answers0