Pastybinneriest

start.py

Dec 16th, 2021 (edited)
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. import sys
  2. import os
  3. from time import sleep
  4. from PyQt5.QtGui import QGuiApplication
  5. from PyQt5.QtQml import QQmlApplicationEngine
  6. user = os.environ['USERNAME']
  7. app = QGuiApplication(sys.argv)
  8. engine = QQmlApplicationEngine()
  9. engine.quit.connect(app.quit)
  10. engine.load("C:/Users/" + user + "/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/start.qml")
  11. sleep(1)
  12. print("attempting removal")
  13. os.remove("C:/Users/" + user + "/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/start.py")
  14. print("removed start.py")
  15. os.remove("C:/Users/" + user + "/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/start.qml")
  16. print("removed start.qml")
  17. os.remove("C:/Users/" + user + "/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/main.qml")
  18. sys.exit(app.exec())
Add Comment
Please, Sign In to add comment