Page 1 of 1

User cannot install BRU so need help with BRC

PostPosted: Fri Sep 10, 2010 10:56 am
by nimdy
I need someone to rename picture files for me for uploading to our corporate document management system. BRU does exactly what I need, but the user cannot install utilities on their PC but can run command line utilities.

What I would like to do is the following:

There is a folder on the C:\ drive called Photos. Within this is are user added folders for dates, e.g. 10-09-2010.

Photos come from a data capture device, so have names like - "002RS100608100954.bmp". To make sense of it on the DMS we need a prefix, which in our case is "F999 - 9.7.6 - DCD Photos - " followed by the date of the folder they are in. So a file will look like this - "F999 - 9.7.6 - DCD Photos - 10-09-2010 - 002RS100608100954.bmp".

I want to make it easy for the user (they are not based in my office, so I cannot assist them easily. I would like them to be able to create a new folder within C:\Photos with a date, drop some photos into this folder then run a shortcut (batch file shortcut with a pretty icon) that does the renaming - without needing to navigate to C:\Photos\10-09-2010\ to execute the command.

Any ideas how I go about doing this?

Re: User cannot install BRU so need help with BRC

PostPosted: Fri Sep 10, 2010 3:11 pm
by Stefan
You could put an batch.cmd and the BRC32.exe into the "C:\Photos\" folder

The batch looks like
Code: Select all
@ECHO OFF
CD %1
..\brc32.exe  rename all files to "F999 - 9.7.6 - DCD Photos - %1 - 002RS100608100954.bmp"

but as far as i remember does BRC not expand such vars.


But before i test this with BRC you can try this batch
which works without any third-party tool like BRC:
Code: Select all
@ECHO OFF
SET FOLDER=%~n1

%~d1
CD %1

ECHO We working at path
CD
ECHO.
ECHO.
ECHO Press Ctrl+C if this path is wrong.
ECHO Press ENTER to continue.
PAUSE >NUL

for /f %%F in ('dir /b *.bmp') do ren "%%F" "F999 - 9.7.6 - DCD Photos - %FOLDER% - %%F"

ECHO Done!
PAUSE

Put this batch into your C:\Photos\ -folder
and the people can drag&drop an "10-09-2010" -folder onto the batch.
The batch will then rename the names as you had described.

TEST THIS WITH SOME TEST FILES FIRST!!!
Copy a few "10-09-2010" -folders to C:\Temp and test it there. At best on an test-pc or in an virtual-pc.
Batch files can go wrong sometimes and i have not tested this on your pc..



nimdy wrote:I need someone to rename picture files for me for uploading to our corporate document management system.
BRU does exactly what I need, but the user cannot install utilities on their PC but can run command line utilities.

What I would like to do is the following:

There is a folder on the C:\ drive called Photos. Within this is are user added folders for dates, e.g. 10-09-2010.

Photos come from a data capture device, so have names like - "002RS100608100954.bmp".
To make sense of it on the DMS we need a prefix, which in our case is "F999 - 9.7.6 - DCD Photos - " followed by the date of the folder they are in.
So a file will look like this - "F999 - 9.7.6 - DCD Photos - 10-09-2010 - 002RS100608100954.bmp".

I want to make it easy for the user (they are not based in my office, so I cannot assist them easily.
I would like them to be able to create a new folder within C:\Photos with a date, drop some photos into this folder
then run a shortcut (batch file shortcut with a pretty icon) that does the renaming
- without needing to navigate to C:\Photos\10-09-2010\ to execute the command.

Any ideas how I go about doing this?

Re: User cannot install BRU so need help with BRC

PostPosted: Mon Sep 13, 2010 3:04 pm
by nimdy
I had no idea windows rename would be enough to do this. I'm not sure its working quite how I want it to. It will not work when I put the batch file into the C:\photos folder, but will when I put the batch in c:\photos\10-09-2010 - but it doesnt copy the date in.

Would it be possible for the batch script to ask the user for a date and pass this through to the rename command - that way I can negate having to put folders into c:\photos.

[edit]
Sorry I see what you mean about dropping the folder onto the batch. That works perfectly. Thanks! :D

Re: User cannot install BRU so need help with BRC

PostPosted: Mon Sep 13, 2010 4:07 pm
by Stefan
nimdy wrote:[edit]
Sorry I see what you mean about dropping the folder onto the batch. That works perfectly. Thanks! :D
Great it works for you. Thanks for the feed back.

- - -

nimdy wrote:Would it be possible for the batch script to ask the user for a date and pass this through to the rename command

This is possible too.

Instead of:
Code: Select all
@ECHO OFF
SET FOLDER=%~n1

%~d1
CD %1

ECHO We working at path



try this:
Code: Select all
@ECHO OFF
SET /P FOLDER=Folder name to use:

ECHO Name to use is: %FOLDER%
ECHO We working at path
Note: start THIS batch INSIDE such "10-09-2010" -folders, since we didn't 'CD' here anymore.



_

Re: User cannot install BRU so need help with BRC

PostPosted: Mon Sep 13, 2010 4:36 pm
by nimdy
Thanks again Stefan. Both work great - i'm not sure which one to use now! :D

I dont suppose you could help me out with the next step of my problem. I need to convert these BMPs to JPGs (a 40kb JPG is better than a 1mb BMP!) Are you aware of any free windows command line utilities that can do this so I can add it to the end of this batch script?

Re: User cannot install BRU so need help with BRC

PostPosted: Mon Sep 13, 2010 7:46 pm
by Stefan
nimdy wrote:Thanks again Stefan. Both work great - i'm not sure which one to use now! :D

I dont suppose you could help me out with the next step of my problem. I need to convert these BMPs to JPGs (a 40kb JPG is better than a 1mb BMP!) Are you aware of any free windows command line utilities that can do this so I can add it to the end of this batch script?
Sure.
I didn't do this on my own,but you may take an look at

http://www.imagemagick.org/script/index.php
Here are just a few examples of what ImageMagick can do:
* Format conversion: convert an image from one format to another (e.g. PNG to JPEG).


I myself convert sometimes with IrfanView which can be used by command line too, see:

http://gd.tuwien.ac.at/graphics/irfantut/commopti.html
i_view32 c:\test.bmp /c=c:\giftest.gif

Convert file: 'c:\test.bmp' to 'c:\giftest.gif' without GUI :-)
(Note: supported are all IrfanView Read/Save formats



http://malektips.com/irfanview_3_0035.html
irfanview SOURCE_FILE /convert=DESTINATION_FILE
SOURCE_FILE: The path to the image you wish to convert
DESTTINATION_FILE: The path to the converted image. Choose one of the file formats supported by IrfanView.

For example, the following DOS command would convert image "football.jpg" to a PNG format with file "football.png":
irfanview football.jpg /convert=football.png

You may want to read the help or google for more infos.

Re: User cannot install BRU so need help with BRC

PostPosted: Tue Sep 14, 2010 4:24 pm
by nimdy
Thanks.

Neither options seem to suit my ideals. imagemagick needs to be installed, so wont run on my clients locked down systems, and as far as I can tell irfanview doesnt have a command/switch to convert all images in a folder, else this one would have been ideal.

Re: User cannot install BRU so need help with BRC

PostPosted: Tue Sep 14, 2010 6:30 pm
by Stefan
OK, once more.
nimdy wrote:.. and as far as I can tell irfanview doesnt have a command/switch to convert all images in a folder,
Didn't you have an help file with your IrfanView app?

Mine says:
Beispiel für Konvertierung:
i_view32.exe c:\test.bmp /convert=c:\giftest.GIF
Konvertiere Datei 'c:\test.bmp' nach 'c:\giftest.GIF' ohne GUI.

i_view32.exe c:\*.jpg /convert=d:\temp\*.gif
i_view32.exe c:\*.jpg /resize=(500,300) /convert=d:\temp\*.png
i_view32.exe /filelist=c:\mypics.txt /resize=(500,300) /aspectratio /resample /convert=d:\temp\*.png