Username:
Password:
Remember me:
Register

Back to forum: Programming (Python, Java, Delphi/Pascal, C, VB, etc)


Search forums via Google


0 Users appreciate this thread.

[WIN BATCH] Batch files creates a .log file
Started by Blade
(2014-06-20 18:43:39)
Blade (2014-06-20 18:43:39)
Well, I have figured out how to make this using some code I found on Stack Overflow ([url=http://stackoverflow.com/questions/132799/how-can-you-echo-a-newline-in-batch-files]Link here[/url]) and this is what I made (Replace the underlined text with what you want and the italic isn't necessary)

@echo off
:: This is made by Blade on 3dsplaza
:: The new line code is found here: http://stackoverflow.com/questions/132799/how-can-you-echo-a-newline-in-batch-files
:: THE TWO LINES IN BETWEEN ARE NECESSARY

set NLM=^


set NL=^^^%NLM%%NLM%^%NLM%%NLM%


echo Logging...


time>time.txt
set time=<time.txt

:: THE SPACE BEFORE THE %NL% IS NECESSARY[br]

time>time.txt
set time=<time.txt
echo [%time%]Some Text %NL%>"text here.log"
:: JUST REPEAT THIS NEXT PART

time>time.txt
set time=<time.txt
echo [%time%]Some Text %NL%>>"text here.log"

echo Logged!
pause
del pause.txt
del time.txt


This post has been edited one or more times, the last time was:
2014-06-21 01:59:16

Blade "Heil Hydra." He shoots Larcio in the face.
CoolApps (2014-06-21 14:11:21)
This is scripting, not programming.
Newer account: NodePoint
Blade (2014-06-23 23:57:48)
Batch files are called batch SCRIPTS
Blade "Heil Hydra." He shoots Larcio in the face.
CoolApps (2014-06-24 21:51:11)
Exactly, and therefore is a script, not an actual programming language.
Newer account: NodePoint
Blade (2014-06-29 15:55:14)
Ahh, but you have just created a paradox. "This is scripting, not programming." and now, "Exactly, and therefore is a script, not an actual programming language."
Blade "Heil Hydra." He shoots Larcio in the face.
TheAlexRider (2014-08-29 21:06:06)
Plagurism. Sure its fine but the ::This was madde by Blade on 3dsplaza


Edit request
 

Log in to submit a comment

This topic's ID: 71617

Back to forum: Programming (Python, Java, Delphi/Pascal, C, VB, etc)




Total registered users: 8321
New registered users today: 7
Newest registered user: ElegantVulpes

©  Copyright 2026 3DSPlaza. All Rights Reserved