#!/usr/bin/python3

import os
import subprocess
import glob

vbProcess = "C:/Program Files (x86)/VideoReDoTVSuite6/vp.vbs"
work_dir = "Z:/work_dir/incoming"
os.chdir(work_dir)

project_files = []
for file in glob.glob("*.vprj"):
    project_files.append(file)

for file in project_files:
    filename = file.replace('.vprj','.mp4')
    vbRun = f'cscript //nologo "{vbProcess}" "Z:\\work_dir\\incoming\\{file}" "Z:\\work_dir\\output\\{filename}" /q'
    print(f'executing {vbRun}')
    subprocess.run(vbRun)

exit(0)