Here is what i am trying to do ...
Download an exe from web Install it silently Run the downloaded exe and pass it an argument
The code I have is
import urllib.request
import shutil
import subprocess
import os
from os import system
url = "https://downloads.com/App.exe"
output_file = "C:\\files\App.exe"
with urllib.request.urlopen(url) as response, open(output_file, 'wb') as out_file:
shutil.copyfileobj(response, out_file)
# Silent Install
subprocess.call("C:\\files\App.exe /SILENT ")
system("C:\\Program Files (x86)\\files\App.exe -ARG")
When i run it downloads the exe, installs the exe but then fails with this error when trying to exe the downloaded file
'C:/Program' is not recognized as an internal or external command,
operable program or batch file.
'C:/Program' is not recognized as an internal or external commanderror come from if no such path exists in your code?