Name: slomifier Date: March 23, 2008 at 20:13:39 Pacific Subject: Reading a file using a batch file OS: XP CPU/Ram: 512
Comment:
I'm trying to create a batch script that can read a single lined file containing a password (making a login script), than set the read string as a variable. So far, all my attempts have failed. I'm pretty new to batch files, so the simplest script possible would be the best. This is what I've tried so far:
@set tpass=(TYPE "c:\login\%name%s_pass.bat")
This is what I've tried so far, but instead of reading the file and setting it as tpass, it sets tpass as "(TYPE "c:\login\%name%s_pass.bat")".
%name% is the name their trying to login as
tpass is the pass they entered to compare with the stored pass
%name%s_pass.bat is the file I'm trying to read (but It doesn't have to be a bat)
this is certainly not the best way to password authenticate a person. If its for fun, then its ok. If not, set up a proper authentication mechanism, not using batch!
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE