开发者

SHCreateItemFromParsingName cannot use path starting with "\\?\"

开发者 https://www.devze.com 2023-02-25 05:25 出处:网络
I am moving a folder from one volume to another using SHCreateItemFromParsingName. One volume path starts with \"\\?\\\" and SHCreate开发者_StackOverflowItemFromParsingName does not work with it.

I am moving a folder from one volume to another using SHCreateItemFromParsingName. One volume path starts with "\?\" and SHCreate开发者_StackOverflowItemFromParsingName does not work with it.

Is it by design? or I miss anything to make it work?

Since MoveFileEx only works for moving directory inside a volume and CopyFileEx only works for copying file (not directory), Shell object's MoveItem is the only option for me to move folder cross volumes. But now I am blocked by "\?\" thing. Appreciate any help!


The "\?\" is a problem for a lot of File APIs (especially in .Net). You may want to use FindFile, CreateDirectory and MoveFile to recursively move the files. These Win32 functions will take file paths that start with "\?\".

Check out pinvoke: FindFirstFile

0

精彩评论

暂无评论...
验证码 换一张
取 消