cancel
Showing results for 
Search instead for 
Did you mean: 

Send to file not working

FIXED
journeys
Aspiring Pro
Posts: 3,829
Thanks: 44
Fixes: 1
Registered: ‎24-09-2008

Send to file not working

using the cmd ....Dir c:\ /s /b |sort /+256 /r >longname.txt

to list all filepath names > 256 characters doesn't seem to work.

the offending names are listed on the screen and not piped to longname.txt

 

can anyone see or correct the error?

6 REPLIES 6
Browni
Aspiring Hero
Posts: 2,673
Thanks: 1,055
Fixes: 60
Registered: ‎02-03-2016

Re: Send to file not working

Do you have write permissions for the directory you are running the command from?
journeys
Aspiring Pro
Posts: 3,829
Thanks: 44
Fixes: 1
Registered: ‎24-09-2008

Re: Send to file not working

@Browni yes it is in my docs on C:\users

The file name longname.txt is created in the directory and has 0 length

each entry on the screen is listed as The Directory Name ...directory and file name......  is to long

Browni
Aspiring Hero
Posts: 2,673
Thanks: 1,055
Fixes: 60
Registered: ‎02-03-2016

Re: Send to file not working

Fix

I'm stumped then as I copied & pasted the command into cmd (not powershell) in Windows 10 and it worked.

dircmd.PNG

journeys
Aspiring Pro
Posts: 3,829
Thanks: 44
Fixes: 1
Registered: ‎24-09-2008

Re: Send to file not working

Thanks @Browni  thank you for looking at it. think I've found the issue, the directory I was running the command against was created using a "Windows copy command" 

Any filepath+filename that was beyond the 256 character in the string seems to have been truncated at the 256 character mark and basically ignored in the copy.

7up
Community Veteran
Posts: 15,828
Thanks: 1,583
Fixes: 17
Registered: ‎01-08-2007

Re: Send to file not working


@Browni wrote:
Do you have write permissions for the directory you are running the command from?

And on that note, i just thought i'd remind you that there is cmd and command - both look the same but both act differently with long file names.

I need a new signature... i'm bored of the old one!
Browni
Aspiring Hero
Posts: 2,673
Thanks: 1,055
Fixes: 60
Registered: ‎02-03-2016

Re: Send to file not working

Long file names didn't exist when I started using DOS Grin