Computing.Net > Forums > Programming > removing first chars from filename

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.

removing first chars from filename

Reply to Message Icon

Name: Heedle Blambeedle
Date: April 15, 2009 at 13:06:01 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

I need a batch program to remove the first 11 characters from 500 filenames. like something i could run in the folder that would remove the first 11 characters from all of them. All the files are named runescape-trackname. any help?



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: April 15, 2009 at 13:37:30 Pacific
Reply:

Warning: Before a massive renaming try the script as the code is not tested.

:: MYREN.BAT  Usage: myren Folder_Name
@echo off & setlocal EnableDelayedExpansion
pushd %*
for %%j in (*) do (
  set FileName=%%j
  set FileName=!FileName:~11!
  ren "%%j" "!FileName!"
)
popd
:: End_Of_Batch


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 Programming Forum Home


Sponsored links

Ads by Google


Results for: removing first chars from filename

filename character removal batch www.computing.net/answers/programming/filename-character-removal-batch/17426.html

Read-in single char from stdin in C www.computing.net/answers/programming/readin-single-char-from-stdin-in-c/8569.html

Removing Numbers from Filename www.computing.net/answers/programming/removing-numbers-from-filename/20132.html