Instructables

g-one

  • Date JoinedJun 21, 2009
  • Best Answers %25%

Comments

g-one has not posted any comments yet...

Orangeboard

the batch code that you wrote for me about a batch file remembering text the last time it was run

@echo off &setlocal
for /f "skip=7 tokens=*" %%i in ('type "%~0"') do set "txt=%%i"
if defined txt echo Your last input was "%txt%".
echo.
set /p "x=Your new Input: "
if defined x echo %x%>>"%~0"
goto :eof

What Does It Mean...
g-one (author)  Psychic Master4 years ago
Its just an exemple. The last line "goto :eof" means go to end of file and exit. Thats why all lines under "goto :eof" will completely ignored by the command line interpreter. This fact is usefull for your intention. All what this batch code will do is
- Check if there is any line under the 7th line. If true, show the last line.
- Write a new line to the end of this batch file (to show it the next time)

Hope that helps.
(BTW Sry for my bad English - I'm from Germany...)
Hello! Welcome to Instructables!

I am the Instructables Robot. My job is to alert you whenever someone leaves you a comment or sends you a private message. I spend most of my day sending email. I like sending email.

You probably want to upload an image to your profile. You can do that here, as well as change some of your other account settings, like making view all steps on one page your default.

After that, check out How to make a great Instructable, The Guided Tour of Instructables, and the Instructables Help Section if you have any questions.

Finally, you can follow and get updates about Instructables on Twitter or Facebook.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!