Computing.Net > Forums > Programming > Log Files

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Log Files

Reply to Message Icon

Original Message
Name: JayJay Programmer
Date: March 14, 2006 at 22:02:08 Pacific
Subject: Log Files
OS: Microsoft Windows XP Prof
CPU/Ram: 1.00GHz 320MB
Manufacturer/Model: Gateway
Comment:

what would I need to write in a script to make a log file after a batch file has been running.

I am clueless please help me someone.

Thank you in advance!

Building my Computer.
15 yr old Programmer.


Report Offensive Message For Removal


Response Number 1
Name: Mechanix2Go
Date: March 14, 2006 at 23:11:23 Pacific
Reply:

Depends in what you want in the log.


If at first you don't succeed, you're about average.

M2


Report Offensive Follow Up For Removal

Response Number 2
Name: JayJay Programmer
Date: March 14, 2006 at 23:23:27 Pacific
Reply:

Well I am making a batch that delete cookies and temp internet files

and I want a log of this after the batch is ran.

Building my Computer.
15 yr old Programmer.


Report Offensive Follow Up For Removal

Response Number 3
Name: JayJay Programmer
Date: March 15, 2006 at 01:52:47 Pacific
Reply:

Like how many Cookies where Deleted and how many Temp internet file where deleted.

Building my Computer.
15 yr old Programmer.


Report Offensive Follow Up For Removal

Response Number 4
Name: Mechanix2Go
Date: March 15, 2006 at 02:10:47 Pacific
Reply:

Hi JJ,

Post the bat.


If at first you don't succeed, you're about average.

M2


Report Offensive Follow Up For Removal

Response Number 5
Name: JayJay Programmer
Date: March 15, 2006 at 02:39:36 Pacific
Reply:

Ok I will have to do it tomorrow ok. I have the batch in my room I am on my dads and It is 4:39am in the morning. See you then

Building my Computer.
15 yr old Programmer.


Report Offensive Follow Up For Removal


Response Number 6
Name: JayJay Programmer
Date: March 15, 2006 at 10:58:49 Pacific
Reply:

@ECHO OFF

:MENU
Title Main Menu
COLOR C
CLS
ECHO =======================================
ECHO + +
ECHO + Please choose a menu option. +
ECHO + +
ECHO + 1.Run Cookie Monster. +
ECHO + 2.Veiw Readme. +
ECHO + 3.E-Mail Me. +
ECHO + 4.Visit my site. +
ECHO + 5.View Credits. +
ECHO + 6.Check for updates. +
ECHO + 7.Exit. +
ECHO + +
ECHO + +
ECHO =======================================

CHOICE.EXE /C:1234567 /N

IF ERRORLEVEL == 7 GOTO END
IF ERRORLEVEL == 6 GOTO CFUD
IF ERRORLEVEL == 5 GOTO CRED
IF ERRORLEVEL == 4 GOTO SITE
IF ERRORLEVEL == 3 GOTO MAIL
IF ERRORLEVEL == 2 GOTO READ
IF ERRORLEVEL == 1 GOTO SCM

:END
exit
goto :eof

:CFUD
CLS
Title Loading Updater...
COLOR A
ECHO Comming Soon
Title Done!
ECHO Comming Soon
ECHO Press any key to return to the main menu.
PAUSE>NUL
GOTO MENU
GOTO :EOF

:CRED
CLS
COLOR 9
Title Credits
ECHO Written by James Little
ECHO Dead On! - Founder James Little
ECHO Web-Mail: http:\\e-mailtx.tripod.com
ECHO E-Mail: comptech21.tripod.com
ECHO web-Site: http:\\computertech21.tripod.com
ECHO Press any key to return to the main menu.
PAUSE>NUL
GOTO MENU
GOTO :EOF

:SITE
CLS
COLOR D
Title Loading Computer Tech...
START http:\\computertech21.tripod.com
CLS
title Done Loading!
ECHO Press any key to return to the main menu.
PAUSE>NUL
GOTO MENU
GOTO :EOF

:MAIL
CLS
COLOR B
Title Loading Mail-Page...
START http:\\e-mailtx.tripod.com
Title Done Loading!
ECHO Press any key to return to the main menu.
PAUSE>NUL

:READ
CLS
COLOR E
Title Read Me.
ECHO Do not Modify, Hex, Copy, or Re-Sell unless aurthor says so.
ECHO If you Modify, Hex, Copy, or Re-sell I will hunt you down and make you eat lima beans
ECHO you don't want that now do you. So do not do it.
ECHO Press any key to return to the main menu.
PAUSE>NUL
GOTO MENU
GOTO :EOF

:SCM
cls
Title Cookie Monster Menu!
COLOR F
:SUB MENU
ECHO [][][][][][][][][][][][][][][][][][][][][][]
ECHO [] []
ECHO [] Please choose a menu option. []
ECHO [] []
ECHO [] 1.Delete Cookies. []
ECHO [] 2.Delete Internet Temp Files. []
ECHO [] 3.Exit to main menu. []
ECHO [] []
ECHO [][][][][][][][][][][][][][][][][][][][][][]

CHOICE.EXE /C:123 /N
IF ERRORLEVEL == 3 GOTO MENU
IF ERRORLEVLE == 2 GOTO DIT
IF ERRORLEVEL == 1 GOTO DC

:DIT
???
???
???
GOTO MENU
GOTO :EOF

:DC

CD C:\Documents and settings\?\cookies
del *.txt
ECHO Deleted all cookies
ECHO Press any key to return to the Cookie Monster Menu.
GOTO MENU
GOTO :EOF


I need for the batch file to put there username

CD C:\Documents and settings\?\cookies

where the ? is how do I do that

Building my Computer.
15 yr old Programmer.


Report Offensive Follow Up For Removal

Response Number 7
Name: Mechanix2Go
Date: March 15, 2006 at 23:14:42 Pacific
Reply:

[1] You can replace that ? with %username%

[2] Remember that for a LFN you need to enclose in quotes:

"C:\Documents and settings\%username%\cookies"

[3] You don't need to cd to del; you can simply:

del "C:\Documents and settings\%username%\cookies\*.txt"

[4] Better yet, you may want to:


del "C:\Documents and settings\%username%\cookies\cookies.txt"

[5] Since some browsers might get tripped up if the cookie file is gone, you might want to just mash it flat:

@echo off > "C:\Documents and settings\%username%\cookies\cookies.txt.txt"


More power, Mr. Scott!

M2Go



Report Offensive Follow Up For Removal

Response Number 8
Name: JayJay Programmer
Date: March 16, 2006 at 07:53:22 Pacific
Reply:

one more thing for some odd reason I cannot delete the temp files it just will not let me. I usually use command prompt before I write the command line but I do not know a command line that will delete the temps.

(I sill do not know about the log files if you could help me I would really enjoy it) Thanks again

Building my Computer.
15 yr old Programmer.


Report Offensive Follow Up For Removal

Response Number 9
Name: Mechanix2Go
Date: March 17, 2006 at 00:29:36 Pacific
Reply:

" I cannot delete the temp files it just will not let me"

What msg do you get?


==

For logging, if you do this:

c:\TEMP>del /s *.bak > log

you'll get a log which looks like this:

::== log
Deleted file - c:\TEMP\2.bak
Deleted file - c:\TEMP\J2.bak
Deleted file - c:\TEMP\J3.bak
Deleted file - c:\TEMP\AM.bak
Deleted file - c:\TEMP\NOcomp.bak
Deleted file - c:\TEMP\KB.bak
Deleted file - c:\TEMP\3.bak
Deleted file - c:\TEMP\J.bak
:: END


If at first you don't succeed, you're about average.

M2


Report Offensive Follow Up For Removal

Response Number 10
Name: JayJay Programmer
Date: March 17, 2006 at 17:21:57 Pacific
Reply:

ok, thanks umm no message just will not delete.

Now if I take out the temp part and replaced with cookies will I get a log for cookies?

once again Thank you

Building my Computer.
15 yr old Programmer.


Report Offensive Follow Up For Removal






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home



Results for: Log Files

Create log file
    Summary: i ned to know how to create log file with file date,sourcefile name,source file size,target file size,target file date ...
www.computing.net/answers/programming/create-log-file-/15402.html

write test line into log file with
    Summary: cant figure this out:-( i know how to put a dir list into a text file but i cant firgure out what to do with this: i want to write a word into a status.log file it has to write it on the next line in ...
www.computing.net/answers/programming/write-test-line-into-log-file-with-/15272.html

qbasic zip log files program help
    Summary: I have a server that generates log files from Internet Information Server for website reporting purposes. These log files are saved in d:\logfiles\w3svc*. There are currently 103 w3svc folders with ...
www.computing.net/answers/programming/qbasic-zip-log-files-program-help/12511.html








Which MP3 player do you have?

iPod/iPhone
Zune
Something Else
None


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History






Data Recovery Software