I’m not entirely sure what’s going on with this script, but basically this is what I’m trying to do:
I have a Windows batch script that uses the doskey command to define some macros. In Python, I wish to call one of these macros. On one system, I am able to do this but on the other it tells me it is not a valid command. Yet, on both systems, if I call “doskey /macros” I see all the macros properly defined.
Through python I’m attempting to call the macro simply with the subprocess call command:
from subprocess import call
call( "some_macro", shell=True )
As mentioned, this works just fine on one system, but not the other (both running Windows 7 64-bit).
I’m aware I could get around this by making the call directly in Python instead of trying to call the macro, but I want to understand why this isn’t working even though the shell context python gets seems to have the macro properly defined (as observed by running the doskey /macro command).
Any thoughts?
The answer was to accept the inferior nature of the Windows shell and simply embed my commands in Python instead.
Not exactly what I was hoping for.