Solved

Remove all file extensions from all files in subdirectories

Posted on 2003-11-18
2
258 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
2 Comments
 
LVL 9

Accepted Solution

by:
bhagyesht earned 50 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

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.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

810 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