Closed Thread
Results 1 to 4 of 4

Thread: Batch file to open multiple text files at once using Notepad

  1. #1
    terrylau is offline Newbie
    Join Date
    Jul 2009
    Posts
    6
    Rep Power
    0

    Batch file to open multiple text files at once using Notepad

    I want to open multiple text files in a folder using Notepad, all at the same time. Using command line window

    Start ->Run -> Cmd
    cd C:\Test
    for %X in (*.txt) do notepad %X

    will enable all the files open on top of one another.


    I want to create a batch file to automate this process but by doing :

    cmd
    for %%X in ("C:\Test\"*.txt) do notepad %%X

    will only open the first file File1.txt. After closing File1.txt, then only the second file File2.txt will open and so on.

    Is there a way for me to automate this process using batch file or any other programming language that'll be more suitable e.g. VB, Perl, C/C++, etc.

    Need your input and suggestions as still new to programming. Thanks.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,525
    Blog Entries
    75
    Rep Power
    144

    Re: Batch file to open multiple text files at once using Notepad

    Based on this discussion: Hello!! Making a Simple Batch File... [Archive] - [H]ard|Forum it looks like you need:
    Code:
    cmd
    for %%X in ("C:\Test\"*.txt) do start notepad %%X
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    ikonia is offline Newbie
    Join Date
    May 2009
    Posts
    24
    Rep Power
    0

    Re: Batch file to open multiple text files at once using Notepad

    do you not have to close a for loop in windows ?

  5. #4
    tossy's Avatar
    tossy is offline Programmer
    Join Date
    Aug 2008
    Posts
    199
    Rep Power
    14

    Re: Batch file to open multiple text files at once using Notepad

    As I know in windows it happens automatically ...we don't need to close.
    Microsoft: "You've got questions. We've got dancing paperclips

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Batch file to change text in a txt file?
    By Scarness in forum General Programming
    Replies: 3
    Last Post: 05-22-2011, 06:28 AM
  2. Batch File - Deleting Log Files
    By Swatcat in forum General Programming
    Replies: 4
    Last Post: 03-16-2011, 03:55 PM
  3. Open File text into Textbox
    By Psynic in forum C# Programming
    Replies: 6
    Last Post: 02-12-2010, 12:19 AM
  4. Notepad Open File Help.
    By Fairy Fighter in forum Visual Basic Programming
    Replies: 2
    Last Post: 10-03-2009, 04:16 AM
  5. Writing to text file with batch?
    By Flaringo in forum General Programming
    Replies: 3
    Last Post: 06-04-2009, 08:21 PM

Tags for this Thread

Bookmarks

Posting Permissions

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