如果通过命令提示符运行但不在脚本中运行命令..?(Command works if run through the command prompt but not in a script..?)
我正在尝试使用批处理文件编写许多补丁的安装脚本,因为PowerShell没有正确安装补丁。 我正在运行的命令是这样的:
dism /online /add-package /PackagePath:"C:\<path>\5cbb03ca-7a2a-4326-952f-80ad8052a886\windows6.1-kb2836942-x64-express.cab"直接从命令行运行时,这非常有效。 但是,如果我把它放在一个名为example.bat的文件中,它将失败并显示以下消息:
'þd' is not recognized as an internal or external commandI'm trying to script the installation of a number of patches using a batch file since powershell doesn't properly install the patches. The command I'm running is this:
dism /online /add-package /PackagePath:"C:\<path>\5cbb03ca-7a2a-4326-952f-80ad8052a886\windows6.1-kb2836942-x64-express.cab"That works perfectly when run directly from the command line. But if I put it in a file called example.bat it fails with the following message:
'þd' is not recognized as an internal or external command最满意答案
我认为您的批处理文件保存为Unicode。
在记事本中重新打开它并重新保存,确保编码字段设置为ANSI。
I think your batch file is saved as Unicode.
Re-open it in Notepad and re-save it, making sure the Encoding field is set to ANSI.
更多推荐
发布评论