Skip to content

Commit

Permalink
CREATE_NO_WINDOW on lnk creation
Browse files Browse the repository at this point in the history
  • Loading branch information
PJDude committed Mar 2, 2024
1 parent 751d967 commit a3e4dc2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@

from subprocess import run as subprocess_run

if os_name=='nt':
from subprocess import CREATE_NO_WINDOW

from pickle import dumps,loads
from zstandard import ZstdCompressor,ZstdDecompressor

Expand Down Expand Up @@ -827,7 +830,7 @@ def do_win_lnk_link(self,src,dest,l_info):
powershell_cmd = f'$ol=(New-Object -ComObject WScript.Shell).CreateShortcut("{dest}")\n\r$ol.TargetPath="{src}"\n\r$ol.Save()'
l_info(f'{powershell_cmd=}')

res = subprocess_run(["powershell", "-Command", powershell_cmd], capture_output=True)
res = subprocess_run(["powershell", "-Command", powershell_cmd], capture_output=True,creationflags=CREATE_NO_WINDOW)

if res.returncode != 0:
return f"Error on win lnk code: {res.returncode} error: {res.stderr}"
Expand Down

0 comments on commit a3e4dc2

Please sign in to comment.