Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FileExists and ITEMIDLIST
#1
I understand than FileExists(sFold 1) does not work if sFol happens to be an ITEMIDLIST, for example "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}".

I would appreciate any suggestion on a workaround to overcome this issue. Many thanks in advance.
#2
Function ShellObjectExists
Code:
Copy      Help
;/
function! $path

;Returns 1 if the specified shell object exists, 0 if not.

;path - can be a file system path, ":: ITEMIDLIST" or "::{CLSID}". Cannot be a display name, like "Control Panel".

;REMARKS
;Like <help>FileExists</help>, but supports non-file objects such as virtual folders and Control Panel items.
;Uses <help>PidlFromStr</help>.


ITEMIDLIST* p=PidlFromStr(path)
if(p=0) ret
CoTaskMemFree p
ret 1

Maybe not the best way. Little tested.


Forum Jump:


Users browsing this thread: 1 Guest(s)