Hi All
Thanks in advance for Anyone help
I'm trying to make my bat file run on specific workstations by comparing the workstation MAC address with inserted MACs inside my batch then Run my Bat if the workstation MAC address is one of them or EXIT if the workstation MAC address is not
but unfortunately, it didn't work for me also I tried to test this bat file for my localhost but also it didn't work, Can anyone help me and correct my code, please?
Here is my code below
for /f "tokens=3 delims=," %%i in ('getmac /s localhost /v /nh /fo csv') do Set "MyMAC=%%~i"
echo %MyMAC%
pause
if /I "%MyMAC%"==8C-DC-D4-42-F8-12( GOTO START_APP )else
if /I "%MyMAC%"==8C-DC-D4-42-53-73( GOTO START_APP )else
if /I "%MyMAC%"==8C-DC-D4-42-F8-A4( GOTO START_APP )else
if /I "%MyMAC%"==8C-DC-D4-42-F8-98( GOTO START_APP )else
( Echo "The program cannot be run on this workstation" & Timeout /t 3 /NoBreak >nul & GOTO EXIT )
:START_APP
Echo This workstation is Authorized to run this App
pause
:EXIT
exit