So this may be seemingly pointless, but I'm doing it to try and increase my understanding of how parameters work and how variables can be stored within each other.
What I'm trying to do is this:
--The actual batch file--
@echo off
if "%1" == "/?" ( echo blah blah help etc.)
if not "%1" == "/?" ( echo %%myvar%%)
--end batch file--
--enter cmd prompt--
C:> sim.bat username
Hsu (i.e. returns the env username)
C:>
--exit cmd prompt--
The reason I want to do %%myvar%% is because I want to pass the parameter as an environment variable. So that sim.bat os or sim.bat username will pull the environment variable.
Stupid I know, but I was able to write it in another way but it is long and tedious:
if "%1" == "homedrive" (echo %homedrive%)
if "%*" =="homeshare" (echo %homeshare%)
...so on and so forth
I looked in multiple places and it's possible I just don't fully understand, but I'm trying to learn, so thanks in advance!