千家信息网

Powershell 复制文件到C:\windows\system32

发表于:2024-10-19 作者:千家信息网编辑
千家信息网最后更新 2024年10月19日,写一个Powershell脚本碰到这个问题,浪费我好多时间.由于 windows系统分32位的64位的,所当把文件拷贝到system32这个系统目录是有区别的直接拷贝命令Copy-Item -Forc
千家信息网最后更新 2024年10月19日Powershell 复制文件到C:\windows\system32

写一个Powershell脚本碰到这个问题,浪费我好多时间.

由于 windows系统分32位的64位的,所当把文件拷贝到system32这个系统目录是有区别的

直接拷贝命令

Copy-Item -Force c:\temp\backgroundDefault.jpg c:\windows\system32\oobe\info\backgrounds\

64位系统 文件会拷贝到 C:\Windows\SysWOW64\oobe\info\

64位要拷贝到system32这个目录,需要写 c:\windows\sysnative\

**Copy-Item -Force c:\temp\backgroundDefault.jpg c:\windows\sysnative\oobe\info\backgrounds\**

https://social.technet.microsoft.com/Forums/office/en-US/2551af46-b974-4a19-b027-9c0ffe405aac/copy-file-to-cwindowssystem32-on-windows64?forum=winserverpowershell

0