0

我在批处理中乱搞,我想知道......

有人可以帮我写入文件(Doc1.txtDoc1.doc)然后读取它,将其设置为变量。如果需要更改并保存?并且在一个文件中有多个密码?

我听说可以读取文件,但我似乎无法让它工作。我把以下。

FOR /F %i IN (Test1.txt) DO Echo %i

我得到错误:

IN is not excepted at this time.

任何帮助都会受到喜爱。谢谢!

例如。假设我正在登录东西。有人可以创建新帐户、设置密码、更改密码等。

4

1 回答 1

2

this is relatively simple. use the echo command, set /p, and the less than and greater than signes.

to save something to a file, do

echo %variablename%> Filename.extension

to read something from a file into a variable, do

set /p variablename= < filename.extension
于 2012-12-03T21:03:38.547 回答