0

I am using wmi module in python for network connection. I need to read all files which are present in network computer drives. So give me suggestion how can i do by using wmi module.

I have done connection by below code and now i need to read files inside network computer drive.

import wmi

ip = '192.168.1.18'
username = 'xxxxxx'
password = 'xxxxxx'
connection = wmi.WMI(ip, user=username, password=password)
for disk in connection.Win32_LogicalDisk (DriveType=3):
    print disk.Caption
4

1 回答 1

0

WMI 没有任何东西可以读取/写入文件内容。您只能使用 CIM_DataFile 读取与文件关联的元数据,但不能读取文件的内容。因此,您需要做的就是使用 CIM_DataFile 枚举文件并使用其中一个 shell 命令来读取内容。

于 2013-10-28T07:42:02.727 回答