0

This is my first time trying to open an application using python and I wanted to try to open the game Valorant with it. So I used this code to try and open Valorant using python.

import os
import subprocess
subprocess.call(['C:\\Users\\Public\\Desktop\\VALORANT.lnk'])

However it returns the error

File "<stdin>", line 1, in <module>
File "C:\Program 
Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py
", line 340, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Program 
Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py
", line 854, in __init__       
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Program 
Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\subprocess.py
", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 193] %1 is not a valid Win32 application

I don't know why its returning the winerror. If anyone knows why this is happening, it would be much appreciated someone could tell me why and how I could fix it.

1 Answers1

0

C:\\Users\\Public\\Desktop\\VALORANT.lnk is not an application but a link. Insert the real location of the VALORANT application.

Jona
  • 1,218
  • 1
  • 10
  • 20