| | |
pywin32 MovefileEx
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
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 approximation array assignment avogadro backend beginner binary bluetooth builtin calculator character code converter countpasswordentry curved customdialog dan08 decimals dictionaries dictionary drive dynamic examples exe file float format function gnu graphics gui heads homework http ideas import input java launcher leftmouse line linux list lists loop module mouse mysqlquery number numbers output parsing path plugin pointer port prime programming progressbar projects py2exe pygame pyqt pysimplewizard python random recursion scrolledtext sqlite statistics stdout string strings sudokusolver sum table terminal text textarea thread threading time tkinter tlapse tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable windows write wxpython xlib






