Solved

Remove all file extensions from all files in subdirectories

Posted on 2003-11-18
2
257 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This is an explanation of a simple data model to help parse a JSON feed
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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 …
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now