There is a server with several shared folders, for example

\\MyServer\Directory1 \\MyServer\Directory2 ... \\MyServer\DirectoryN 

How can I get a list of all these folders if

 \\MyServer 

not available?

  • one
    Try using WMI: GetObject("winmgmts:\\MyServer\root\CIMV2").ExecQuery("SELECT Path, Name, Caption FROM Win32_Share Where Type = 0") - Akina
  • @Akina, yes it helped. Issue as an answer so that I can accept it. - Nikolay.OAMP

1 answer 1

Try using WMI:

 GetObject("winmgmts:\\MyServer\root\CIMV2").ExecQuery("SELEC‌​T Path, Name, Caption FROM Win32_Share Where Type = 0")