Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Search Search
Search for:
Tech Support Guy Forums > > >

Solved: Batch OS


(!)

St0ner95's Avatar
Member with 1 posts.
THREAD STARTER
 
Join Date: Sep 2012
Experience: Beginner
15-Sep-2012, 11:15 AM #1
Post Solved: Batch OS
Hi
im trying to create an os batch file and was wondering how to load the first line of a file to use as the password
anyway here is my code so far...

Code:
@echo off
:login
echo Login:
set /p luser="username: "
set /p lpass="password: "
set /p fpass= <Users/%luser%.txt
if %lpass%=%fpass% then
goto start
else
cls
echo Error Username/Password Incorrect!
goto :login
:start
set /p cmd="> "
if %cmd%="help" then
goto :help
if %cmd%="newuser" then
goto :newuser

:help
echo Commands:
echo help	Shows This Help Screen
echo newuser	Creates A New User Account

:newuser
set /p user="Username: "
set /p pass="Password: "
echo %pass% >> Users/%user%.txt
echo %user%'s Account Sucsessfully Created!
goto :start
thanks alot

Last edited by St0ner95; 15-Sep-2012 at 11:17 AM.. Reason: easier to read now
Squashman's Avatar
Trusted Advisor with 19,465 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
20-Sep-2012, 07:54 PM #2
Read the hep for the IF command. You are making a simple syntax error.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


Tags
batch, batch os

(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑