net stop ftpsvc
import os
import time
def stop_server(server_name):
command = 'net stop ' + server_name
print "stop %s" %(server_name)
#print "cmd = %s" %(command)
os.system(command)
def start_server(server_name):
command = 'net start ' + server_name
print "stop %s" %(server_name)
#print "cmd = %s" %(command)
os.system(command)
if __name__ == '__main__':
server_name='ftpsvc'
stop_server(server_name)
start_server(server_name)
time.sleep(10)