I know this is not vbscript it's old school batch file, but I cant find where else to post. Please see if you can help anyway, thanks
I am trying to go through the array, if the PC name is found it goes to the section found it else goes to RunMe
I can get it to echo out the names but as soon as I try and make it EQU %ComputerName% something does not work.
MCITP:EA/SA, MCSE, MCSA, MCDBA, MCTS, MCP+I, MCP
I am trying to go through the array, if the PC name is found it goes to the section found it else goes to RunMe
I can get it to echo out the names but as soon as I try and make it EQU %ComputerName% something does not work.
Code:
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
set TARGETMACHINE=G-13-24,G-13-25,G-13-26,IT-PC
for %%i in (%TARGETMACHINE%) do ( @set
::echo %%i
IF %COMPUTERNAME% == %%i (goto FoundIT) ELSE (goto RunMe)
)
)
:RunMe
echo You are not in the list this will run
goto end
:FoundIT
echo Found you, nothing to do
:end
pause
MCITP:EA/SA, MCSE, MCSA, MCDBA, MCTS, MCP+I, MCP