I think something like this could be used:
=============================
IF EXIST c:\windows GOTO os_win9x
IF EXIST c:\winnt GOTO os_nt
.
REM This is where you catch an unknown system
.
ECHO system unknown
GOTO the_end
:os_win9x
.
. (Your win9x actions here)
.
.
GOTO the_end
:os_nt
.
. (your nt/W2K actions here)
.
:the_end
=================================
The only drawback here is that your systems have to be located on the C: drive and the folders be named "windows" and "winnt". If they are not, then you have to extend the IFs to accomodate for other possible locations/names. Do some experimenting and you'll probably figure it out. It IS possible to fetch this information in the registry found in newer Windows versions (Win95->), but it'll complicate matter significantly - keep it simple if possible...
Another thing that may help you is that you can call other bat-files with a simple "CALL bat-file-name" (using path to the file) - the "subroutines/procedures" of bat-files. Program control will transfer to the bat-file in question and return to the original bat-file once execution of the instructions in the alternate bat-file has completed - this opens up some posibilities....
Last edited by kallikru; September 23rd, 2002 at 04:10 PM.
Karl, Denmark
---------
"..and may The Force be with you - too..."