EDIT: There was nothing wrong with the code below. The error was coming from elsewhere.
The command variable is the command I want to execute. The name variable is pulling a list of computer names. When I echo !command! it returns the value I want to use. That should run the command needed to delete all of the machines, however, when I actually run !command! or %command%, the name variable isn't added and it fails.
d:
cd "Program Files\admin"
setlocal EnableDelayedExpansion
SET string=%
for /f "tokens=*" %%a in (oldMachines.txt) do (
set name=%%a
set command=sbadmcl.exe AdminUser:admin -AdminPwd:password -Command:DeleteMachine -Machine:!name!
REM echo !name!
REM echo !command!
REM !command!
%command%
)
pause