Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Remove all file extensions from all files in subdirectories

Posted on 2003-11-18
2
Medium Priority
?
264 Views
Last Modified: 2010-04-17
This is a carry one from - http://www.experts-exchange.com/Programming/Q_20801502.html - what I had not though about was I have many subdirectories under the main and each have some tif files that get added. What I would like to make the example given to me http://www.experts-exchange.com/Programming/Q_20801502.html here auto look in all the subdirectories as the names of them will change or be added to. So I just select the mail directory and it will go through it and all subdirectories and take the file extensions off. Any and all files under the main directory will be *.tif files.
0
Comment
Question by:Scan_25
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
bhagyesht earned 100 total points
ID: 9776490
change ur folder name
the following is a vbscript code
copy and paste it into a vbs file



set WshShell = WScript.CreateObject("WScript.Shell")
strStartup = "D:\Temp\rena"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(strStartup)
process(f)
renameFiles(f)

function process(objFolder)
      for each x in objFolder.subfolders
            renameFiles x
            process x
      next
end function


function renameFiles (objfolder)
      for each y in objfolder.files
            if right(y.name,4)=".tif" then
                  y.move left(y.path, len(y.path)-4)
'                  msgbox left(y.name,len(y.name)-4)
            end if
      next
end function
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question