Windows CMD shell – 将命令本身重定向到输出的任何简单方法?如果我做网络本地组管理员> %computername%-admins.txt,我也希望输出文件包含net语句.
没有powershell可供我使用;仅限纯CMD / COMMAND.
也许有点蹩脚,但将命令放在批处理文件中并将批处理文件的输出重定向到您的txt文件.
原文链接:/windows/368385.htmlc:\echo net localgroup administrators > net_local_administrators.bat c:\net_local_administrators.bat > %computername%-admins.txt c:\del net_local_administrators.bat
%computername%-admins.txt的内容(清除成员名称):
C:\>net localgroup administrators Alias name administrators Comment Administrators have complete and unrestricted access to the computer/domain Members ------------------------------------------------------------------------------- Administrator MYDomain\Domain Admins User1 User2 The command completed successfully.