Board logo

标题: 批处理不知道错在哪了 [打印本页]

作者: zhaodaijun     时间: 2010-2-5 21:38    标题: 批处理不知道错在哪了

if not exist c:\windows\system32\control.exe goto next
echo %computername%于%date%%time%发现系统存在control.exe程序>>c:\%computername%.txt
@exit

:Next
if not exist c:\windows\system32\mstsc.exe
echo %computername%于%date%%time%发现系统存在mstsc.exe程序>>c:\%computername%.txt
exit



前面一步能执行,不知道为什么后面的就执行不了咯。请高人解答,本人菜鸟不知道错在那里
作者: jobszheng5     时间: 2010-2-5 23:22
第二个 “if” 命令格式错了,后面没有跟command

if not exist c:\windows\system32\control.exe goto next
echo %computername%于%date%%time%发现系统存在control.exe程序>>c:\%computername%.txt
@exit

:Next
if not exist c:\windows\system32\mstsc.exe echo %computername%于%date%%time%发现系统存在mstsc.exe程序>>c:\%computername%.txt(与if放到同一行即可)
exit