# Looking for a drive "image" utility...

**URL:** https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453
**Category:** Factual Questions
**Created:** [January 25, 2007, 7:53pm UTC](https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453 "2007-01-25T19:53:15Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Weird\_AL\_Einstein](https://avatars.discourse-cdn.com/v4/letter/w/c67d28/32.png) [@Weird\_AL\_Einstein](https://boards.straightdope.com/u/Weird_AL_Einstein)
#### Post date: [January 25, 2007, 7:53pm UTC](https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453/1 "2007-01-25T19:53:15Z")

</div>

I put the word image in quotation marks because I am not looking for a backup utility, or something to make an “image” of a drive as it’s commonly understood.

What I want is a program where, before I swap a drive out of my USB 2.0 external hard drive enclosure, I can take a “picture” of it. The picture would be like a folder with the entire directory structure of the drive replicated under it, and shortcuts or some sort of placeholders in place of the actual files, with the file names preserved.

I’d like something I could navigate with explorer, or an explorer-like view. I have a program that stores the drive info in a database file, but I’m not too happy with that. On the old Win98 system I used to do a search of the drive and then save the search, but that doesn’t work on Windows XP.

Can anyone help me out?

---

<div class="post-metadata">

### Author: ![Suburban\_Plankton](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/suburban_plankton/32/219_2.png) [@Suburban\_Plankton](https://boards.straightdope.com/u/Suburban_Plankton)
#### Post date: [January 25, 2007, 8:25pm UTC](https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453/2 "2007-01-25T20:25:55Z")

</div>

It sounds like you are looking for [Ghost](http://www.symantec.com/home_homeoffice/products/overview.jsp?pcid=br&pvid=ghost10) , which is now owned by Symantec.

With it, you can save an image of an entire drive (or a specific partition) to a file and use an explorer-like interface to examine the files, and potentially to manipulate the files within the “archive”, depending on your choice of file system. You can also do a disk-to-disk block-level copy, in case you want to move data from an old disk to a newer one.

---

<div class="post-metadata">

### Author: ![Dewey\_Finn](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dewey_finn/32/4222_2.png) [@Dewey\_Finn](https://boards.straightdope.com/u/Dewey_Finn)
#### Post date: [January 25, 2007, 8:27pm UTC](https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453/3 "2007-01-25T20:27:41Z")

</div>

How about this?

From the Start menu, click on Run, enter CMD in the open box and click on OK. You’ll get a black and white command window. Enter DIR c:\*.\* /s \> list.txt. This will take a long time, but will create a text list of all the files on the C: drive.

You don’t get shortcuts, though.

---

<div class="post-metadata">

### Author: ![Weird\_AL\_Einstein](https://avatars.discourse-cdn.com/v4/letter/w/c67d28/32.png) [@Weird\_AL\_Einstein](https://boards.straightdope.com/u/Weird_AL_Einstein)
#### Post date: [January 26, 2007, 7:22pm UTC](https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453/4 "2007-01-26T19:22:41Z")

</div>

**Suburban Plankton** : I went to the site and downloaded the Norton Ghost manual pdf file. If this program has the ability to do what I’m looking for it to do, it’s not in the manual.

**Dewey Finn** : I already have the ability to do that, I’m looking for something that will give me the ability to navigate a copy of the drive in explorer or a similar interface.

So…anyone else? Any ideas?

---

<div class="post-metadata">

### Author: ![SuperNelson](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@SuperNelson](https://boards.straightdope.com/u/SuperNelson)
#### Post date: [January 26, 2007, 8:03pm UTC](https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453/5 "2007-01-26T20:03:57Z")

</div>

Maybe Winzip? The version my IT guys have installed on my XP desktop allows me to create an archive which preserves the directory structure. I can then navigate within that structure from Windows Explorer. I use it for a backup utility, and have been able to use this function to selectively retrieve files from my backup. Looks like I’ve got version 9.0 SR-1, for what it’s worth.

---

<div class="post-metadata">

### Author: ![Dewey\_Finn](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dewey_finn/32/4222_2.png) [@Dewey\_Finn](https://boards.straightdope.com/u/Dewey_Finn)
#### Post date: [January 26, 2007, 8:21pm UTC](https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453/6 "2007-01-26T20:21:50Z")

</div>

Once you’ve captured an image using Symantec Ghost, you can browse through the file contents in a program called Ghost Explorer.

---

<div class="post-metadata">

### Author: ![Number](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/number/32/242_2.png) [@Number](https://boards.straightdope.com/u/Number)
#### Post date: [January 27, 2007, 3:57pm UTC](https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453/7 "2007-01-27T15:57:48Z")

</div>

Copying the folder structure is easy. Running the command **xcopy E:\ C:\EDrive\ /T /E** will replicate all the folders of E: under the directory C:\EDrive, for instance.

Making shortcuts of all the files is a lot trickier. I will see if there’s a good way to do it with a script.

Googling **drive catalog software** turns up lots of shareware programs which might do what you want. I haven’t tried any, so I can’t make any particular recommendations.

---

<div class="post-metadata">

### Author: ![Number](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/number/32/242_2.png) [@Number](https://boards.straightdope.com/u/Number)
#### Post date: [January 27, 2007, 5:10pm UTC](https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453/8 "2007-01-27T17:10:04Z")

</div>

Ok, don’t buy anything. I think I just figured it out.

Paste the code below into a text file with a .cmd extension. Customize the values of the SourceDrive variable with the drive you want to catalog. Customize the value of the DestDir variable with the location you want to save the catalog.

Double-clicking the .cmd file will then re-create the directory structure of the SourceDrive under the DestDir folder. It will create a blank 1k text file as a placeholder for each file in the tree. They will look like real files but they contain no data.

```auto

@echo off
setlocal

REM The root of the drive to catalog.
set SourceDrive=E:\

REM The location to create the catalog.
set DestDir=C:\EDrive

REM Creates the directory structure.
xcopy %sourcedrive% "%destdir%\" /C /H /T /E /Y

REM Loops through each folder and creates a text file in the catalog
REM for each file in the source drive.
for /R %sourcedrive% %%G in (*.*) do call :_process "%%G"

goto :_end

:_process
echo. > "%destdir%%~p1%~n1%~x1"
goto :eof

:_end
endlocal

```

---

<div class="post-metadata">

### Author: ![Weird\_AL\_Einstein](https://avatars.discourse-cdn.com/v4/letter/w/c67d28/32.png) [@Weird\_AL\_Einstein](https://boards.straightdope.com/u/Weird_AL_Einstein)
#### Post date: [March 26, 2007, 7:50pm UTC](https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453/9 "2007-03-26T19:50:33Z")

</div>

Let me just offer my belated thanks to this thread’s posters, especially to **Number**. As it turns out I managed to find a software program, but I may yet use this technique.

---

<div class="post-metadata">

### Author: ![Number](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/number/32/242_2.png) [@Number](https://boards.straightdope.com/u/Number)
#### Post date: [March 26, 2007, 10:50pm UTC](https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453/10 "2007-03-26T22:50:54Z")

</div>

Ok, I guess I will take back all the snarky things I’ve been muttering under my breath for the last two months. I’m glad you found a solution that worked.

Also, if anyone does use my script, be absolutely sure that the DestDir location does not already contain any valid files. They could get overwritten or corrupted.

---

<div class="post-metadata">

### Author: ![Weird\_AL\_Einstein](https://avatars.discourse-cdn.com/v4/letter/w/c67d28/32.png) [@Weird\_AL\_Einstein](https://boards.straightdope.com/u/Weird_AL_Einstein)
#### Post date: [March 27, 2007, 5:47pm UTC](https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453/11 "2007-03-27T17:47:33Z")

</div>

Don’t feel too bad about that, I’d say my failure to acknowledge posters’ attempts to help me out here is a breach of message board etiquette. When I found the program I mentioned, I just forgot about this thread.

I have to say, I’m curious about this code. I used to make .bat files (I tried to think of a way to do what I wanted with one, but I couldn’t), but it’s been a long time. I’ve never seen this “.cmd” extension, and I don’t recognize some of these commands.

---

<div class="post-metadata">

### Author: ![Number](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/number/32/242_2.png) [@Number](https://boards.straightdope.com/u/Number)
#### Post date: [March 27, 2007, 7:13pm UTC](https://boards.straightdope.com/t/looking-for-a-drive-image-utility/389453/12 "2007-03-27T19:13:43Z")

</div>

.bat files were shell scripts for the DOS/Win9x command interpreter, [command.com](http://command.com). .cmd files are the equivalent for the NT command interpreter, cmd.exe. You can still use the .bat extension and it will work just fine. It’s more of a style choice at this point.

There are two big keys to this particular script. One is the [FOR command](http://www.ss64.com/nt/for.html). This is a good one to learn about, as you can do just about anything with it.

> [@](#):
>
> for /R %sourcedrive% %%G in (_._) do call :\_process “%%G”

This recursively loops through every folder under the drive in the **%sourcedrive%** variable (\*_E:\*_ here). For every file it finds (hence the _ **.** _), it puts the full filename into the variable **%%G**. It then calls the **:\_process** subroutine using that filename as an argument. So, for example, for the file **E:\Folder1\foo.jpg** it does **call :\_process “E:\Folder1\foo.jpg”**

> [@](#):
>
> echo. \> “%destdir%%~p1%~n1%~x1”

**:\_process** contains a couple of tricks. First it uses the **echo.** command to generate a single blank line. This blank line is [redirected](http://www.ss64.com/ntsyntax/redirection.html) into a text file using the **\>** symbol. The location of the text file starts with the **%destdir%** variable ( **C:\EDrive** ). The rest is dynamically generated by taking the filename passed from the **FOR** command and extracting the path ( **%~p1** becomes **\Folder1\*\*), filename (**%~n1\*\* becomes **foo** ), and extension ( **%~x1** becomes **.jpg** ) using [parameters](http://www.ss64.com/ntsyntax/parameters.html). Thus for each file in the SourcePath you get a text file containing a single blank line in an analguous location in the DestDir.

Does that help at all?
