Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Make a .txt file form .bat  (Read 2906 times)

0 Members and 1 Guest are viewing this topic.

Carbon Dudeoxide

    Topic Starter
  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Make a .txt file form .bat
« on: February 18, 2007, 07:41:54 AM »
Hey everyone, i need help with something.
I made this batch thing with a list of commands like 'type 1 to do watever'
I was wondering if there is any way to make a .txt file with text in it, for example:
'type 5 to save the readme for this file on the desktop'.

Thanks in advance.

GX1_Man

  • Guest
Re: Make a .txt file form .bat
« Reply #1 on: February 18, 2007, 11:49:36 AM »
Why not just print out the batch file?

Dilbert

  • Moderator


  • Egghead

  • Welcome to ComputerHope!
  • Thanked: 44
    Re: Make a .txt file form .bat
    « Reply #2 on: February 18, 2007, 07:41:47 PM »
    Have it echo the readme, but add ">> %userprofile%\Desktop" to the end (assuming you use XP). Like this:

    ECHO Readme >> %userprofile%\Desktop
    ECHO.
    ECHO This file is designed to >> %userprofile%\Desktop

    etc...
    "The geek shall inherit the Earth."

    Carbon Dudeoxide

      Topic Starter
    • Global Moderator

    • Mastermind
    • Thanked: 169
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Experience: Guru
    • OS: Mac OS
    Re: Make a .txt file form .bat
    « Reply #3 on: February 19, 2007, 01:01:57 AM »
    How do you print something through a .bat file?

    « Last Edit: August 26, 2009, 04:43:32 AM by Carbon Dudeoxide »

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: Make a .txt file form .bat
    « Reply #4 on: February 19, 2007, 04:13:21 AM »
    Either use the print or the type or the echo command depending where you want the output and where the input is.

    Use the help switch /? with either command for more details. With type and echo you can redirect the output to the device of your choice.

     8-)
    « Last Edit: February 19, 2007, 04:15:03 AM by Sidewinder »
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein