script was working, now it will not
Posted: 08 Jun 2010 16:20
I put together a script to take ouy out from a dsquery and create a list of FQDNs.
The script was working, I closed the command window, opened a new one and now the script does not work.
Please help
The script is below
@echo off
for /f %%x in (computers.txt) do (
echo %%x
set mystr=%%x
for /f "useback tokens=*" %%a in ('%mystr%') do set mystr=%%~a
set mystr=%mystr:CN =%
set mystr=%mystr:DC =.%
set mystr=%mystr:Computers=%
set mystr=%mystr: =%
echo %mystr%
)
The script was working, I closed the command window, opened a new one and now the script does not work.
Please help
The script is below
@echo off
for /f %%x in (computers.txt) do (
echo %%x
set mystr=%%x
for /f "useback tokens=*" %%a in ('%mystr%') do set mystr=%%~a
set mystr=%mystr:CN =%
set mystr=%mystr:DC =.%
set mystr=%mystr:Computers=%
set mystr=%mystr: =%
echo %mystr%
)