Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7996631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:45:22+00:00 2026-06-04T14:45:22+00:00

I’m attached to a network drive with a ridiculously slow connection speed (15 kb/s

  • 0

I’m attached to a network drive with a ridiculously slow connection speed (15 kb/s on good days). I’m deleting most files but don’t want to break a few files that have include statements. These are files for an enterprise app (mainly written in ColdFusion). My idea is to prefix a ‘_’ to all file names as to test if the few files I want to keep get messed up. I already searched the code of files I want to keep for include statements, this is just to test before pushing live.

Is there a script I can run that would rename all files and folders but exclude 2 folders and the files in them? If there’s a better way I’m open to options.

So I’d normally delete all files I think aren’t needed, but since the network speed is terrible that would take a long time. Since this is testing if I make a mistake there could be a lot of deleting and undeleting, that’s why I want to just rename.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:45:23+00:00Added an answer on June 4, 2026 at 2:45 pm

    I suggest appending an extension of ._ instead of prefixing the name with _. That will make it easier to undo the rename.

    @echo off
    setlocal
    set root="X:\"
    set skip1="X:\folder1\"
    set skip2="X:\folder2\"
    for /r %root% %%F in (*) do (
      if /i "%%~dpF" neq %skip1% if /i "%%~dpF" neq %skip2% ren "%%F" "%%~nxF._"
    )
    

    To revert back to the original names:

    @echo off
    setlocal
    set root="X:\"
    for /r %root% %%F in (*._) do ren "%%F" "%%~nF"
    

    EDIT:
    The first script to rename the files can be made faster by renaming all files in a directory with a single REN command.

    @echo off
    setlocal
    set root="X:\"
    set skip1="X:\folder1\"
    set skip2="X:\folder2\"
    for /r %root% %%F in (.) do (
      if /i "%%~fF" neq %skip1% if /i "%%~fF" neq %skip2% ren "%%~F\*.*" *.*._
    )
    

    The second script to revert the names must continue to rename each file individually.

    I also added SETLOCAL to all scripts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I don't have much knowledge about the IPv6 protocol, so sorry if the question
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want to construct a data frame in an Rcpp function, but when I
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.