cancel
Showing results for 
Search instead for 
Did you mean: 

Send to file not working

FIXED
Community Veteran
Posts: 3,827
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
Browni
Aspiring Hero
Posts: 2,299
Thanks: 790
Fixes: 47
Registered: ‎02-03-2016

Re: Send to file not working

Do you have write permissions for the directory you are running the command from?
I must have been really bad in a previous life as this was my 3rd ISP in a row that used lithium.
Now you're stuck with me because my new ISP doesn't run a forum Cheesy
Community Veteran
Posts: 3,827
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,299
Thanks: 790
Fixes: 47
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

I must have been really bad in a previous life as this was my 3rd ISP in a row that used lithium.
Now you're stuck with me because my new ISP doesn't run a forum Cheesy
Community Veteran
Posts: 3,827
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.

Community Veteran
Posts: 14,439
Thanks: 728
Fixes: 12
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,299
Thanks: 790
Fixes: 47
Registered: ‎02-03-2016

Re: Send to file not working

Long file names didn't exist when I started using DOS Grin
I must have been really bad in a previous life as this was my 3rd ISP in a row that used lithium.
Now you're stuck with me because my new ISP doesn't run a forum Cheesy