Python - os.system can not use C:\Windows\sysnative when script is compiled to .exe

Viewed 98

I am working on a tool for automating a repetitive process. I use WSL to parse a file by running a linux tool. My os.system call displays The system cannot find the path specified.

The call I am using is:

os.system('"C:\\Windows\\sysnative\\wsl.exe" cat "%s" | syslog2siptrace > "%s"' % (linuxdir + grepfile, linuxdir + xmlfile))

When I run this in the interactive interpreter it works perfectly, but when I compile the script into an .exe I get the error.

If I use system32 instead of sysnative in the compiled script then I get : is not recognized as an internal or external command, operable program or batch file.

I tried doing this for testing purposes:

os.system('dir C:\\Windows\\sysnative\\')

And it actually listed the contents of the C:\Windows\System32 directory (and wsl.exe was in the list) though it did say Directory of C:\Windows\sysnative.

0 Answers
Related