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
Ashish Jain
  • 760
  • 1
  • 8
  • 23

1 Answers1

0

WMI does not have anything to read/write file content. You can only read the meta data associated with a file using CIM_DataFile but not the content of the file. So, all you need to do is enumerate the files using CIM_DataFile and use one of the shell commands to read the content.

ravikanth
  • 24,922
  • 4
  • 60
  • 60