Load Selection from file (copy)

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
omdawe
Member
Member
Posts: 109
Joined: 2009-01-28, 06:36 UTC

Load Selection from file (copy)

Post by *omdawe »

I like the idea of "Save Selection to a File" in TC.

But i would like it even better if it was more flexible.

The downside with this function that it only works in one folder.

I like save/make a file and then "Load Selection from a File" from multiple folders or even multiple hard drives.

And the selection comes up as they where in one folder/list!

So i can deselected also.

If this is not possible i would like to get some ideas how i can easy copy from a list like that!
User avatar
nsp
Power Member
Power Member
Posts: 1933
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Load Selection from file (copy)

Post by *nsp »

omdawe wrote: If this is not possible i would like to get some ideas how i can easy copy from a list like that!
I can suggest you for this kind of list manipulation to use virtualpanel plugin.. This is not selection list, but a very elegant way to manage list of file across drive, folder, ... with tons of feature.
User avatar
omdawe
Member
Member
Posts: 109
Joined: 2009-01-28, 06:36 UTC

Post by *omdawe »

Tanx "NSP" i will have a look at it later.

Right now im looking in to do a VBS script.

Its not going very well for now. First script and all. But it looks like the only way to load from a "list.txt" file and then with a copy function to a specific drive.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Similiar to Get List Of Files?, you can copy the list of selected files to a single file:

Code: Select all

TOTALCMD#BAR#DATA 
cmd.exe /k COPY 
"%L" "_TCFileList.txt" 
wcmIcons.dll,11 



-1
Which will copy the selected files to "_TCFileList.txt" in the current Root path. Root Path is relevant, as you may have subDirBranch View enabled.

Then you could have another button for example:

Code: Select all

TOTALCMD#BAR#DATA
cmd.exe /k TCCopyList.cmd
?%T
wcmIcons.dll,45



-1

Code: Select all

:: 
::  TCCopyList.cmd
::
:: Parse a _TCFileList.txt file and COPY to Param1
::
SET targetPath="%~1"
IF "%targetPath:~-2,1%" NEQ "\" SET targetPath="%~1\"
FOR /F "usebackq delims=*" %%F IN ("_TCFileList.txt") DO CALL:COPY2Target %targetPath% "%%~F" "%%~nF" "%%~xF" 
GOTO:EOF
:COPY2Target
SET postFix=1
SET targetFile="%~1%~3%~4"
:RenameTarget
IF EXIST "%targetFile%" SET /A postFix=%postFix% + 1&&SET targetFile="%~1%~3 (%postFix%)%~4"
IF EXIST %targetFile% GOTO:RenameTarget
COPY "%~2" %targetFile%
This code renames the targetFile if it already exists, appending "(#)" to the fileName. As the copy in question above will dump all the files into the same targetDir.

You could also make the initial fileList copied to the target panel instead:

Code: Select all

TOTALCMD#BAR#DATA
cmd.exe /k COPY
"%L" "%T_TCFileList.txt"
wcmIcons.dll,11



-1
User avatar
omdawe
Member
Member
Posts: 109
Joined: 2009-01-28, 06:36 UTC

Post by *omdawe »

Tanx for the response!
I will have a look at your extended answer later.
I made a small hack my self instead using a .VBS script

Code: Select all

Set fList = CreateObject("Scripting.FileSystemObject").OpenTextFile("list.txt")
Set dest = CreateObject("Shell.Application") _
  .BrowseForFolder(0, "Destination Selection", &H51)
Do Until fList.AtEndOfStream
  dest.CopyHere Trim(fList.ReadLine), 16
Loop
This load the list of files from a "list.txt" in the same folder as the "copy.vbs" file and with a little pop-up window i select destination folder.

Maybe not the best way, But it works.
Post Reply