Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I try to move my folders and files from a text list but i have this error, i use windows server 2012

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

PS C:\Users\Administrator> Get-Content x:\TNT Village - psp, psx - 2 parte\ps2\downloads\filestocopy.txt | ForEach-Objec
t {move-item $_ X:\TNT Village - psp, psx - 2 parte\ps2\downloads\--completati}
Get-Content : A positional parameter cannot be found that accepts argument 'Village'.
At line:1 char:1
+ Get-Content x:\TNT Village - psp, psx - 2 parte\ps2\downloads\filestocopy.txt |  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-Content], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetContentCommand

PS C:\Users\Administrator>

Village is a part of path..why it give me like an positional error?

Inside filestocopy.txt file i have this:

X:\TNT Village - psp, psx - 2 parte\ps2\downloads\hitman 2
X:\TNT Village - psp, psx - 2 parte\ps2\downloads\Jak 3.rar
X:\TNT Village - psp, psx - 2 parte\ps2\downloads\James Cameron's Dark Angel PAL PS2DVD
X:\TNT Village - psp, psx - 2 parte\ps2\downloads\Kh_1.iso
X:\TNT Village - psp, psx - 2 parte\ps2\downloads\Marvel La Grande Alleanza.rar
share|improve this question

1 Answer 1

up vote 3 down vote accepted

Use the ' or " symbols if the path or file name contains spaces or characters that the command line can be interpreted as a command.

Example: Get-Content "x:\TNT Village - psp, psx - 2 parte\ps2\downloads\filestocopy.txt" | ForEach-Object {move-item $_ "X:\TNT Village - psp, psx - 2 parte\ps2\downloads\--completati"}

share|improve this answer
    
thank you, you're right! –  user332153 Jun 30 '14 at 2:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.