creating and writing a notepad file with a batch file.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: creating and writing a notepad file with a batch file.

  1. #1
    Join Date
    Jan 2005
    Posts
    3

    creating and writing a notepad file with a batch file.

    basically I want to know how to make a directory, write a notepad file and save it as a java file, compile it and run it all in one batch file.

    This is the best I could come up with:

    mkdir c:\csc201
    cd\c:\csc201
    c:\winnt\notepad.exe HelloWorld.java

    public class HelloWorld
    {
    public static void main(String[] args)
    {
    System.out.println("HelloWorld!");
    }
    }

    javac HelloWorld.java
    java HelloWorld

    I looked all over the place but, cannot find any answers.

  2. #2
    Join Date
    Aug 2004
    Posts
    4
    You didnt exit the notepad. lol.

    Well, the truth is that this cannot be done. I mean, the batch file cannot write in the notepad. Plus, its gotto perform other functions also like exiting, saving which are again not possible.

    Hard luck...
    -----------------------------------------------------------
    http://www.thejavahub.com
    Find great java apps. Get your java apps rated - http://www.thejavahub.com

  3. #3
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    Thats what I figured too, but for a while I was searching
    for batch file utilities like the ones we had back in the
    jurassic times, as exec & rexx on the ibm mainframes.
    These process control languages had a neat feature
    where you could stack commands first, then issue
    a command like run-that-executable, and the executable
    would pop the stacked commands and use them like
    you where actually running the executable interactively.

    Btw, I think they have something similar in the unix
    environment.
    eschew obfuscation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center