I have a lot of files (100s of gb) and I want to give some of them to my friend. But he must select, which files he needs and I can't give him all files at once (I have no such big usb flash or usb hdd). I can make a list of all files and transfer them on small usb flash to him, and then he can say, which folders he want and which not.

How should I make the list of files, which can be easily viewed in standard windows xp install or with some small WindowsExplorer-like program? I can do an ls -lR-like listing and store it in txt, but it will be hard to my friend to view this list. There is a diskdir plugin of Total Commander, which can archive folder into text file with only names and paths of files stored. Then this plugin allow total commander to move inside this archive like inside the zip or arj. But I think, total commander is to difficult to use to my friend, so I'm asking about Windows Explorer-like solution (e.g. winzip allows Explorer to move inside zip archives, and I want something like).

So. I can install any program, also I can store viewer program with file list on usb flash.

link|improve this question

80% accept rate
1  
It sounds like what you're wanting is a duplicate of the file structure, but instead of the actual date in the files, just have the file names as dummy files so your friend can navigate the structure to tell you what he wants, is that a correct understanding of the request? – Matrix Mole Jul 27 '11 at 0:02
yes, you are right, Matrix – osgx Jul 27 '11 at 19:10
if you have access to powershell, I can toss together a script to do this for you – Matrix Mole Jul 27 '11 at 20:34
I have access to bash (windows version). What can be an main idea? There is no powershell on my friend's computer. – osgx Jul 27 '11 at 20:42
1  
was considering a script that could recreate the directory structure just as you were asking, powershell wouldn't need to be on friends PC since the directory structure would be merely directories and empty text files with file names. – Matrix Mole Jul 27 '11 at 21:02
feedback

3 Answers

up vote 1 down vote accepted

Assuming you can get powershell v2 installed on your local machine (or already have it installed) the following script can do what you're after (it might work in powershell v1, not certain):

$dupedir = "D:\Backup"
$newdir = "C:\Temp"
$dupelist = Get-ChildItem -Force -Recurse -ErrorAction SilentlyContinue $dupedir

foreach ($item in $dupelist) 
{
    If ($item -is [Io.DirectoryInfo])
    {
        $itemtype = "directory"
    }
    If ($item -is [Io.FileInfo])
    {
        $itemtype = "file"
    }

    New-Item -Force -type $itemtype -Path $item.FullName.Replace("$dupedir","$newdir")
}

Change the path for $dupedir to the root of the path you want to let your friend know about. Once this script finishes running, you should have an exact mirror of the filestructure (but not actual files) you want to let your friend look over in C:\Temp (or somewhere else if you change the directory for the $newdir variable as well. Don't have the $newdir variable be inside the directory of the $dupedir variable or you will get infinite recursion which could eventually consume all disk space (even if the "files" are 0 byte files).

Nice thing about powershell is that you can "write" scripts at the commandline (similar to bash). Copy the code into a text editor, make the path changes, then copy and past the whole thing into your powershell window and it'll do it's magic.

I know you mentioned you have bash, and if you wanted this on a unix/linux machine I might have been able to do it in bash. Unfortunately I was never very good with bash scripting when it required monkeying around with the windows filesystem.

link|improve this answer
Not for powershell, but for idea of recreating all files with same paths and names but 0 sized. – osgx Aug 5 '11 at 18:05
feedback

Just use the dir /s > C:\temp\filename.txt command. This will output the directory structure to the file C:\temp\filename.txt. Start in the location you want to go down from.

Then just send him the TXT file.

link|improve this answer
The txt is hard to navigate. – osgx Jul 27 '11 at 19:10
In what way is it hard to navigate? Maybe try "dir /s /b > C:\temp\filename.txt". (adding the /b to strip out most of the extras. – KCotreau Jul 27 '11 at 19:24
The list is 4 megabyte long. But the files are organized in folders, in several layers. I want to show to my friend the folders, but he can be interested in some folders content (see subfolders, subsubfolders and names of files inside some subfolders). – osgx Jul 27 '11 at 20:41
I ran that command from the root of the C-drive. I suggest you run it from only the location(s) in question, like where your "My Documents" is located, for example. If you add /ad to the command, it will give you only directories. There is no easy way to pick only the files you want off a drive with one command. You may have to run several from different locations, maybe with different switches depending on what you want. – KCotreau Jul 27 '11 at 20:51
I think, the matrix's "directory structure would be merely directories and empty text files with file names." will be better – osgx Jul 27 '11 at 21:13
feedback

Why not use a zip file? You can view all the files in one window, yet have them extract to different folders.

link|improve this answer
I cant send all files even in paked form, they are too big. I want only to send file names in tree-like manner. – osgx Jul 27 '11 at 19:11
Can I create a zip with all directories, and files, but without file content (0-byte files in the zip) – osgx Jul 27 '11 at 21:14
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.