I'm trying to call an external function from Python: the function is vboxmanage.exe and I'm accessing it via subprocess call. The problem is that call cannot find the vboxmanage.exe program, even though it is listed in the path variable. I have tried every possible combination, with path, without path, with listing the full director, without listing the director, but call never finds it: vboxmanage is not recognized as an internal or external command, operable program or batch file.
Here my questions:
- For what reason does call disregard my path variable while in the Windows 10 commend prompt the path variable works fine? I'm using shell=True, so this shouldn't happen.
- Why is it not possible to specify a path of a program and have it executed like that from the command prompt (assuming it's not in path variable). This used to work under DOS a long time ago, but not in Windows 10. I.e. when I type in the command prompt "c:\Program Files....\vboxmanage.exe" it won't find the program. I have to first go into the directory and the execute it.
- Is there a way to manually navigate into the directory via call command and then invoke a second call command to open vboxmanage.exe?
from subprocess import call
param="c:\\Program Files\Oracle\VirtualBox\\vboxmanage controlvm MacBook keyboardputscancode "+h
print (param)
call([param], shell=True)