the last word

Photography meets digital computer technology. Photography wins -- most of the time.

  • site home
  • blog home
  • galleries
  • contact
  • underwater
  • the bleeding edge
You are here: Home / The Last Word / Automating folder creation

Automating folder creation

September 25, 2012 JimK Leave a Comment

I create the disks I store off-site on a server that has USB-attached boxes that accept bare drives. Whenever I load a brand new disk, I need to create the directory structure the Vice Versa expects. I used to do this manually, which was error-prone and boring. Now I use a script.

If you’re not familiar with scripts, they don’t have to be complicated (although they certainly can be if you want). Windows has an ancient scripting capability that dates back to MS-DOS. There is a more modern scripting language called PowerShell that’s supported by the later Windows OS’s.

The Mac OS X, being Unix with a pretty face, uses the Unix Bourne shell. Apple provides a very nice turorial here.

If you run Linux, you probably know all about shell scripts.

Here’s the script I use to create the directory structure for one of my off-site backup disks on a machine running Windows Server 2008R2:

You can create this file with any text editor that can write unformatted text files. You give it a file extension of .bat, so that the OS knows it’s a sequence of commands, and what language it’s written in. On Mac OS X and Linux machines, the details are different, but the idea is the same.

Here’s what the bat file does.

  1. The first line changes to the H: disk, which is assumed to be freshly formatted.
  2. The “md” (make directory) command creates a bunch of folders.
  3. The “cd” (change directory) changes to one of the newly-created folders.
  4. The next md command makes two more folders in the new directory.
  5. The next cd command changes to one of the new folders.
  6. The next md command creates two more folders in the new directory.

After I run the script, the directory structure on the disk looks like this:

  • Classical
  • Data
  • Desktops
  • …..Honker
  • ……….Desktop
  • ……….Docs
  • …..Alice
  • Goodsync
  • iTunes
  • MP3s
  • Pop1
  • Pop2
  • Programs

 

The Last Word

← GoodSync Keeping track of your backups →

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

March 2023
S M T W T F S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Jan    

Articles

  • About
    • Patents and papers about color
    • Who am I?
  • Good 35-70 MF lens
  • How to…
    • Backing up photographic images
    • How to change email providers
  • Lens screening testing
    • Equipment and Software
    • Examples
      • Bad and OK 200-600 at 600
      • Excellent 180-400 zoom
      • Fair 14-30mm zoom
      • Good 100-200 mm MF zoom
      • Good 100-400 zoom
      • Good 100mm lens on P1 P45+
      • Good 120mm MF lens
      • Good 18mm FF lens
      • Good 24-105 mm FF lens
      • Good 24-70 FF zoom
      • Good 35 mm FF lens
      • Good 60 mm lens on IQ3-100
      • Good 63 mm MF lens
      • Good 65 mm FF lens
      • Good 85 mm FF lens
      • Good and bad 25mm FF lenses
      • Good zoom at 24 mm
      • Marginal 18mm lens
      • Marginal 35mm FF lens
      • Mildly problematic 55 mm FF lens
      • OK 16-35mm zoom
      • OK 60mm lens on P1 P45+
      • OK Sony 600mm f/4
      • Pretty good 16-35 FF zoom
      • Pretty good 90mm FF lens
      • Problematic 400 mm FF lens
      • Tilted 20 mm f/1.8 FF lens
      • Tilted 30 mm MF lens
      • Tilted 50 mm FF lens
      • Two 15mm FF lenses
    • Found a problem – now what?
    • Goals for this test
    • Minimum target distances
      • MFT
      • APS-C
      • Full frame
      • Small medium format
    • Printable Siemens Star targets
    • Target size on sensor
      • MFT
      • APS-C
      • Full frame
      • Small medium format
    • Test instructions — postproduction
    • Test instructions — reading the images
    • Test instructions – capture
    • Theory of the test
    • What’s wrong with conventional lens screening?
  • Previsualization heresy
  • Privacy Policy
  • Recommended photographic web sites
  • Using in-camera histograms for ETTR
    • Acknowledgments
    • Why ETTR?
    • Normal in-camera histograms
    • Image processing for in-camera histograms
    • Making the in-camera histogram closely represent the raw histogram
    • Shortcuts to UniWB
    • Preparing for monitor-based UniWB
    • A one-step UniWB procedure
    • The math behind the one-step method
    • Iteration using Newton’s Method

Category List

Recent Comments

  • JimK on Fujifilm GFX 100S pixel shift, visuals
  • Sarmed Mirza on Fujifilm GFX 100S pixel shift, visuals
  • lancej on Two ways to improve the Q2 handling
  • JimK on Sony 135 STF on GFX-50R, sharpness
  • K on Sony 135 STF on GFX-50R, sharpness
  • Mal Paso on Christmas tree light bokeh with the XCD 38V on the X2D
  • Sebastian on More on tilted adapters
  • JimK on On microlens size in the GFX 100 and GFX 50R/S
  • Kyle Krug on On microlens size in the GFX 100 and GFX 50R/S
  • JimK on Hasselblad X2D electronic shutter scan time

Archives

Copyright © 2023 · Daily Dish Pro On Genesis Framework · WordPress · Log in

Unless otherwise noted, all images copyright Jim Kasson.