Bat脚本会切断下一行的随机字符

时间:2015-06-02 17:16:14

标签: powershell batch-file

我有一个bat脚本可以执行几个cmd并运行一堆powershell脚本。有时它会在第二个或第三个命令上出错,因为它会切断几个字符。它也是在PowerShell脚本之后的xcopy命令上完成的,反之亦然。所以这是一个例子: 蝙蝠文件:

xcopy "\\server\####\####\######" "C:\######" /S/I/E/Y
powershell "C:\SetupVM.ps1"

输出:

\\server\Hard Disks\******.vhdx
\\server\Virtual Machines\*******.XML
2 File(s) copied

C:\Users\*****>rshell "C:\SetupVM.ps1"
'rshell' is not recognized as an internal or external command,
operable program or batch file.

有没有人见过这个?关于如何避免它的任何想法?

1 个答案:

答案 0 :(得分:-2)

从我所看到的,命令行无法识别' rshell'命令。

检查您的环境变量或从&rs;' .com / .exe所在的位置启动命令。

除此之外,没有看到powershell脚本的内容就没什么可说的了......

相关问题