move files to specific directory
Moderators: white, Hacker, petermad, Stefan2
move files to specific directory
I have read a post a long time ago with the solution of this problem but now I can't find it via search
All I want to do is assign a keyboard shortcut to a macro that would move all selected items of the active panel to a predefined directory (e.g C:\aatemp)
I don't want any verification window or overwrite warning. I only want once the shortcut is pressed, all selected items to be moved to that folder.
Any idea?
All I want to do is assign a keyboard shortcut to a macro that would move all selected items of the active panel to a predefined directory (e.g C:\aatemp)
I don't want any verification window or overwrite warning. I only want once the shortcut is pressed, all selected items to be moved to that folder.
Any idea?
Solution:
a batch (movv.bat):
placed in the path (e.g %windir%)
and a button
command: %comspec% /c movv.bat
Parameter: %L
should work. But just test, because move /y moves - as desired - without confirmation.
I does not move hidden or system files. That would require another line in the batch to clear those flags for the files.
sheepdog
a batch (movv.bat):
Code: Select all
for /f "delims=" %%a in (%1) do echo move /y "%%a" C:\aatemp
and a button
command: %comspec% /c movv.bat
Parameter: %L
should work. But just test, because move /y moves - as desired - without confirmation.
I does not move hidden or system files. That would require another line in the batch to clear those flags for the files.
sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
Thanks for the answer.
Dont close the topic cause I can't make it work on XP!:O
I used the solution suggested in the topic:http://ghisler.ch/board/viewtopic.php?t=464
Command: cmd /c
Parameters:
for /f "delims=" %%f in (%L) do move "%%f" "e:\__aatemp"
It does not work:O
I am trying your solution now:[
Dont close the topic cause I can't make it work on XP!:O
I used the solution suggested in the topic:http://ghisler.ch/board/viewtopic.php?t=464
Command: cmd /c
Parameters:
for /f "delims=" %%f in (%L) do move "%%f" "e:\__aatemp"
It does not work:O
I am trying your solution now:[
grrrrrr
movv.bat: (in windows dir)
Custom menu entry:
command:
parameters
The error I get is:
Where does the "C:\Documents" comes from???
There is no panel that targets "C:\Documents" and in fact there is no folder named "C:\Documents". Of course there is the folder "Documents and Settings" which btw I never use.
I am not working in C drive either :O
I am missing something here
movv.bat: (in windows dir)
Code: Select all
for /f "delims=" %%a in (%1) do move /y "%%a" E:\
pause
command:
Code: Select all
%comspec% /c movv.bat
Code: Select all
%L
Code: Select all
> for /F "delims=" %a in (C:\Documents) do move /y "%a" E:\
The system cannot find the file C:\Documents.
> pause
Press any key to continue . . .
There is no panel that targets "C:\Documents" and in fact there is no folder named "C:\Documents". Of course there is the folder "Documents and Settings" which btw I never use.
I am not working in C drive either :O
I am missing something here
Thanks hacker..
I had to add the usebackq option too so no batch file is needed in %windir%.
Fixed as follows (demo code, menu entry):
The problem is that this code does not work with folders because TC addes a backslash at the end of the folder name but move command does not accept such syntax.
Any idea appreciated:O
I had to add the usebackq option too so no batch file is needed in %windir%.
Fixed as follows (demo code, menu entry):
Code: Select all
cmd /k
for /F "usebackq" %%a in ("%L") do echo move %%a S:\target\folder && pause
Any idea appreciated:O
- XPEHOPE3KA
- Power Member
- Posts: 854
- Joined: 2006-03-03, 18:23 UTC
- Location: Saint-Petersburg, Russia
The problem is that your temp-directory has at least one space in it's name (what mine hasn't - thus this problem did not occur herel).
So you'll have to ask the Operating System polite to consider converting the given path to the temp file to a short name. That can be done with inserting "~s" in the right place.
Just try please:
So you'll have to ask the Operating System polite to consider converting the given path to the temp file to a short name. That can be done with inserting "~s" in the right place.
Just try please:
sheepdogfor /f "delims=" %%a in (%~s1) do move /y "%%a" "E:\target dir"
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
Sheepdog, I solved that by adding quotes to %L as Hacker suggested. It works fine as far as folders are not selected. If I use short names, folders will still be a problem right?
As far as I can understand, the only solution for folders is to use lst2str but I do not want to add dependencies on external programs. I generally avoid using any kind of plugin unless absolutely necessary.
The ideal solution would be a cm_RenMov command that would support a parameter as a "default target directory" eg:
That would be nice as the use of move would be avoided and I wouldn't have to face problems that might occur in case of hidden or system files.
As far as I can understand, the only solution for folders is to use lst2str but I do not want to add dependencies on external programs. I generally avoid using any kind of plugin unless absolutely necessary.
The ideal solution would be a cm_RenMov command that would support a parameter as a "default target directory" eg:
Code: Select all
Command: cmRenMov
Parameters: E\__aatemp