Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Mark Johnson
2008-02-25T19:12:28Z
I need the ability to rename a group of files at one time based on certain criteria using wildcard characters. I am currently handling this in a batch file and having VisualCron execute the batch.

The operation I am trying to perform is to rename all files in a certain directory that end in "*.dat" to a name with a datetime stamp ending in "*-datetimestamp.txt". I can already add the datetime stamp using VC variables, it's the bulk rename that can not currently be done.

Thanks
Mark Johnson
Sponsor
Forum information
Support
2008-02-25T19:18:49Z
We are awaiting more feedback from our users regarding this. We want to create this function as versatile as possible. Also, if you have any reference application that does this well then please post us a link. Thanks.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
vbaranov
2008-02-25T19:27:18Z
I agree with Mark, either Copy or Rename tasks have to be modified to accept a different file mask on the output.
Mark Johnson
2008-02-25T19:41:15Z
Here is how I am doing this rename today using a batch file and having VC execute the batch:

set MONTH=
set DAY=
set YEAR=
set HOUR=
set MIN=
set SEC=
set MIN=%time:~3,2%
set SEC=%time:~6,2%
set HOUR=%time:~0,2%
if "%HOUR:~0,1%"==" " set HOUR=0%time:~1,1%
set MONTH=%DATE:~4,2%
set DAY=%DATE:~7,2%
set YEAR=%DATE:~10,4%

rename D:\databackup\Inbound\*.000 *-BK-"%YEAR%%MONTH%%DAY%-%HOUR%%MIN%%SEC%".txt

Thanks
Mark
ErikC
2008-02-26T08:47:54Z
Can't you use all the date variables to run the batch file and use %1 %2 %3 etc? You don't have to use the SET in the batch file.

or

I didn't tested this, but you may use the Command task to run the cmd.exe with the argument /c rename D:\databackup\Inbound\*.000 *-BK-{DATEFORMAT(yyyy)}{DATEFORMAT(MM)}... etc..
Uses Visualcron since 2006.
wolframbuergel
2008-02-26T20:00:22Z
Hello,
I would like to use copy or rename like you can do with windows command prompt:
copy *.csv *.backup (this shoud create identical files with different extensions.
ErikC
2008-02-27T14:45:46Z
Hi wolframbuergel, you can use the execute command for this. Use the path to cmd.exe for the executable en use '/c copy *.csv *.backup' as the argument (without the quotes). This should work.

Uses Visualcron since 2006.
Support
2009-01-22T23:33:38Z
The latest beta 4.9.52. has a bulk rename Task.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top