===刪除的路徑或資料夾名稱含空白===
import os
folder = "%APPDATA%\\Adobe\\Flash*"
folder = "%APPDATA%\\Macromedia"
folder = "%SystemRoot%\\system32\\Macromed"
folder = "%SystemRoot%\\SysWOW64\\Macromed"
command = "rmdir /s /q \"%s\""
command = command % folder
print command
result = os.system(command)
if result == 0:
print "刪除檔案成功"
else:
print "刪除檔案沒成功"
===Flash安裝與新增的資料夾位置===
C:\Windows\System32\Macromed
C:\Windows\SysWOW64\Macromed
C:\Users\username\AppData\Roaming\Adobe
C:\Users\username\AppData\Roaming\Macromedia