Home > OS >  Use for/f statements can only read the last line of the specified file record, please master action
Use for/f statements can only read the last line of the specified file record, please master action

Time:09-16


Can only let Pclist. TXT in the column in the last line of the computer to perform an action, how to modify let Pclist. TXT in every computer to perform the corresponding operation

CD for/f % % I in (% % \ pclist. TXT) do set NewHost=% % I
Psexec NewHost \ \ % % the -u username -p password - c - c: \ Users \ WICleanupC EXE -s


Please action

CodePudding user response:

Do add parentheses, behind the psexec as a whole,
CD for/f % % I in (% % \ pclist. TXT) do (
The set NewHost=% % I
Psexec \ \! NewHost! -u username -p password - c - c: \ Users \ WICleanupC EXE -s
)
  • Related