Solved

Remove all file extensions from all files in subdirectories

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This is about my first experience with programming Arduino.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

746 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

16 Experts available now in Live!

Get 1:1 Help Now