I can't seem to get the if statement to work for Hello World. I think it is because of the spaces but any help would be appreciated.
if %A%==Chrome (
start "" "C:\Users\Matthew\Appdata\Local\Google\Chrome\Application\chrome.exe\"
) else (
if %A%==Steam (
start "" "C:\Program Files (x86)\Steam\Steam.exe\"
) else (
if %A%==CMD (
start
) else (
if %A%==System32 (
start "" "C:\Windows\System32\"
) else (
if %A%==Appdata (
start "" "C:\Users\Matthew\Appdata\"
) else (
if %A%==Skype (
goto Skype
) else (
if "%A%"=="Hello World" (
goto HelloWorld
)
)
)
)
)
)
)
If the contents of
%A%
include spaces (Hello world
), the first condition will fail as it will be parsed asIf you expect to have spaces in your variable, you will need to use quotes not in the last condition but in all your conditions