Skip to content

Commit

Permalink
always invoke CMD with /D (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Jun 29, 2023
1 parent 93958fa commit 237e259
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions menuinst/platforms/win.py
Expand Up @@ -264,7 +264,7 @@ def _process_command(self, with_arg1=False) -> Tuple[str]:
if self.metadata["activate"]:
script = self._write_script()
if self.metadata["terminal"]:
command = ["cmd", "/K", f'"{script}"']
command = ["cmd", "/D", "/K", f'"{script}"']
if with_arg1:
command.append("%1")
else:
Expand All @@ -275,6 +275,7 @@ def _process_command(self, with_arg1=False) -> Tuple[str]:
# This flashes faster than Powershell -> BAT! Don't ask me why.
command = [
f'"{system32 / "cmd.exe"}"',
"/D",
"/C",
"START",
"/MIN",
Expand Down Expand Up @@ -335,7 +336,7 @@ def _cmd_assoc(extension, associate_to=None, query=False, remove=False) -> Compl
arg = extension
elif remove:
arg = f"{extension}="
return logged_run(["cmd", "/C", f"assoc {arg}"], check=True)
return logged_run(["cmd", "/D", "/C", f"assoc {arg}"], check=True)

@staticmethod
def _cmd_ftype(identifier, command=None, query=False, remove=False) -> CompletedProcess:
Expand All @@ -348,7 +349,7 @@ def _cmd_ftype(identifier, command=None, query=False, remove=False) -> Completed
arg = identifier
elif remove:
arg = f"{identifier}="
return logged_run(["cmd", "/C", f"assoc {arg}"], check=True)
return logged_run(["cmd", "/D", "/C", f"assoc {arg}"], check=True)

def _register_file_extensions(self):
"""WIP"""
Expand Down

0 comments on commit 237e259

Please sign in to comment.