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 8295735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:42:58+00:00 2026-06-08T14:42:58+00:00

I need a code that detects if there is two files with the same

  • 0

I need a code that detects if there is two files with the same extension and i need it to execute a different code.

  1. Detect if the folder is two *.txt files i need it to

  2. Echo there is two text files in this folder please remove one and continue

But if there is only one text file keep the code running

Im currently using this code to detect whether there isn’t any files in the folder

If not exist Files\*.txt echo there is no lyrics

Maybe if we could combine this as well something like

  if text file equal to 0 echo no lyrics

  if text file equal to 1 echo.

  if text file Gtr 1 ech there is more than on text file in the folder

The code will be used twice one for text file and the other for .ogg audio files

Thanks

  • 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-08T14:43:08+00:00Added an answer on June 8, 2026 at 2:43 pm

    DIR /B lists files, one per line, without header or footer info

    FIND /C counts the number of matching lines, /V "" matches any line

    FOR /F processes the results of a command

    for /f %%N in ('dir /b "Files\*.txt" ^| find /c /v ""') do (
      if %%N equ 0 echo No lyrics
      if %%N equ 1 echo(
      if %%N gtr 1 echo There is more than one text file in the folder
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need ActionScriot code that will parse a given folder and search it for
Is there a code snippet that can detect the current user's page and then
I am in need of a piece of code that can detect if a
I need a working Regex code in C# that detects plain text urls (http/https/ftp/ftps)
i need run code that will create a database and populate tables. i am
I need a php code and sql code that will let someone upload an
I have a code that need to be translated from C to Cpp, and
I need to write some code that would loop though all rows of a
I need to run some code that will fetch some configuration values from the
I have code that needs to loop and it will need to change the

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.