Computing.Net > Forums > Programming > variable on a log file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

variable on a log file

Reply to Message Icon

Name: brockey01
Date: February 10, 2009 at 21:49:36 Pacific
OS: Windows XP
CPU/Ram: 1024
Product: Hewlett-packard / Sd2100
Subcategory: Batch
Comment:

how could i go about doing this

set /p %info%= type something to be log
cls
set /p %log%= type name of log.

how would i use the two variables and use whats typed in the info and then log whats typed but use the name of %log% as the log name. i tried but not a clue why it dont work

Thanks
Brock



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: February 10, 2009 at 22:54:55 Pacific
Reply:

@echo off

set /p %info%= type something to be log
set /p %log%= type name of log.

> %log% echo %info%


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

M2


0

Response Number 2
Name: brockey01
Date: February 10, 2009 at 23:02:14 Pacific
Reply:

how do you get it to output a log file with %log% name?


0

Response Number 3
Name: brockey01
Date: February 10, 2009 at 23:05:27 Pacific
Reply:

i tested it it came up with a syntax error


0

Response Number 4
Name: Mechanix2Go
Date: February 11, 2009 at 00:05:30 Pacific
Reply:

LOL I pasted in what you posted. I should know better at my age.

============================================
@echo off

set /p info= type something to log
set /p log= type name of log
> %log% echo %info%


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

M2


0

Response Number 5
Name: brockey01
Date: February 11, 2009 at 08:23:33 Pacific
Reply:

man im dumb i forgot thatlol. thanks

how could i go about recalling info that stored from log files?


0

Related Posts

See More



Response Number 6
Name: brockey01
Date: February 11, 2009 at 13:41:25 Pacific
Reply:

any ideas? also how can i set to ask a question to open a log file that was stored before or recall to add more info.


Thanks


0

Response Number 7
Name: brockey01
Date: February 11, 2009 at 17:42:16 Pacific
Reply:

how do i when created a log how do i open that log file i created out of many that is created? also how can i recall info from logs created like number for example?


0

Response Number 8
Name: Mechanix2Go
Date: February 11, 2009 at 19:49:31 Pacific
Reply:

If you just want to see what's in the file, use this:

type logname

If you want to set a var:

set /p myvar=<logname


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

M2


0

Response Number 9
Name: brockey01
Date: February 11, 2009 at 20:10:08 Pacific
Reply:

well that works but how would i about search a for a log name. i use the varible

set /p %log%=<logname but it closes out. shouldnt.

how do you recall info from txt files ?


0

Response Number 10
Name: Holla
Date: February 11, 2009 at 21:41:46 Pacific
Reply:

You said:

set /p %log%=<logname but it closes out. shouldnt.

Do you really mean to use %log%?
Or is it a mistake?
%log% will expand to the content of the
vairable log.
If you want to set a variable by the name log
use:
set /p log=<logname

--
Holla.


0

Response Number 11
Name: brockey01
Date: February 12, 2009 at 13:20:02 Pacific
Reply:

What i wanted to do is use that and if i was to search for already created logs just type in the log name and have it open.

the %log% that was a mistake on my part.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Vb help Detection virtual Com Po...



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


Sponsored links

Ads by Google


Results for: variable on a log file

VBScript help creating a log file www.computing.net/answers/programming/vbscript-help-creating-a-log-file-/14414.html

Help ... READ a log file... www.computing.net/answers/programming/help-read-a-log-file/16493.html

Variable from a list file www.computing.net/answers/programming/variable-from-a-list-file/17057.html