Windows Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsWindows Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 2nd, 2009, 04:58 AM
terrylau terrylau is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 6 terrylau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 9 sec
Reputation Power: 0
Batch file to open multiple text files simultaneously using Notepad

Not sure whether it's relevant here or not but here goes:

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.

Reply With Quote
  #2  
Old July 2nd, 2009, 09:39 AM
AdamPI's Avatar
AdamPI AdamPI is offline
Automagically Delicious
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2004
Location: 127.0.0.2 - I live next door.
Posts: 1,430 AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level)AdamPI User rank is General 7th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Weeks 1 Day 6 h 30 m 47 sec
Reputation Power: 1471
It's been a long while, but I believe in most Linux distros if you add a '&' or a '%' after the command it won't wait for a termination signal before proceeding. Try that.
__________________
Adam TT

Reply With Quote
  #3  
Old July 2nd, 2009, 09:51 AM
ctardi ctardi is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Dec 2006
Location: Midnight Train Going Anywhere
Posts: 1,065 ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)ctardi User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 42575 Folding Title: Beginner FolderFolding Points: 42575 Folding Title: Beginner FolderFolding Points: 42575 Folding Title: Beginner Folder
Time spent in forums: 2 Weeks 2 Days 19 h 11 m 14 sec
Reputation Power: 1280
Send a message via MSN to ctardi Send a message via Skype to ctardi
Facebook
Quote:
Originally Posted by AdamPI
It's been a long while, but I believe in most Linux distros if you add a '&' or a '%' after the command it won't wait for a termination signal before proceeding. Try that.


I've attempted to find a way to run a background process in system exec several times with no luck...

Reply With Quote
  #4  
Old July 2nd, 2009, 11:07 AM
salem's Avatar
salem salem is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jun 2005
Posts: 2,139 salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)salem User rank is Lieutenant General (80000 - 90000 Reputation Level)  Folding Points: 153 Folding Title: Novice Folder
Time spent in forums: 1 Month 2 Weeks 1 Day 23 h 22 m 21 sec
Reputation Power: 861
> 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.

Try
for %%X in ("C:\Test\"*.txt) do start /wait notepad %%X
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsWindows Help > Batch file to open multiple text files simultaneously using Notepad


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
Stay green...Green IT