ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Ok, first off I am in windows, and have to use Bat files. There is no other way around this so please don't offer this "help".
I need to echo some java code into the end of a html file, but when I run the .bat file it exits before completion. I guess this is because it is trying to execute the code, not just echo it.
The only way I have found for the file to run is to put ""s around the code, this is obviously useless as it is then not parsed when the html file is loaded.
Another idea was to put the code in a txt file then echo the content of that file, which I cannot get to work as it just places "code.txt" not its contents.
Please bear in mind that it took me 10 mins of googling to find that >> appends... KISS pls!
This is what I have so far, it works but then the html doesn't...
Code:
echo "lots of java stuff here" >> htmlfile.htm
pause (to see if it worked :D)
Please remember: just because you're in Windows, it doesn't necessarily mean that you *have* to use .bat files. Alternatives you might be able to consider include:
3. Since it sounds like you're already on a web server (a Microsoft/IIS web server), perhaps your best best is to forget about doing it "from Windows" and instead consider "doing it from IIS".
4. Finally, if you decide you *must* use .bat files, everything you need to know (everything there *IS* to know!) about .bat file syntax can easily be learned in about 15 minutes: http://www.computerhope.com/batch.htm
the basics are that we need to add on some code to a html file to make it display properly in the site, but the html file is produced using excel weekly (or more often) and the person doing this is not keen on the idea of having to open the file in, say, notepad, then adding in the code.
My programming knowledge isn't that great and time is limited. We need it to be as simple as possible. To be able to just click on a bat, or anything for that matter, that will "just do it" is what we need. I shall have a look at those other options, but we can't be installing stuff and CMD is blocked by the admin, so anything needing this has to be in a bat as far as I know...
NOTE:
An "Excel macro" is written in VBScript, a dialect that includes most/all of MS-Access, MS Word, ASP 3.0 (for web servers), WSH (for the Windows command line), etc etc. So any Wisdom you gain in solving this problem on Excel is directly applicable to anything you might wish to do on these other environments.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.