on 06-10-2017 9:40 AM
Hi Experts,
I have fail name "Murali06062017" . I need to rename file like "Ready_Murali06062017" in bods using rename DOS commands.
I have multiple files in a path.
1. Murali06062017
2. Krishna06062017 in D:\Temp folder
I need to rename files in same path D:\Temp Folder
1. Ready_Murali06062017
2. Ready_Krishna06062017
For this I tried this way. But it was not worked
exe('cmd','rename D:\Temp\*.txt Ready_*.txt')
Please get me help on this. I google it but could not able to find proper solution.
Thanks and Regards,
Murali
Hello!
I have something similar developed. I hope it be usefull, and sorry for my English.
Let me Know if it helps you.!!!!!!!!!!!!!!!!!!
I used a .bat and then I execute from BODS. Like this:
The bat move and rename a file depend on the variables send it trhough BODS. I control the rename if the file was success or failed, so I sent the prefix.
and then in BODS, Look like:
A variable has the control, if variable = 0 that error. I move the file to a carpet called Error.
If variable <> 0 that success. I move the file to a carpet called Exito (success). Both case I rename the name of the file.
I leave the code
@echo off
rem echo Probando
rem set ruta1=E:\CargasDs\
rem set ruta2=E:\CargasDs\Exito\
rem set archivo=Libro1.xlsx
set ruta1=%1
set ruta2=%2
set archivo=%3
set renombre=%4
rem move C:\carpeta1\DSConfig.txt C:\carpeta2
rem move C:\carpeta1\DSConfig.txt %ruta2%
echo %ruta1%%archivo% %ruta2%
move %ruta1%%archivo% %ruta2%
ren %ruta2%%archivo% %renombre%%archivo%
rem pause
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.