RE: [Batch] Help w/ Wierd Spacing Issue 03-23-2014, 05:32 AM
#15
You could also have files...
In get_username.bat, you could have everything that would grab the user input. Then you can use it later.
Example:
main.bat:
functions1.bat:
Output:
For a simple function:
The other way you could set it up is have a file that just holds related functions, and call functions from within the file externally.
Code:
@echo off&setlocal enabledelayedexpansion
call get_username.batIn get_username.bat, you could have everything that would grab the user input. Then you can use it later.
Example:
main.bat:
Code:
@echo off&setlocal enabledelayedexpansion
call functions1.bat
echo %user%functions1.bat:
Code:
set user=BobOutput:
Code:
BobFor a simple function:
Code:
@echo off&setlocal enabledelayedexpansion
call :get_username
echo %user%
pause&goto :eof
:get_username
set /p user=Enter a username:
goto :eofThe other way you could set it up is have a file that just holds related functions, and call functions from within the file externally.
(This post was last modified: 03-23-2014, 05:47 AM by 0xDEAD10CC.)




![[+]](https://sinister.li/images/modern/collapse_collapsed.png)