[K12OSN] Way off topic - Windows batch file question

Jim Kronebusch jim at winonacotter.org
Mon Jul 11 13:27:27 UTC 2005


> Use the subst command:
> 
>    @echo off
>    rem  Delete previous drive x substitution
>    subst x: /d
>    if not exist h:\nul goto no_h
>    rem  Map the root of h as our new drive x
>    subst x: h:
>    goto doit
>    :no_h
>    if not exist i:\nul goto die
>    rem  Map the root of i as our new drive x
>    subst x: i:
>    goto doit
>    :doit
>    rem
>    rem  Now x is your drive...
>    rem
>    goto done
>    :die
>    echo Whoops!
>    :done
>    exit

Thanks Michael.  The subst command was exactly what I needed.  All I had
to change was to add a trailing \ to the subst x: h:\ in order to tell
it a path to map to.  My backups seem to be working great now.

Thanks Doug.  What you sent wasn't exactly what I needed but I learned
more fun Dos commands.  You can bet I'll find a place to use your first
scripts, or at least a variant of it.

Thanks for helping out with such and obscure topic for this list.


-- 
This message has been scanned for viruses and
dangerous content by the Cotter Technology 
Department, and is believed to be clean.




More information about the K12OSN mailing list