Ed Dyreen wrote:'
like
Code: Select all
@echo off
> "redirect.CMD" (
::
echo.@echo off
echo.
echo.echo.This works
echo.pause
echo.exit /b
)
call "redirect.CMD"
pause
exit /b
Wow, that was a fast reply!
And..
No it's kind of not like that...
I was thinking on using this on a "Sava Game" System..
I'm making a game with CMD but when i close the cmd window all variable go "0"
I put the option "save" on the menu, so once you save and you close the window then open it again you can load your game..
I want the window to open and close automatically and once closed a txt file will be created with text inside..
If the code you said was like that it would work like that (People can't see what is going on):
Code: Select all
:: %CRED% is the variable that contains the money..
:: Lets say that %CRED% equals 2000
:: --Saving the Game--
> "money.txt" (
::
echo.%CRED%
)
exit
:: That means that the text in the first line of the "money.txt" file is 2000
::--------------------------
:: The window was closed and now it's opened, that means that %CRED% equals 0
:: --Loading the Game--
set /p CRED=<money.txt
goto main_menu
:: Now the %CRED% has changed from 0 to 2000