jueves, 3 de noviembre de 2016

General Quick Tip: Copy folder path & Copy folder content's names

Two situations,

1-You've saved a file on a folder really deep into your drive and need to save something else there.
You could use the path but the "Save As" window don't allow you to access the path directions.

For this we'll edit window's register regedit.exe (carefully) looking for the folder
HKEY_CLASSES_ROOT\Directory\background\shell\.
Here we create a new key and name it as  "Copy Path", inside we create a new key named "command". Once you have the last key, create a string value and set the Value Data as below.

cmd.exe /s /k "chdir  |clip & exit" 

The command promps a cmd window at the location of the folder, copies the address to the clipboard and exits the cmd window.

Your register should look like this. Note the complete address in the lower left corner of the image.

2-The second situation, you need to send the name of a batch of +50 files inside a folder by email to show which files you have edited.

For this we use the same logic but instead of asking the path of the current folder, we'll call the command "dir * /B" - dir = show content of directory, * is to show all elements in the directory and /B uses bare format (no heading information or summary).

The result will be a text list on the clipboard like this.


M-001-A - COLES BUILDING HVAC LAYOUT GROUND FLOOR - SHEET 1.pdf
M-002-A - COLES BUILDING HVAC LAYOUT GROUND FLOOR - SHEET 2.pdf
M-003-A - COLES BUILDING HVAC LAYOUT GROUND FLOOR - SHEET 3.pdf
M-004-A - COLES BUILDING HVAC LAYOUT GROUND FLOOR - SHEET 4.pdf
M-005-A - COLES BUILDING HVAC LAYOUT GROUND FLOOR - SHEET 5.pdf
M-006-A - COLES BUILDING HVAC LAYOUT GROUND FLOOR - SHEET 6.pdf
M-007-A - COLES BUILDING HVAC LAYOUT GROUND FLOOR - SHEET 7.pdf
M-008-A - COLES BUILDING HVAC LAYOUT GROUND FLOOR - SHEET 8.pdf
M-009-A - COLES BUILDING HVAC LAYOUT GROUND FLOOR - SHEET 9.pdf
M-010-A - COLES BUILDING HVAC LAYOUT GROUND FLOOR - SHEET 10.pdf
M-011-A - COLES BUILDING HVAC LAYOUT GROUND FLOOR - SHEET 11.pdf
M-012-A - COLES BUILDING HVAC LAYOUT GROUND FLOOR - SHEET 12.pdf

We follow the same instructions as before but creating a main key named "Content"
HKEY_CLASSES_ROOT\Directory\background\shell\Content\command\

The script will look like below.

cmd.exe /s /k "dir * /B |clip & exit"  

The result will be two commands on the context menu (right click) of any folder in windows.



If you think you may broke something or you are too lazy to do it all, you could use my copy of this register entries here. If you doubt of what is included open it with notepad or any text read before adding it.

Hope you find it useful.


No hay comentarios:

Publicar un comentario