Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows VistaWindows XPWindows MeWindows 98Windows 95Virtual PCInternet ExplorerOutlook ExpressWindows MediaSecurity
Related Topics
MS Server ProductsMS OfficePC HardwareMore Topics ...

Windows Forum / Windows 98 / General Topics / October 2007

Tip: Looking for answers? Try searching our database.

Rename *.ITF with filename of TXT file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
brettmanning24@gmail.com - 31 Oct 2007 18:16 GMT
Hello,

Is it possible to use the rename command to rename a *.ITF file with
the filename of a TXT file in the same directory.  For example
Directory 1 contains:

DEAL1.ITF
BRETT.TXT
DEAL1.LOG

Is it possible to rename DEAL1.LOG to BRETT.LOG (the same name of the
TXT file).  The TXT file will be a different name each time, therefore
it needs to be some kind of variable rename i.e. always rename
the .LOG file to that of the .TXT filename.

Thanks,

Brett
Franc Zabkar - 31 Oct 2007 21:12 GMT
>Hello,
>
[quoted text clipped - 14 lines]
>
>Brett

Cut and paste the following commands into a .bat file, eg renamer.bat.
Then execute it.

=====================================
md dummydir
copy *.txt dummydir
cd dummydir
ren *.txt *.
for %%i in (*) do set txt_name=%%i
del %txt_name%
cd ..
copy *.log dummydir
cd dummydir
ren *.log *.
for %%i in (*) do set log_name=%%i
del %log_name%
cd ..
ren %log_name%.log %txt_name%.log
ren %log_name%.itf %txt_name%.itf
set log_name=
set txt_name=
rd dummydir
=====================================

- Franc Zabkar
Signature

Please remove one 'i' from my address when replying by email.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.