Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2006
    Location
    Gtr London, England
    Posts
    256
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Write a batch file to create a .txt (Windows XP)

    Hi,

    Im new to writing batch files and am trying to find a way to create a new .txt. via a batch file. Ive found how to make a directory, i.e. mk dir, but I cant find anything on how a batch file would create a .txt .

    Any help would be much appreciated.

    Regards.
    Lee

  2. #2
    Plutonium Lounger
    Join Date
    Oct 2001
    Location
    Lexington, Kentucky, USA
    Posts
    12,107
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Write a batch file to create a .txt (Windows XP)

    It depends on what you want to do in the batch file that is going to "create" possible text for writing. Essentially you use the redirection symbol > to "send" something from a batch file to someplace else. If you want your text to be ADDED to a file that already exists, you use a double symbol >>

    Here's a most basic example, I hope: (double spacing only for ease of your reading.)
    <hr>@echo off

    c:

    cdtemp

    dir > d:tempsample.txt
    <hr>

  3. #3
    3 Star Lounger
    Join Date
    Aug 2006
    Location
    Gtr London, England
    Posts
    256
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Write a batch file to create a .txt (Windows XP)

    Hi,

    Thats perfect, just the job.

    Thanks very much for your help.

    Cheers.
    Lee

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •