Jump to content

Batch Help.


Recommended Posts

Hi all.  I'm learning batch and I'm trying to write a batch file with an option to be able to switch from a 98 directory structure to a XP structure  using a menu option.  I'm using this to archive my docs on my  on a removable drive and I want to create one batch, when run, that asks me what OS is it running on and xcopies the right directories when the correct OS is selected.  I have the xcopy down for 98 and XP, but I have no idea how -or if- you can have a menu to form one batch file.  Any ideas?

Link to comment
Share on other sites

If "set /p" works in 98 you could use...

@ECHO off
ECHO 1.Win98
SET /p os=Which OS are you using?

IF '%os%'=='1' GOTO Win98
IF '%os%'=='2' GOTO WinXP

ECHO You selected Windows 98
::Win98 XCOPY goes here
GOTO end

ECHO You selected Windows XP
::WinXP XCOPY goes here
GOTO end


Although I am not sure if set /p works in Win98

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...