简体   繁体   English

xcopy 仅在 powershell 中的参数数量无效

[英]xcopy invalid number of parameters in powershell only

I'm trying to run the following xcopy command我正在尝试运行以下 xcopy 命令

xcopy /s /i "./deps/Ultralight/build_release_x64_static_MT/out" "./deps/AppCore/deps/Ultralight"

When I run it in command prompt it works.当我在命令提示符下运行它时,它可以工作。

Microsoft Windows [Version 10.0.19042.630]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>xcopy /s /i "./deps/WebKitLibraries/" "./deps/WebCore/deps/WebKitLibraries/"
File not found - ./deps/WebKitLibraries/
0 File(s) copied

C:\WINDOWS\system32>

When I run it in powershell it fails当我在 powershell 中运行它时,它失败了

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\Jonathan> xcopy /s /i "./deps/WebKitLibraries/" "./deps/WebCore/deps/WebKitLibraries/"
Invalid number of parameters
PS C:\Users\Jonathan>

I don't see any issues with the syntax.我看不出语法有任何问题。 Any ideas?有任何想法吗?

Use backslash \ instead of forward slash / .使用反斜杠\而不是正斜杠/ It will work.它会起作用的。 Don't know why it prints Invalid number of parameters .不知道为什么会打印Invalid number of parameters

xcopy /s /i ".\deps\WebKitLibraries\" ".\deps\WebCore\deps\WebKitLibraries\"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM