How to call batch files via Python

by Süleyman Petek 10. Mart 2016 17:26
Gentle reminder for me and anyone who needs in the future, say that you have lots of .bat files and

Gentle reminder for me and anyone who needs in the future, say that you have lots of .bat files and you need to call them all.

You can do it via Python like below :


import glob  

import os 

os.chdir('c:\YourBatFiles')  

for filename in glob.iglob('*.bat', recursive=True): 

print(filename)

os.system(filename)


Tags:

Tech | Tip

Add comment

Calendar

<<  Temmuz 2018  >>
PztSalÇarPerCumCmtPaz
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345

View posts in large calendar

RecentPosts