Computing.Net > Forums > Programming > Batch file name save

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.

Batch file name save

Reply to Message Icon

Name: minos
Date: May 30, 2008 at 05:43:46 Pacific
OS: XP Blackmoon SP3
CPU/Ram: 8gb
Product: AMD QUAD Custom
Comment:

Hello all.

I have created a network administrating and monitoring program with batch scripting and am now going back over it to update it. One thing i would like to do is for it to save login input to a txt file (just the session name, see below)

I would like the file to save input to an external txt file after the user enters his/her name and presses enter. The program has 2500+ lines so i will give you snippets from it. This is the part where i would like the new script to go.

@echo off
color 0A
title MINOS V3.00
goto banner1

:banner1
(banner here, excluded from example)
...
...
...

:loginuserpass1
set /P C=Enter full name to continue: (User would enter name here and it would be save to a txt file)
if "%C%"=="" goto banner2
if "%C%"=="quit" goto quit
goto banner2

So the user would enter thier name then hit enter and the name would be saved to the txt file. I cannot remember the command to do this as i have not used it in my program. Would be gratful if some1 could help. If any questions or you need more script just ask.\

( \/ )( )( \( )/ \ / __)
) ( )( ) (( () )\__ \
(_/\/\_)(__)(_)\_)\__/ (___/



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: May 30, 2008 at 20:34:59 Pacific
Reply:

echo %C% >> outFile.txt


0

Response Number 2
Name: minos
Date: May 31, 2008 at 07:48:47 Pacific
Reply:

how do i input this into my current script, i had a go by giving its own line, it created outfile.txt but wrote "ECHO is off"

( \/ )( )( \( )/ \ / __)
) ( )( ) (( () )\__ \
(_/\/\_)(__)(_)\_)\__/ (___/


0

Response Number 3
Name: Razor2.3
Date: May 31, 2008 at 08:04:57 Pacific
Reply:

Sometime after you set %C%, would be my guess.


0

Response Number 4
Name: minos
Date: May 31, 2008 at 08:24:29 Pacific
Reply:

nvm, got it, thanks

( \/ )( )( \( )/ \ / __)
) ( )( ) (( () )\__ \
(_/\/\_)(__)(_)\_)\__/ (___/


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







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: Batch file name save

Batch file to find ip and host name, and save www.computing.net/answers/programming/batch-file-to-find-ip-and-host-name-and-save/19455.html

Batch file name incrementing www.computing.net/answers/programming/batch-file-name-incrementing/14959.html

batch file name date and time www.computing.net/answers/programming/batch-file-name-date-and-time/15060.html