首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >powershell中的copype.cmd脚本

powershell中的copype.cmd脚本
EN

Stack Overflow用户
提问于 2016-03-21 19:39:30
回答 1查看 2.1K关注 0票数 0

我想构建自定义创建Win pe的脚本,我已经在Internet上找到了示例脚本,但是它们不适合我。

剧本是:

代码语言:javascript
复制
$Architecture = "x86"
$env:path = $env:path + "; C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\DandISetEnv.bat; C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\AMD64\DISM;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\AMD64\Imaging;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\AMD64\BCDBoot;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\AMD64\Oscdimg;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\AMD64\Wdsmcast;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\HelpIndexer;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\WSIM;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment;C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Imaging and Configuration Designer\x86;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\; C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\copype.cmd"
$BuildDir = "D:\winpe x86_2"
Write-Host ("Running Copype script please wait...") -Force 'Yellow'
Invoke-Command { copype.cmd $Architecture $BuildDir }

我尝试调用表达式相同的错误,我尝试使用DandISetEnv.bat,我把它放在env变量中,但没有成功,我看不出出了什么问题。以下是错误:

代码语言:javascript
复制
Running Copype script please wait... -Force Yellow
ERROR: The following processor architecture was not found: x86.
Failed!
EN

回答 1

Stack Overflow用户

发布于 2020-11-26 13:42:15

我无意中发现了这个老问题,试图做同样的事情。我设法让它使用这个函数:

代码语言:javascript
复制
function Test-CopyPE {
  $peFileDir = "C:\TestCustom\PE_Files"
  $env = "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\DandISetEnv.bat" 
  cmd.exe /c """$env"" && copype amd64 $peFileDir"
}

以下是我用来帮助我找出答案的一些相关答案:

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36140100

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档