JayDogg Posted June 3, 2008 Posted June 3, 2008 Ok so I want to write a batch file we can call it setup.bat that when ran asks you to chose by typing from 8 listed options lets say Option 1 is install and option 2 is move option 3 is copy and so on so if you want to run option 1 you would type install, now each of these options is going to be its own batch file that the setup.bat will start (I think call is the right term) so when you type install it starts or calls the install.bat I have made, then I need the setup.bat to pause or wait well the install.bat runs. When the install.bat is done running I then need the setup.bat to ask you if you would like to pick any other option or finish, by typing finish it will then run a cleanup.bat. I have made all the option batch files and cleanup batch file which are mostly just a few lines of code like xcopy "C:\install.bat" "C:\Program Files\Pirates" /ydel /q/f "C:\install.bat"which is all very simpale so I need help with the setup batch file cause Im very new to this so if any one knows how to do all that please explain in detail how thanks
Yzöwl Posted June 3, 2008 Posted June 3, 2008 First thing we need to know is what Operating System is this for?You are using a bat suffix so I'd assume your using Win9x/ME but as you're new to all this that's probably not the case.Also, if you put the individual files into a compressed archive and post them too it would certainly help fix all of the problems which may be caused by those too!
jaclaz Posted June 3, 2008 Posted June 3, 2008 (edited) Maybe you could have a look at this app:Wizard's Apprenticehttp://wizapp.sourceforge.net/Using it and the given examples it is pretty straightforward to do what you want to do, it is also a bit nicer than a "pure" .bat or .cmd file, and will work on both 9x/Me and NT/2K/XP/2003.jaclaz Edited June 3, 2008 by jaclaz
JayDogg Posted June 3, 2008 Author Posted June 3, 2008 Im making these batch files for Windows XP sorry about that
JayDogg Posted June 3, 2008 Author Posted June 3, 2008 Jaclaz the program Wizard's Apprentice looks really cool and if you would like to help walk me through how to make it to make what I need that would be great but if not I think that program is a bit much for me being a newbie and all
Smiley357 Posted June 3, 2008 Posted June 3, 2008 You might want to check out AutoIt (http://www.autoitscript.com/) Its free and very easy to use. There are examples you can view to learn from. If you want to stick with command line and use a bat file or cmd file for XP. Then you can start out with this.Echo 1. Install Echo 2. Move Echo 3. Copy Echo 4. QUIT PROGRAM Echo.Echo.SET /P choice=Type In Your Reply Then Press Enter ^>IF "%choice%"=="1" (GOTO ONE)IF "%choice%"=="2" (GOTO TWO)IF "%choice%"=="3" (GOTO THREE)IF "%choice%"=="4" (GOTO QUIT) ELSE (GOTO ERROR)
jaclaz Posted June 3, 2008 Posted June 3, 2008 (edited) @JayDoggAs said the best example comes within the download as wainstall.bat, but you may also get this little script I wrote some time ago:http://home.graffiti.net/jaclaz:graffiti.n...ts/VDM/vdm.htmland this one:http://home.graffiti.net/jaclaz:graffiti.net/http://home.graffiti.net/jaclaz:graffiti.n...X/mbrfix0.2.zipExpecially the second one is rather straightforward and both are (well )) commented, you need a really basic batch commands knowledge to copy and paste bits and pieces and assemble your own routine.The basic "choice" menu Smiley357 posted would become using Wizapp something like this::p:: We set the page variable to be able to return here:: after a Cancel request.set page=:pset watitle=%mytitle%set watext=%mytext%~~Please choose one of the following set watext=%watext%~Make your selection and press the [Next] buttonset watext=%watext%~(you can use numerical keypad)set wafile=set walistsep=;set wainput=^&0. Install;^&1. Move;^&2. Copy;^&3. QUIT PROGRAMset waoutnum=set waoutput=set wasig=%mysig%start /w wizapp NOBACK RBif errorlevel 2 goto :cancel:: no Back possiblecall %wabat%set choice=%waoutnum%If NOT DEFINED waoutnum goto :errorIF %choice%==0 GOTO :ZEROIF %choice%==1 GOTO :ONEIF %choice%==2 GOTO :TWOIF %choice%==3 GOTO :THREEThen choices would be something like::ZEROStart /w install.cmdGOTO :EOF:ONEmove.cmdGOTO :EOF:TWOCALL copy.cmdGOTO :EOF:THREEGOTO :EOF(just examples, of course, showing different ways to invoke another batch file)jaclaz Edited June 3, 2008 by jaclaz
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now