Opening .bat file from Dynamo

Hello,

I’m trying to access a batch file (.BAT)from dynamo, I was looking for a node to give it batch file path as input then when clicking run the bat file will launch, but I find no answer

I’ve tried with Python, but i couldn’t as there is no os modules to open the file, i’m still beginner in Python :worried:

even I’ve tried to use “Read from excel file” and I’ve specified xlsm file with VBA code to launch it when open, but dynamo reading from excel without opening it even ;(

Please advise

Could you postwhat you have done so far?

05

attached is what I’ve tried with Python, but for other trials there is almost nothing to show, it’s a research more than results

for excel vba I’ve used the simple Shell(“filename”) in workbook open procedure

Here:

Just change the extension to .bat from .py and remove all arguments. Probably your batch file doesn’t use them.

import clr
import sys
sys.path.append(r'C:\Program Files (x86)\IronPython 2.7\Lib')
import os
os.system('z:\batchcommand.bat')

Perfect, Thank you for the kind help, I’ve used the below code to do it

import clr
import sys
sys.path.append(r’C:\Program Files (x86)\IronPython 2.7\Lib’)
import os
filename = IN[0]
os.system(filename)