I'm attempting to write a script that will gather the output of a few basic windows commands into a set of files, and am finding my vssadmin commands frustrating. The command is a relatively simple
os.system('vssadmin list writers>> x:\foo\vss.txt')
The problem is that I'm writing in python 32-bit and want to make sure this will function on 64-bit Windows. When executing this, the return is:
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2005 Microsoft Corp.
Error: A Volume Shadow Copy Service component encountered an unexpected error. Check the Application event log for more information.
Can I invoke a 64-bit command line from 32-bit python and decide whether to invoke it with a bit-depth detecting function, or is there another more elegant solution?
Follow-up: using MBu as a jumping off point I found that the following command does the trick:
os.system('%systemroot%\\sysnative\\cmd.exe /c vssadmin list writers > x:\\foo\\vss.txt')