+ Reply to Thread
Results 1 to 4 of 4

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

  1. #1
    Newbie terrylau is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    5

    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. #2
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,635
    Blog Entries
    57

    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
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  3. #3
    Newbie ikonia is an unknown quantity at this point
    Join Date
    May 2009
    Posts
    24

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

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

  4. #4
    Programmer tossy is on a distinguished road tossy's Avatar
    Join Date
    Aug 2008
    Posts
    122

    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
    Test Management

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Project: ionFiles - Joomla Simple File Download
    By Jordan in forum Community Projects
    Replies: 369
    Last Post: 01-30-2010, 01:10 PM
  2. Some Basic Linux Commands, For Beginners...
    By Onur in forum Linux Tutorials, Guides and Tips
    Replies: 5
    Last Post: 10-12-2009, 02:07 AM
  3. Backup current text in textbox after x amount of time
    By Grue in forum Visual Basic Programming
    Replies: 4
    Last Post: 06-11-2009, 11:29 AM
  4. Visual Studio 2008: C# Reading Files
    By Jordan in forum CSharp Tutorials
    Replies: 8
    Last Post: 06-20-2008, 10:54 AM
  5. Windows Shortcut List - Saves Time
    By 2stamlers in forum The Lounge
    Replies: 6
    Last Post: 04-10-2008, 06:58 AM

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