I am writing this piece of code :
import os
os.system("start /wait cmd /c dir/s *.exe > Allexe1.txt")
What it is supposed to do is to get all exe files and write the result on to the file. But I get an empty file .
Note: I have tried the subprocess for the same and I always get the error Error[2] : file not found I am using Windows 7 , python2.7
Any help is appreciated .