9
3
I have a login script that runs for every user. The first check sees if the username matches our Test-Taking User (exam). If so, launches Firefox to the exam homepage and stops.
The commands individually work. When I call the .bat file, it launches Internet Explorer to the website. What am I doing wrong?
@echo off
REM Exam Startup - Username is "exam", then start the Exam website, and exit the script
if %USERNAME% EQU exam (
if exist "%PROGRAMFILES%\Mozilla Firefox\firefox.exe" start "%PROGRAMFILES%\Mozilla Firefox\firefox.exe" "https://www.example.com/"
if exist "%PROGRAMFILES(x86)%\Mozilla Firefox\firefox.exe" start "%PROGRAMFILES(x86)%\Mozilla Firefox\firefox.exe" "https://www.example.com/"
exit
)
...
REM rest of script
So if I understand this correctly,
startinterprets...firefox.exeas the title and the URL as what should be started and is intelligent enough to detect an URL and feed it to the default browser? – Boldewyn – 2016-04-12T08:46:47.9502@Boldewyn:
startindeed knows what to do with URLs, and that's to open them in the default browser. – MSalters – 2016-04-12T08:48:20.153