Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - Illegal Character in the path

Reply
 
Old 03-30-2009   #1 (permalink)
Chris


 
 

Illegal Character in the path

Hi ...

I have a situation where I'm using the \\?\UNC\ prefix to display
directories /files that are over 256 characters . So I'm trying to use
Get-Childitem then the path \\?\UNC\Server\Share but it doesn't like the ?
character . I tried escaping it but it doesn't work ... Anyone know of a way
to do this ?


Thanks Much

Chris


My System SpecsSystem Spec
Old 03-30-2009   #2 (permalink)
Chris


 
 

RE: Illegal Character in the path

I think I found my answer ... seems like the cmdlet doesn't like the ? in the
path but if you use it in the File system object path it works just fine .


For example after creating your file system object (FSO)

$folder = fso.getfolder("\\?\UNC\Server\Share")


Hope this helps someone .

Chris
"Chris" wrote:
Quote:

> Hi ...
>
> I have a situation where I'm using the \\?\UNC\ prefix to display
> directories /files that are over 256 characters . So I'm trying to use
> Get-Childitem then the path \\?\UNC\Server\Share but it doesn't like the ?
> character . I tried escaping it but it doesn't work ... Anyone know of a way
> to do this ?
>
>
> Thanks Much
>
> Chris
>
My System SpecsSystem Spec
Old 03-31-2009   #3 (permalink)
Josh Einstein


 
 

Re: Illegal Character in the path

That's a special format that most .NET API's can't use anyway because of
various reasons like MAX_PATH being 260 chars, backwards compatibility with
FAT32, etc. Since under the hood PowerShell is probably using the API's in
System.IO namespace, that's probably why you're outta luck.

"Chris" <Chris@xxxxxx> wrote in message
newsFC8C5CF-C9E4-4B1B-A5C7-BB4D288FC19B@xxxxxx
Quote:

> I think I found my answer ... seems like the cmdlet doesn't like the ? in
> the
> path but if you use it in the File system object path it works just fine .
>
>
> For example after creating your file system object (FSO)
>
> $folder = fso.getfolder("\\?\UNC\Server\Share")
>
>
> Hope this helps someone .
>
> Chris
> "Chris" wrote:
>
Quote:

>> Hi ...
>>
>> I have a situation where I'm using the \\?\UNC\ prefix to display
>> directories /files that are over 256 characters . So I'm trying to use
>> Get-Childitem then the path \\?\UNC\Server\Share but it doesn't like the
>> ?
>> character . I tried escaping it but it doesn't work ... Anyone know of a
>> way
>> to do this ?
>>
>>
>> Thanks Much
>>
>> Chris
>>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Error 1324. The path ? contains an invalid character (FSX) Vista Games
Error 1324 The path My Data contains an invalid character. Software
How do I escape the wildcard character in a path string? PowerShell
Why still a 260 character path limit ? Vista General
BUG? (Test-Path $path -IsValid) and empty $path PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46