How to open Explorer with a specific file selected?

前端 未结 4 1104
误落风尘
误落风尘 2020-12-08 00:01

I would like to code a function to which you can pass a file path, for example:

C:\\FOLDER\\SUBFOLDER\\FILE.TXT

and it would open Windows E

4条回答
  •  执念已碎
    2020-12-08 00:44

    When executing the command if your path contains multiple slashes then it will not open the folder and select the file properly Please make sure that your file path should be like this

    C:\a\b\x.txt

    instead of

    C:\\a\\b\\x.txt

提交回复
热议问题