Help-how to manipulate filenames in DOS

Microsoft Upg-vc msdos 6.22
November 16, 2009 at 15:27:17
Specs: Windows XP
Someone please help me how to change all the files in my directory from:

See More: Help-how to manipulate filenames in DOS

Report •

November 16, 2009 at 17:12:12
What difference is there between an underscore or period in a file name?

Home Page

Report •

November 16, 2009 at 17:42:11
Do not ignore the extension (.log) of the filename. If you do no program will be able to open it because there is nothing to associate a filename without an extension.


Report •

November 16, 2009 at 18:00:42
Forget about DOS. In XP, try this:

@echo off & setLocal EnableDELAYedExpansion

for /f "tokens=* delims= " %%a in ('dir/b/a-d test_*.log') do (
set s=%%~Na
set n=!s:~0,4!
set e=!s:~-2!
ren %%a !n!.!e!

Helping others achieve escape felicity


Report •

Related Solutions

November 16, 2009 at 19:53:31
If we really are talking about MS-DOS then the file extensions would be irrelevant as DOS took little notice of file extensions. The only ones that really mattered were .com and .exe. File extension were something that Microsoft introduced in the very early days with a view to future implementation but did very little. I t wasn't until Windows 95 came out that files extensions became important.

If we are really talking about Windows XP, then file extension do matter.

The underscore in a file name is part of the name, no different than abc. The period is the separator between the file name and the extension.


Report •

Ask Question