| | |
pywin32 MovefileEx
Thread Solved |
•
•
Join Date: May 2005
Posts: 215
Reputation:
Solved Threads: 16
I was seeing if I could use python to delete a file upon reboot. I am only able to rename it at reboot, I can't figure out the syntax to set the destination to null. Below is what works to rename the file
how can I set the destination to null, to delete upon reboot?
Python Syntax (Toggle Plain Text)
import win32file import win32api win32file.MoveFileEx("test.txt", "test2.txt" , win32file.MOVEFILE_DELAY_UNTIL_REBOOT)
how can I set the destination to null, to delete upon reboot?
In a perfect world exceptions would not be needed.
•
•
Join Date: May 2005
Posts: 215
Reputation:
Solved Threads: 16
I used the method from win32api instead of win32file and this works
Python Syntax (Toggle Plain Text)
win32api.MoveFileEx("file", None, win32con.MOVEFILE_DELAY_UNTIL_REBOOT)
In a perfect world exceptions would not be needed.
![]() |
Similar Threads
- pyWin32 & wxPython (Python)
- IP adresses (Python)
- move() function ? (C++)
Other Threads in the Python Forum
- Previous Thread: Play those cute little Wave files (Python)
- Next Thread: wxPython file browser
| Thread Tools | Search this Thread |
abrupt ansi anti apache approximation array assignment avogadro backend beginner binary book builtin calculator character code converter countpasswordentry curved customdialog dan08 dictionaries dictionary dynamic examples exe file float format function gnu graphics gui heads homework import inches input java launcher library line lines linux list lists loop mouse mysql mysqlquery number numbers numeric output parsing path phonebook plugin pointer port prime programming progressbar projects py2exe pygame pysimplewizard python random recursion redirect scrolledtext software statictext statistics string strings sum table terminal text textarea thread threading time tlapse trick tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable wordgame write wxpython xlib






