How to Make a Save File That You Can Call.

Introduction: How to Make a Save File That You Can Call.

im going to teach you how to make a save file that can hold passwords, usernames, important information, even games i have my videos to explain more: :is my saving variables video. : is my accessing video.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Calling Files

first of all im going to tell you about the call method. the call method allows a batch file to run(or call) the other file in the same file.

for example, in the first file(you can put anything you want to be remembered. name it what your username was for me it would be gram.bat):

set user=gram
set pass=1234

and in the second file(you can name it whatever you want):

@echo off
echo 1.)login
set  /p var=
if %var% == 1 goto login
goto main

echo username?
set /p use=
call %use%.bat
echo password?
set /p pas=
if %pas% == %pass% goto loged
echo wrong password/username
pause >nul
goto main

echo what you want when you log in
pause >nul
goto loged

and that is how to use the call method in the next step ill teach you how to write in files.

Step 2:

writing to files is very simple. if you want a username to be set you can use this(name is the file you want it to be written to):

echo set user=gram >> name.bat

the echo is writing what goes after it.
>> is inputting it into the file name.bat

an example for the last program would be adding this in:

echo set your username:
set /p user=
echo set your password:
set /p pass=

echo set user=%user% >> %user%.bat
echo set pass=%pass% >> %user%.bat

goto loged

Be the First to Share


    • Backyard Contest

      Backyard Contest
    • Silly Hats Speed Challenge

      Silly Hats Speed Challenge
    • Arduino Contest 2020

      Arduino Contest 2020