|Hi people thanks for the replies!|
IVO, I didn't know what was the difference between CALL and START, so that was the only thing I needed thanks!
Mechanix2Go, Hey go easy on me, I'm trying to learn DOS language by myself and I started just a month ago =P
Here's the working code I ended up with =D:
@ECHO OFF & setLocal enableDELAYedeXpansion
IF EXIST user.bat call user.bat
IF NOT 0%name% EQU 0 goto task
ECHO @ECHO OFF > name.bat
ECHO SET /P name=Enter your name: >> name.bat
ECHO ECHO Welcome, %%name%% >> name.bat
ECHO pause >> name.bat
ECHO SET name=%name% > user.bat
del /Q name.bat
ECHO You are %name%.
ECHO GRATZ!! This batch works!
BTW: Is there a way of forbidding user of setting %name% with spaces, or to allow spaces? Like this:
SET /p name=Enter your name [no spaces allowed]
IF NOT %name% "has spaces" goto b
ECHO "%name%" is invalid - Enter a name without spaces.
ECHO Hi %name%.