I need to create a .bat file that might be very easy but I am having a real hard time trying to figure out how to do it.
I need a batch that gets all the files *.ui in the current folder, and executes a program passing two arguments to it: that *.ui file name, and the same file name with this two modifications
- Added ../ in front so the referenced file is in the parent folder
- Replaced file extension from *.ui to *.py
In pseudo:
for every file *.ui in this folder as file:
file2 = "../" + replace( file, ".ui", ".py")
execute python.exe file -o file2
This is the final .bat, but the replacing extensions part is missing:
FOR %i IN (*.ui) DO python -m PyQt4.uic.pyuic %i -o (????)
I have tried the batch replacing (????) with the file name manually and it works. But how can I add ../ and replace .ui to .py?
Thank you!