
copy_all_users_profile
By:
FATruden on
Sep 17th, 2012 | syntax:
Python | size: 1.08 KB | hits: 21 | expires: Never
#-------------------------------------------------------------------------------
# Name: Copy_all_profile
# Purpose:
#
# Author: mgres6161 (Alexander Rudenko)
#
# Created: 14.09.2012
# Copyright: (c) mgres6161 2012
# Licence: <Free>
#-------------------------------------------------------------------------------
#!/usr/bin/env python
import os
import sys
import subprocess
#
profile_dir_xcopy = """"C:\\Documents and Settings\\\""""
distination_path = "\\\ws-30-01-13-03\\test\\"
#
comp_name = input("Local comp name :") + """\\"""
#
full_profile_path = profile_dir_xcopy + "*"
full_distination_path = distination_path + comp_name
#
path = full_profile_path+" "+full_distination_path
PIPE = subprocess.PIPE
p = subprocess.Popen("xcopy /E/H/K/O/C/I /EXCLUDE:\\\ws-30-01-13-03\\PP\\ecept.txt %s" \
%path, shell=True, \
stdin=PIPE, stdout=PIPE, stderr=subprocess.STDOUT)
#
while True:
s = p.stdout.readline()
if not s: break
print(s)
#
print("complidet!")
#
#def main():
# pass
if __name__ == '__main__':
main()