Shortcuts to copy to predefined folder

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
dekiblue
Junior Member
Junior Member
Posts: 30
Joined: 2010-09-30, 14:39 UTC

Shortcuts to copy to predefined folder

Post by *dekiblue »

Is there a way to create a keyboard shortcuts that will copy selected file(s) and /or folder(s) to the predefined destination?

Deki
User avatar
nsp
Power Member
Power Member
Posts: 1954
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

To my knowledge the easiest way is :
A) Create a script that do the copy.
B) Create a user command that call the script
C) Assign a Keyboard Shortcut to your user command.

To build your script, you can use a simple editor based on the current file selection. You caan get it inside your editor using a command like:

Code: Select all

command: notepad
parrameter: %L
If you need unicode/utf8 you can use %WL or %UL instead of %L.
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

PowerShell: ForEach in %L Selection Do Copy

Post by *Stefan2 »

As nsp says.
I would try something like:



A+B) Create a script as user command:

\usercmd.ini

[em_CopySelectionToTarget]
cmd=PowerShell
param=TYPE %L | ForEach{ Copy $_ -Recurse 'F:\tmp\predefined destination' }




C) Assign a Keyboard Shortcut to your user command.

Menu > Configuration > Options... > Misc.
Hotkey: choose one
Command: em_CopySelectionToTarget


 
dekiblue
Junior Member
Junior Member
Posts: 30
Joined: 2010-09-30, 14:39 UTC

Post by *dekiblue »

Thanks guys, I will give it a try!

Cheers,
dekiblue
Junior Member
Junior Member
Posts: 30
Joined: 2010-09-30, 14:39 UTC

Post by *dekiblue »

With Copy works great!

I tried to substitute Copy with Move (I actually have to move those files/folders) but it's not working.

Any idea why?

Thanks!
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

PowerShell: ForEach in %L Selection Do Move

Post by *Stefan2 »

dekiblue wrote:... with Move ... it's not working.
WHAT is not working?

Use
Command: PowerShell -NoHide to see the error message.

I guess in our case it is "-Recurse is no parameter of MOVE" ?


So modify the PoSh command to:

TYPE %L | ForEach{ Move $_ 'F:\tmp\predefined destination' }



- - -
dekiblue wrote:(I actually have to move those files/folders)
Better mention that in first place at your initial post to get the right answer you need. Saves time.
 
dekiblue
Junior Member
Junior Member
Posts: 30
Joined: 2010-09-30, 14:39 UTC

Post by *dekiblue »

Is there a way to move selected files with similar setup to the 1st, 2nd, 3rd.. OR...etc. TAB on the right side?
dekiblue
Junior Member
Junior Member
Posts: 30
Joined: 2010-09-30, 14:39 UTC

Post by *dekiblue »

Thanks man, that worked like a charm. The problem solved by removing -Recourse parameter.

Thank you very much!
Post Reply