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

  • Home
  • SEARCH
  • 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 8548955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:37:00+00:00 2026-06-11T13:37:00+00:00

Utilizing the knowledge of these forums, I compiled a useful batch script. Del –

  • 0

Utilizing the knowledge of these forums, I compiled a useful batch script.

Del "- Output.tx_"
Del "- Output.txt"

FOR %%I in (*.txt) do @echo Filename: %%~nxI >>"- Output.tx_" & echo. >>"- Output.tx_" & echo. >>"- Output.tx_" & FOR %%f in (%%I) do type %%I >>"- Output.tx_" & echo. >>"- Output.tx_" & echo. >>"- Output.tx_"

TYPE "- Output.tx_" | MORE /E /P /S > "- Output.txt"
Del "- Output.tx_"

My home computer has XP (SP3, 32-bit), and the script combines the text files perfectly as shown below.

Filename: Test1.txt  

[Text file 1 contents]

Filename: Test2.txt  

[Text file 2 contents] 

... and so on. 

However, I had run this script as a test on my computer at work a few months ago and ran into problems. The computer at work has Windows 7 (32-bit, SP1) and combined only the text files’ titles into the output file. This resulted in the following:

Filename: Test1.txt  

Filename: Test2.txt     

... and so on. 

Any comments or feedback in getting the script to work properly on Windows 7 would be greatly appreciated.

Thanks,

DWIC

  • 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-11T13:37:01+00:00Added an answer on June 11, 2026 at 1:37 pm

    The only thing I can think of is that some (or all) of your text files on your Win7 computer have spaces or special characters in there names, such that TYPE is not able to find them. There should be an error message if this happens, but it is not in your output file because you haven’t redirected stderr.

    The problem can be solved by quoting the variable.

    Your code is more complicated than it needs to be. Here is a simplified version that does the same thing, except the quoting problem has been fixed. I also redirected stderr.

    @echo off
    2>nul del "- Output.txt"
    (
      for %%F in (*.txt) do @(
        echo Filename: %%F
        echo.
        echo.
        type "%%F"
        echo.
        echo.
      )
    ) | more /s /p >"- Output.tx_" 2>&1
    move "- Output.tx_" "- Output.txt" >nul
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was recently looking to practice utilizing dictionaries in python and stumbled across these
In the following script utilizing jQuery and slickGrid, I keep getting an error saying
Is there any way (utilizing Reflection I hope) that I can make an instantiated
I am utilizing the javax.scripting with Rhino in this project. I have a Java
I'm am utilizing a formset to enable users subscribe to multiple feeds. I require
I'm utilizing the code posted by Jesper Palm here: Make user control display outside
I maintain a test suite utilizing Selenium and Capybara. While I can convince Selenium
The debug build of some code utilizing SFHFKeychainUtils that is working without complaint on
Given a large legacy project utilizing ASP.NET, javascript, css, etc, technologies, I was wondering
I'm building a winforms app utilizing passive-view MVP and Castle Windsor as an IoC

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.