H
H
hardwellZero2015-05-17 20:09:43
Python
hardwellZero, 2015-05-17 20:09:43

How to delete files on a remote PC?

Good evening.
There was a question about deleting files on a remote PC (local network).
The connection is implemented like this:

def connect(server):
  ip = server
  username = "здесь логин"
  password = "здесь пароль"
  try:
      print "Establishing connection to %s" %ip
      connection = wmi.WMI(ip, user=username, password=password)
      print "Connection established"
  except wmi.x_wmi:
      print "Your Username and Password of "+getfqdn(ip)+" are wrong."

How can I now operate files already on the REMOTE PC?
To be precise, I need to delete a specific file in a specific directory.
Thanks in advance ;)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Pukhov, 2015-05-18
@Neuroware

Judging by this script, it creates a wmi object, what to do with it is up to you, at least delete the files, at least format the disk. Which operations it supports initially can be viewed here , but which of them your object supports you need to look at its source code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question