Windows 批量脚本输出记录到文件中

Windows 批量脚本输出记录到文件中,windows,batch-file,Windows,Batch File,我想为每个命令记录下面的脚本,不管它是成功还是失败。我相信在shell脚本中,我们有命令$?来知道执行的命令是成功还是失败。有没有办法在批处理脚本中实现这一点 open server username Password-1 bin cd \Current_QA_DataLoad put E:\AccountsInitialV6.txt PAUSE bye 提前谢谢 维克拉姆当然 yourCommand && ( commands to execute upon succe

我想为每个命令记录下面的脚本,不管它是成功还是失败。我相信在shell脚本中,我们有命令
$?
来知道执行的命令是成功还是失败。有没有办法在批处理脚本中实现这一点

open server
username
Password-1
bin
cd \Current_QA_DataLoad
put E:\AccountsInitialV6.txt
PAUSE
bye
提前谢谢 维克拉姆

当然

yourCommand && (
   commands to execute upon success
) || (
   commands to execute upon failure
)