Link to home
Start Free TrialLog in
Avatar of mrfite
mrfiteFlag for United States of America

asked on

How do I add text file input to this bach file

I have the following batch file to pull a computer's UUID and add it to the WIndow's Deployment Service for Prestaging.  

I have gone into my existing AD and queried the Computer's from it and output it to a file called "ad.txt".  I want to use "ad.txt" as the input and run the below script:

for /f %%I IN (
'psexec  \\^%1 cmd /c "echo csproduct get UUID|wmic.exe" ^| ^
findstr /r ........-....-....-....-............ '
) do wdsutil /set-device /device:%1 /id:%%~I
Avatar of Qlemo
Qlemo
Flag of Germany image

for /F "tokens=*" %%F in (ad.txt) do call wdsadd %%F
exit /b

:wdsadd
for /f %%I IN (
'psexec  \\^%1 cmd /c "echo csproduct get UUID|wmic.exe" ^| ^
findstr /r ........-....-....-....-............ '
) do wdsutil /set-device /device:%1 /id:%%~I
exit /b

Open in new window

Avatar of mrfite

ASKER

Qlemo,

When I run the batch I get

'wdsadd' is not recognized as an internal or external command, operable program, or batch file.
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mrfite

ASKER

Thanks for the quick response and solution that worked.