I'm trying to decide whether to dispense with choice.com and use set /p in my batch files. The latter doesn't work with pre-xp.
Announcement
Collapse
No announcement yet.
What operating system do you use for Civ2?
Collapse
X
-
What operating system do you use for Civ2?
25Win XP or later84.00%21Win 98 or earlier12.00%3What's an operating system?4.00%1What's Civ2?0.00%0Tags: None
-
I think you can leave it out, but why would you? It only takes 11,9kb, which is a mouse fart compared to the other files in the zip
-
Good point.
Still, I'm leaning toward replacing choice.com with a vbs script with a yes/no dialog.
Comment
-
You should check out Mercator's post in this thread at CFC. It doesn't have to be either/or.
Comment
-
If I understand this one of Mercator's posts, then I would still need to have choice.com in the zip. His batch simply checks for the OS before branching to one of two parallel question routines: one with choice.com and the other with set /p. It's elegant, but it still requires choice.com
Wouldn't it work to just have a vbs with a yes/no question that conditionally calls a batch file that does the copying? Here's a screenie of a script that works on my PC, but I haven't tested it very thoroughly. If I were more industrious, I'd port all the copy routines from the bat to the vbs, but then there's a lot I'd do if I were more industrious.
Comment
-
Originally posted by Boco
If I understand this one of Mercator's posts, then I would still need to have choice.com in the zip. His batch simply checks for the OS before branching to one of two parallel question routines: one with choice.com and the other with set /p. It's elegant, but it still requires choice.com
What would be the point of using the script at all if it still required choice.com? Windows 9x doesn't require choice.com. The choice command step is skipped by NT-based systems. That's what makes it elegant.
Comment
-
Originally posted by Catfish
Well let's hope he doesn't see this one.
Well, since I've gone this far, I might as well go further.
Originally posted by Catfish
Windows 9x doesn't require choice.com.
Here's a snippet of Merc's batch file. With some added comments, displaying my (mis?)understanding.
Originally posted by Mercator
For the technically inclined: You can achieve the same thing as choice.com if you use SET /P instead. This works only on Windows NT/2000/XP. If you use this construct you avoid having to include choice.com with your scenario. You could do something like this in your batch file:
(...)
if "%OS%"=="Windows_NT" goto WinNT
REM by Boco — branch here if OS is Win98, right?
choice /c:123 Please choose an option
if errorlevel 3 goto end
if errorlevel 2 goto something_else
if errorlevel 1 goto something
:WinNT
REM by Boco — branch here if OS is WinNT, WinXP, right?
set /p choice=Please choose an option (1,2,3):
if %choice%==1 goto something
if %choice%==2 goto something_else
if %choice%==3 goto end
cls
echo Your choice was invalid. Enter a number from 1 to 3.
(...)Last edited by Boco; January 27, 2007, 08:32.
Comment
-
An alternative?
It looks like vbs can do the whole business without a bat file. My Anti-Virus (Norton) gives me a warning when I run a vbs, but still allows me to run it. Does anyone have the Windows Scripting Host completely disabled?
Comment
-
Originally posted by Boco
Many sites suggest that Win9x doesn't support set/p (e.g. ComputerHope.com).
Originally posted by Boco
Wasn't Choice.com packaged with W9x?
Comment
-
Originally posted by Mercator
What Catfish meant with "doesn't require" was that Win98 users don't require scenarios to include choice.com, because they'll already have it.
Originally posted by Mercator
So your comments on my example batch file are correct. choice.com is used for Win98 etc. and set /p for Win XP etc.
VBSript (javascript works too) is definitely an option, though people will definitely see security warnings. If those yes/no dialog boxes turn out to be a bit cumbersome, you could even create an html page with a script, using an html form, I think. But that will most likely have even more security limitations.
We'll see how the vbs script flies.
Comment
-
Originally posted by Boco
Thanks for the PM, Merc. I'm assuming you chose that route due to your ban rather than reclusiveness. If not, flame me via PM, and I'll stop.
But it so happens that I succesfully defended my Master's thesis yesterday, so I'm a free man again. Though I suppose that means I've just turned from lazy student into jobless bum.
Comment
-
I remember the transition when I finished my Master's; your next step is lazy employed bum followed by retirement 40 years later
Comment
-
But it so happens that I succesfully defended my Master's thesis yesterday, so I'm a free man again. Though I suppose that means I've just turned from lazy student into jobless bum.
2. Nah! Graduate degrees plus $1.50 get you a cup of coffe any day of the week. Trust me on that.
3.Excerpts from the Manual of the Civilization Fanatic :
Money can buy happiness, just raise the luxury rate to 50%.
Money is not the root of all evil, it is the root of great empires.
Comment
-
Mercator....I think I remember that name from somewhere long ago.
Congrats Master Bum.Cheaper coffee it doesn't get, but it really can help the job hunt. Good luck!
What was your thesis title?
Comment
-
Thanks all... I don't really like coffee, though. Is that going to be a problem?
Originally posted by fairline
I remember the transition when I finished my Master's; your next step is lazy employed bum followed by retirement 40 years later
Originally posted by Boco
Mercator....I think I remember that name from somewhere long ago.
What was your thesis title?And inspired by spending too much time on Apolyton, of course (the subject, not the title).
Comment
Comment