Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Subject: bat: Rename files w/double ext?

Original Message
Name: akadewboy
Date: April 29, 2008 at 19:42:47 Pacific
Subject: bat: Rename files w/double ext?
OS: Vista SP1
CPU/Ram: na
Model/Manufacturer: dell
Comment:
I have a bunch of files with names like:
tex_browser.gim.png
tex_camera.gim.png
tex_cnf_date.gim.png
...

Basically what I need to do is remove the ".gim" in the middle of them with by running a *.bat file. So they'll end up being named:

tex_browser.png
tex_camera.png
tex_cnf_date.png
...

Any batch file experts out there that can help me?


Report Offensive Message For Removal

Response Number 1
Name: Retrotechtive
Date: April 29, 2008 at 21:11:46 Pacific
Subject: bat: Rename files w/double ext?
Reply: (edit)
These guys are pro's. I think they covered this one in this thread. See if that helps ya! batch-rename-files-consecutive-n


Good Luck!


Report Offensive Follow Up For Removal

Response Number 2
Name: ghostdog
Date: April 29, 2008 at 21:34:06 Pacific
Subject: bat: Rename files w/double ext?
Reply: (edit)
vbscript. Save as script.vbs and on command line,
c:\test> cscript /nologo script.vbs



Set objFS = CreateObject("Scripting.FileSystemObject")
strMyFolder = "C:\test"
For Each Files In objFS.GetFolder(strMyFolder).Files
If InStr(objFS.GetFileName(Files),".gim.") > 0 Then
strNewFile = Replace(objFS.GetFileName(Files),".gim.",".")
Files.Name = strNewFile
End If
Next


Report Offensive Follow Up For Removal

Response Number 3
Name: Razor2.3
Date: April 29, 2008 at 22:52:04 Pacific
Subject: bat: Rename files w/double ext?
Reply: (edit)
I've got nothing to do, so here's a one line Command Script.
@for %%a in (*.*) do @for %%b in ("%%~Na") do @ren "%%a" "%%~Nb%%~Xa"


Report Offensive Follow Up For Removal

Response Number 4
Name: akadewboy
Date: April 30, 2008 at 14:40:08 Pacific
Subject: bat: Rename files w/double ext?
Reply: (edit)
That worked perfect, thanks Razor!

Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: bat: Rename files w/double ext?

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software



Version Tracker Pro
Keep your software current and secure, effortlessly

Click Here for a Free Scan

Driver Agent
Automatically find the latest drivers for your computer.
Click Here for a Free Scan



The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC