我嘗試了很多東西,但由於某種原因,我無法正常工作。我正在嘗試使用Python腳本運行MS VS的dumpbin實用程序。爲什麼subprocess.Popen不工作
下面是我想什麼(什麼也沒有爲我工作)
1.
tempFile = open('C:\\Windows\\temp\\tempExports.txt', 'w')
command = '"C:/Program Files/Microsoft Visual Studio 8/VC/bin/dumpbin" /EXPORTS ' + dllFilePath
process = subprocess.Popen(command, stdout=tempFile)
process.wait()
tempFile.close()
2.
tempFile = open('C:\\Windows\\temp\\tempExports.txt', 'w')
command = 'C:/Program Files/Microsoft Visual Studio 8/VC/bin/dumpbin /EXPORTS ' + dllFilePath
process = subprocess.Popen(command, stdout=tempFile)
process.wait()
tempFile.close()
3.
tempFile = open('C:\\Windows\\temp\\tempExports.txt', 'w')
process = subprocess.Popen(['C:\\Program Files\\Microsoft Visual Studio 8\\VC\\bin\\dumpbin', '/EXPORTS', dllFilePath], stdout = tempFile)
process.wait()
tempFile.close()
做任何人有任何想法做我想要做的在Python中正確執行(dumpbin /EXPORTS C:\Windows\system32\kernel32.dll > tempfile.txt
)?
您可能想詳細說明它是如何工作的。你是否收到任何錯誤消息或任何東西? –
你有沒有試過''C:\\ Program Files \\ Microsoft Visual Studio 8 \\ VC \\ bin \\ dumpbin.exe''? – rumpel
@rumpel yup,也沒有工作。 –