Computing.Net > Forums > Disk Operating System > Batch Files to change file names

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch Files to change file names

Reply to Message Icon

Name: Grant Cochrane
Date: October 12, 2001 at 04:06:53 Pacific
Comment:

Hi folks,

my problem is I am trying to rename a whole load of files to be prefixed t_" with the following .bat file.

ren *.jpg t_*.jpg

however it isn't inserting the text "t_" it is replacing the first two characters of the file name.

any help gr8fully received

cheers




Sponsored Link
Ads by Google

Response Number 1
Name: astroraptor
Date: October 12, 2001 at 04:25:57 Pacific
Reply:

Try this, I'm assuming this is what you want it to do.

@ECHO OFF
IF "%1"=="" GOTO ERROR

:START
REN %1 T_%1
GOTO DONE

:ERROR
ECHO.Usage: TEST filename.ext
ECHo.
GOTO END

:DONE
ECHO.Done
ECHO.

:END


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch Files to change file names

batch file to rename a file www.computing.net/answers/dos/batch-file-to-rename-a-file/8524.html

DOS Batch File containing command to capture drive name www.computing.net/answers/dos/dos-batch-file-containing-command-to-capture-drive-name/138.html

batch file to get subset of dir? www.computing.net/answers/dos/batch-file-to-get-subset-of-dir/15350.html