MSFN Forum: How to use Choice.com in Unattended Setup? - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to use Choice.com in Unattended Setup? It warns because it's 16-bit command... Rate Topic: -----

#1 User is offline   spacesurfer 

  • Pharmassist
  • Group: Patrons
  • Posts: 1,668
  • Joined: 31-July 04
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 29 August 2006 - 06:32 PM

I'm trying to use the choice command is a batch file so I can choose whether to install a particular program.

However, it when it gets to that part of batch file, a dialog warning pops up telling me to close or ignore. It doesn't mention the command name but mentions the path to cmd.exe and some other file.

Anyway, I choose ignore but choice.com doesn't work. It installs the program without my input.

Is there a similar program that I can use to stop and ask if I want to install a program or not?

Here's my choice script:

ECHO   Do you want to install Program?
ECHO		(Password required)
ECHO.
ECHO	1. Install Program
ECHO.
ECHO	2. Skip installation
ECHO.
ECHO.
CHOICE /C:12 /N Please choose a menu option (1 or 2): 
IF ERRORLEVEL == 2 GOTO END
IF ERRORLEVEL == 1 GOTO INSTALL

:INSTALL
"%cddrive%\Programs\program.exe"

:END



#2 User is offline   jdoe 

  • Advanced Member
  • PipPipPip
  • Group: Banned
  • Posts: 314
  • Joined: 02-May 04

Posted 29 August 2006 - 07:13 PM

With Windows XP you don't need choice.com anymore. Search this forum or the web for the SET /P command. I'm sure you'll find what you need with full of examples.

:hello:

#3 User is offline   LLXX 

  • MSFN Junkie
  • PipPipPipPipPipPipPipPipPip
  • Group: Banned
  • Posts: 3,399
  • Joined: 04-December 05

Posted 29 August 2006 - 08:03 PM

Is that this error message? http://support.microsoft.com/default.aspx?...kb;en-us;324767

It would help if you provided more information about the message.

#4 User is offline   spacesurfer 

  • Pharmassist
  • Group: Patrons
  • Posts: 1,668
  • Joined: 31-July 04
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 30 August 2006 - 06:37 AM

LLXX. That's exactly what it was. Thanks for MS link.

I'll try the set /p method first that someone above you mentioned.

#5 User is offline   LLXX 

  • MSFN Junkie
  • PipPipPipPipPipPipPipPipPip
  • Group: Banned
  • Posts: 3,399
  • Joined: 04-December 05

Posted 30 August 2006 - 03:15 PM

Also you should note that there is no separate choice.com file, the CHOICE command is built into the command shell (cmd.exe) on XP.

#6 User is offline   spacesurfer 

  • Pharmassist
  • Group: Patrons
  • Posts: 1,668
  • Joined: 31-July 04
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 30 August 2006 - 04:08 PM

Is that right? I've been using the choice.com from DOS. I'll give it a try.

set /p works, however, you pointed me to a problem i may have with corrupted/missing config.nt or autoexec.nt.

#7 User is offline   spacesurfer 

  • Pharmassist
  • Group: Patrons
  • Posts: 1,668
  • Joined: 31-July 04
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 30 August 2006 - 05:51 PM

well, that didn't work. it said choice is not recognized as an internal or external command or something like that.

#8 User is offline   Aegis 

  • MSFN Expert
  • PipPipPipPipPipPip
  • Group: Banned
  • Posts: 1,298
  • Joined: 12-March 05

Posted 30 August 2006 - 06:29 PM

I modified it a bit:

ECHO   Do you want to install Program?
ECHO		(Password required)
ECHO.
ECHO	1. Install Program
ECHO.
ECHO	2. Skip installation
ECHO.
ECHO.
SET /P NewVar= Please choose a menu option (1 or 2)
IF NewVar == 2 GOTO END
IF NewVar == 1 GOTO INSTALL

:INSTALL
"%cddrive%\Programs\program.exe"

:END

This post has been edited by Aegis: 30 August 2006 - 06:30 PM


#9 User is offline   spacesurfer 

  • Pharmassist
  • Group: Patrons
  • Posts: 1,668
  • Joined: 31-July 04
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 30 August 2006 - 07:12 PM

Aegis, what I meant was that choice method did not work--it doesn't seem to be built-in as LLXX mentioned, unless there is some other way to call it.

I got the set /p command to work just like you showed.

Thanks.

#10 User is offline   Aegis 

  • MSFN Expert
  • PipPipPipPipPipPip
  • Group: Banned
  • Posts: 1,298
  • Joined: 12-March 05

Posted 30 August 2006 - 07:59 PM

;)

Attached File(s)

  • Attached File  choice.7z (13.81K)
    Number of downloads: 21


#11 User is offline   mazin 

  • MSFN Addict
  • Group: Supreme Sponsor
  • Posts: 1,952
  • Joined: 12-January 04

Posted 31 August 2006 - 01:37 AM

View PostLLXX, on Aug 31 2006, 12:15 AM, said:

Also you should note that there is no separate choice.com file, the CHOICE command is built into the command shell (cmd.exe) on XP.

Nope. It's not an internal command of cmd.exe. It does not exist on a Win-XP CD. You add it yourself.

However, I did some attempts in the past to run it on XP.
It works when explorer shell is loaded. There's a mess with the order of GOTO or SET under XP.

SET /P is good enough. The only problem is taht there's no default answer that could be set after some designated time.

@ spacesurfer

You can use an application installer like W.A.I.T. or KTOOL. There are may apps for this purpose, however.

This post has been edited by mazin: 31 August 2006 - 02:50 AM


#12 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 9,114
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 31 August 2006 - 05:42 AM

Yes, there is no way to use set /P with a default timeout selection.
There are workarounds, see these:
http://www.robvander...com/choice.html
(using kixstart)
or you can use CHOIX.COM, part of Horst Schaeffer utilities:
ftp://ftp.sac.sk/pub...ask/horst31.zip
or the choice.exe that comes with the NT4 or 2000 Resource kit:
http://www.ss64.com/nt/choice.html
here you can get it as a single file:
http://www.petri.co....eskit_tools.htm
http://www.dynawell....2000/choice.zip
(21 kb download)

Also, LLXX is "partially" right, starting with Server 2003 (not XP) CHOICE is in the OS not in the RK.

jaclaz

#13 User is offline   mazin 

  • MSFN Addict
  • Group: Supreme Sponsor
  • Posts: 1,952
  • Joined: 12-January 04

Posted 31 August 2006 - 07:40 AM

I'm sorry, jaclaz, to ask this. But, is one of those CHOICE.XXX supposed to work under XP?

#14 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,020
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 31 August 2006 - 11:50 AM

Here is a way to use a batch with a menu selection

Quote

@Echo Off

:Main
CLS
Color f3
Mode 55,12
Title CMD_Menu_Template
Echo.
Echo	Type Yes  To do something
Echo.
Echo	Type No   For something else
Echo.
Echo	Type Ok   For another option
Echo.
Echo	Type Quit To exit this  
Echo.
::::::::::: MENU SELECTION 
SET Choice=
SET /P Choice=Type In A What You Would Like To Do -^> 
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,9%
IF /I '%choice%'=='Yes' GOTO Select1
IF /I '%choice%'=='No' GOTO Select2
IF /I '%choice%'=='Ok' GOTO Select3
IF /I '%choice%'=='Quit' GOTO Select4

ECHO This Is Not A Correct Selection -^> "%choice%" ^<-
Echo  Please try again.
ping -n 3 127.0.0.1>nul
goto Main

::::::::::: MENU 1 CHOICE
:Select1
CLS 
Color 19
Mode 55,4 
Title Selection 2
Echo.
Echo		  This was your reply -^> %choice% ^<-
Echo.
ping -n 3 127.0.0.1>nul
goto Main

::::::::::: MENU 2 CHOICE
:Select2
CLS 
Color 6b
Mode 55,4 
Title Selection 2
Echo.
Echo		  This was your reply -^> %choice% ^<-
Echo.
ping -n 3 127.0.0.1>nul
goto Main

::::::::::: MENU 3 CHOICE
:Select3
CLS 
Color 9a
Mode 55,4 
Title Selection 3
Echo.
Echo		  This was your reply -^> %choice% ^<-
Echo.
ping -n 3 127.0.0.1>nul
goto Main

::::::::::: MENU 4 CHOICE
:Select4
CLS 
Color 5e
Mode 60,4 
Title Good Bye And Exit
Echo.
Echo This was your reply -^> %choice%
Echo.
ping -n 3 127.0.0.1>nul
CLS
Echo.
Echo Good Bye
Echo.
ping -n 3 127.0.0.1>nul
goto EOF
Exit
:EOF


#15 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 9,114
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 31 August 2006 - 02:11 PM

View Postmazin, on Aug 31 2006, 02:40 PM, said:

I'm sorry, jaclaz, to ask this. But, is one of those CHOICE.XXX supposed to work under XP?


Well, even original choice.com does work on XP. with a bit of tweaking (16 bit DOS subsystem).
The CHOIX.COM is very similar (but smaller), never tested it in XP, but it works under 2K, so it should in XP too.
The Win2K RK CHOICE.EXE does work perfectly in XP, without the problems detailed on
http://www.ss64.com/nt/choice.html

Quote

Availability
Choice.com was originally supplied on the Windows 95 install CD, however there are some issues with this version under NT - multiple concurrent invocations of CHOICE will clobber each other. CHOICE.com will also burn a lot of CPU's when in a wait state.
The NT and 2000 Resource Kits contain CHOICE.EXE which behaves a lot better.
In Windows 2003 CHOICE became a built-in command so it is no longer in the resource kit.


I haven't tested it, but I reasonably presume that the Server 2003 version works in XP too.

I gave the alternatives more as a "license" alternative than for real need, I mean even if it's not "elegant" from a programmer's point of view, WHO cares whether "when in wait state" CHOICE.COM eats CPU's cycles?
:blink:

jaclaz

This post has been edited by jaclaz: 31 August 2006 - 02:16 PM


#16 User is offline   mazin 

  • MSFN Addict
  • Group: Supreme Sponsor
  • Posts: 1,952
  • Joined: 12-January 04

Posted 31 August 2006 - 03:19 PM

Thank you for the input. I'll add that of win2000 next CD burn and see.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy