Blue_Skies Posted July 4, 2007 Posted July 4, 2007 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? Quote
cooper Posted July 4, 2007 Posted July 4, 2007 http://www.ericphelps.com/batch/samples/enter.bat.txt Didn't test it to see if it works. Quote
GonZor Posted July 5, 2007 Posted July 5, 2007 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.