Jump to content

Batch Help.


Blue_Skies
 Share

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
ECHO 2.WinXP
SET /p os=Which OS are you using?

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

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

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

:end
Pause

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.

Guest
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.

 Share

  • Recently Browsing   0 members

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