Um clique + solução de atalho de teclado:
- Instale o AutoHotKey .
- Crie um script '.ahk a seguir (para carregar automaticamente, adicione-o ao Agendador de tarefas), para criar uma tecla de atalho:
; ########## AutoHotKey symbols: ##########
; ########## ! - Alt; ^ - Ctrl; + - Shift; # - Win ##########
; ########## Shift + Win + p = +#p (order doesn't matter) ##########
+#p::
; Select all
SendInput, ^a
; Copy the select text to the Clipboard.
SendInput, ^c
; Wait for the Clipboard to fill.
ClipWait
; Perform the RegEx find and replace operation,
; where "\projects2016\" is the whole-word we want to replace.
; (backslashes need to be escaped)
haystack := Clipboard
needle := "\projects2016\"
replacement := "\projects2014\"
Clipboard := RegExReplace(haystack, needle, replacement)
ClipWait
; Send (paste) the contents of the new Clipboard.
SendInput, %Clipboard%
; Automatically confirm / change to the new dir
SendInput, {Enter}
return
- Quando o script estiver ativo (ícone verde "H" no systray) e dentro da pasta
c:\projects2016\[projectname], clique no caminho da pasta. - Pressione Shift + Win + p .
Você será redirecionado automaticamente para a sua pasta c:\projects2014\[projectname] . Se você precisa manter o conteúdo da área de transferência, primeiro é necessário atribuí-lo a uma variável e depois colá-la de volta na área de transferência no final do script.