1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Batch file request

Discussion in 'Windows XP' started by VIP_EJC, Jan 5, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. VIP_EJC

    VIP_EJC Thread Starter

    Joined:
    Aug 21, 2007
    Messages:
    158
    I need a batch file that will convert the name of a parent folder and all subfolders and files from lowercase to uppercase.

    Example

    Parent folder = PARENT FOLDER
    File = FILE1.FEX
    Subfolder = SUBFOLDER
    File = FILE2.FEX

    Does anybody know the syntax to create it?
     
  2. Ent

    Ent Trusted Advisor

    Joined:
    Apr 11, 2009
    Messages:
    5,467
    First Name:
    Josiah
    Do you specifically need this to be a batch file? I suspect I could do this for you in visual basic script but batch doesn't do string manipulation very well at all.
     
  3. stantley

    stantley

    Joined:
    May 22, 2005
    Messages:
    7,091
    I don't know if it's possible with a batch file, but it's pretty simple with a mass renaming program.

    There are many of them out there, the one I prefer is Rename Master.
     
  4. VIP_EJC

    VIP_EJC Thread Starter

    Joined:
    Aug 21, 2007
    Messages:
    158
    Yes, it must be a batch file for Windows XP. The closest batch file I could find is this, but it's for lowercase. Go figure. Can anybody edit it to uppercase?

    To rename all the files names in a directory, use:

    [call] LwrCase_Folder FullyQualifiedDirectoryName [/S]
    where FullyQualifiedDirectoryName is the fully qualify folder path, and /S is an optional parameter that will also rename files names in all sub-folders.

    @echo off
    if {%1}=={} @echo Syntax: LwrCase_Folder FullyQualifiedDirectoryName&goto :EOF
    if not exist %1 @echo LwrCase_Folder - %1 NOT found.&goto :EOF
    setlocal
    for /f "Tokens=*" %%a in ('@echo %~a1') do (
    set folder=%%a
    )
    if /i "%folder:~0,1%" NEQ "d" @echo LwrCase_Folder - %1 is NOT a folder.&endlocal&goto :EOF
    pushd %1
    set sw=/B /A /A-D
    if /i {%2}=={/S} set sw=%sw% %2
    for /f "Tokens=*" %%f in ('dir %sw%') do (
    call LwrCase "%%f"
    )
    popd
    endlocal
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Batch file request
  1. Robertico22
    Replies:
    8
    Views:
    645
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/972856

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice