How to retrieve the target of a Junction or Symlink with a standard user

前端 未结 1 943
栀梦
栀梦 2021-01-20 10:25

I am trying to get the target of a junction in my program, but the only way I managed do it is:

  1. Requesting Backup privileges
  2. p-invoke CreateFile wit
相关标签:
1条回答
  • 2021-01-20 11:05

    I think that this answer in stackoverflow would help you? How do I programmatically access the target path of a windows symbolic link? It should be possible to include a reference to the function via DllImport Attribute in a c# program.

    The required handle is obtainable from the a FileStream instance. Somewhat funny that it is marked as obsolete, but maybe the warning states what else you can do.

    0 讨论(0)
提交回复
热议问题