Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Getting pdir to display relative paths.

Nov
339
7
I usually run pdir as this:

servero 0 C:\Users\Miguel\Documents>pdir /(dymd thms z fpn)
20130828 165242 <DIR> C:\Users\Miguel\Documents\ChileIndomito
20130828 165516 <DIR> C:\Users\Miguel\Documents\fonts
20130914 214247 <DIR> C:\Users\Miguel\Documents\Plantillas personalizadas de Office
20130829 123458 <DIR> C:\Users\Miguel\Documents\viejasPeladoras
20130726 174617 1042986 C:\Users\Miguel\Documents\6ad1525e-8a2a-4df0-a435-4d7d7a389895.pdf
20130723 144906 2461354 C:\Users\Miguel\Documents\dozuki_tech_writing_handbook.pdf
20130803 162236 151904890 C:\Users\Miguel\Documents\FiveYearsofStories.mobi
20130803 163848 510374942 C:\Users\Miguel\Documents\FiveYearsofStories.pdf
20030309 133407 200554 C:\Users\Miguel\Documents\iiss.zip
20131016 182802 2050468 C:\Users\Miguel\Documents\java.txt
20130829 095019 111608927 C:\Users\Miguel\Documents\logs_apache2_Antonia6_todo.zip
20131016 175322 116 C:\Users\Miguel\Documents\qc.btm
20131016 183259 2045358 C:\Users\Miguel\Documents\tcc.txt


There are times, however, where I'd rather get a relative path, like this:

servero 0 C:\Users\Miguel\Documents>pdir /(dymd thms z f?n)
20130828 165242 <DIR> .\ChileIndomito
20130828 165516 <DIR> .\fonts
20130914 214247 <DIR> .\Plantillas personalizadas de Office
20130829 123458 <DIR> .\viejasPeladoras
20130726 174617 1042986 .\6ad1525e-8a2a-4df0-a435-4d7d7a389895.pdf
20130723 144906 2461354 .\dozuki_tech_writing_handbook.pdf
20130803 162236 151904890 .\FiveYearsofStories.mobi
20130803 163848 510374942 .\FiveYearsofStories.pdf
20030309 133407 200554 .\iiss.zip
20131016 182802 2050468 .\java.txt
20130829 095019 111608927 .\logs_apache2_Antonia6_todo.zip
20131016 175322 116 .\qc.btm
20131016 183259 2045358 .\tcc.txt


I can't find an easy way to do this directly. Sure, I could pass the output to a search&replace command (or edit the resulting text file by hand, which is what I'm doing currently), but I'd rather avoid that.

Any ideas? Or perhaps implement a new /(f...) option?
 
I don't understand your purpose here -- you just want to prefix a ".\" to all the filenames? (That's easily done, though I don't know why you'd want to make everything harder to read!)

Or is this example missing a /S option?

Yes, the idea is to use this with the /S option (I should have mentioned that).
 

Similar threads

Back
Top