【发布时间】:2013-03-08 18:36:33
【问题描述】:
几年前我看到其他人解决了这个问题,但他们似乎没有给出有效的答案。
当我尝试在批处理文件中传递这两个命令时(手动完成时它们可以工作):
nltest /dsgetsite>c:\windows\temp\site.txt
set /p CurrentADSite<c:\windows\temp\site.txt
但是当我尝试通过批处理文件发出命令时,我得到了这个:
C:\working>nltest /dsgetsite 1>c:\windows\temp\site.txt
C:\working>set /p CurrentADSite 0<c:\windows\temp\site.txt
The syntax of the command is incorrect.
我到底是如何让这个工作的?有没有更简单的方法可以将 dsgetsite 结果直接传递到变量中?
【问题讨论】:
-
这是Super User 问题,不是Stack Overflow 问题。
-
Lasse,因为批处理文件、shell脚本等自动化语言不会编程?我不同意。
标签: batch-file environment-variables