Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

choice in batch files

11 views
Skip to first unread message

jim

unread,
Jan 7, 2003, 8:59:46 PM1/7/03
to
choice doesnt work in batch files in win2k so what can i
use to let users make a selection?

Phil Robyn

unread,
Jan 8, 2003, 12:45:11 AM1/8/03
to
jim wrote:
> choice doesnt work in batch files in win2k so what can i
> use to let users make a selection?

set /p your_choice="Please enter your choice: "

--
U s e ' R e p l y - T o ' a d d r e s s o r
u n z i p ' F r o m ' t o s e n d m a i l

Dean Wells

unread,
Jan 8, 2003, 9:03:21 AM1/8/03
to

Windows 2000 Resource Kit supplies a choice utility ... though Phil's
suggestion is, in my opinion, a better way to go.

Dean

--
Dean Wells [MVP / Windows platform]
MSEtechnology
dwe...@msetechnology.com
[[ Please respond to the Newsgroup only ]]


"jim" <vettev...@charter.net> wrote in message
news:116f01c2b6b9$9e92a1d0$d4f82ecf@TK2MSFTNGXA11...

Bill Stewart

unread,
Jan 8, 2003, 12:06:04 PM1/8/03
to
jim <vettev...@charter.net> wrote:

> choice doesnt work in batch files in win2k so what can i use to let users
> make a selection?

In Windows 2000 and later CMD.EXE, you can use SET /P to read an
environment variable.

For earlier versions (including Win9x/Me and DOS), you can retrieve my
getkey utility.

http://mywebpages.comcast.net/stewartb/files/getkv7.zip


Phil Robyn

unread,
Jan 8, 2003, 12:43:05 PM1/8/03
to

CHOICE.EXE is not a good idea in a multitasking environment.
People start using CHOICE to implement short time delays instead
of interactively accepting keystrokes. When two or more instances
of CHOICE run simultaneously, they will all clobber each other and
you will never be able to figure out what happened....

--
t o s e n d e - m a i l u s e ' R e p l y - T o '
o r u n z i p m y ' F r o m ' a d d r e s s ....

Dean Wells

unread,
Jan 8, 2003, 2:18:26 PM1/8/03
to
Please elaborate, though I don't personally use CHOICE I am interested
to know what you're referring to by clobber. I just wrote a small script
and ran it in 10 command shells simultaneously, each instance was
provided with a different response and reacted accordingly.

Dean

--
Dean Wells [MVP / Windows platform]
MSEtechnology
dwe...@msetechnology.com
[[ Please respond to the Newsgroup only ]]


"Phil Robyn" <zipp...@uclink.berkeley.edu> wrote in message
news:3E1C6329...@uclink.berkeley.edu...

Marty List

unread,
Jan 8, 2003, 2:57:02 PM1/8/03
to

CHOICE.EXE works fine when you use it for what it was intended, to get a
choice from the user. Some people use the /T timeout option as a sleep
hack, which is when the multithreaded problem occurs.


"Dean Wells" <dwe...@mask.msetechnology.com> wrote in message
news:uoypOv0tCHA.2296@TK2MSFTNGP10...

Dean Wells

unread,
Jan 8, 2003, 3:18:02 PM1/8/03
to

Thanks Marty ... but will someone please tell me what the problem is :-)

Seriously, I can't get a bad result and me being me I'd like to know how
it manifests itself.

Thanks.

Dean

--
Dean Wells [MVP / Windows platform]
MSEtechnology
dwe...@msetechnology.com
[[ Please respond to the Newsgroup only ]]


"Marty List" <Bill....@sun.com> wrote in message
news:#DPXUA1tCHA.2308@TK2MSFTNGP09...

Curtis Anderson

unread,
Jan 8, 2003, 3:26:04 PM1/8/03
to
Direct quote(s) from Phil Robyn:

http://groups.google.com/groups?q=choice+clobber+group:alt.msdos.batch.nt&hl
=en&lr=&ie=UTF-8&oe=UTF-8&selm=3AA5279D.948CF537%40uclink.berkeley.edu&rnum=
8&filter=0

http://groups.google.com/groups?q=choice+clobber+group:alt.msdos.batch.nt&hl
=en&lr=&ie=UTF-8&oe=UTF-8&selm=3b259af3%240%2488183%244c5ecdc7%40news.erinet
.com&rnum=7&filter=0

I had no idea what he was talking about either ;-) Here's the thread that
enlightened me.

http://groups.google.ca/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=624d0abc.
0207250536.54067686%40posting.google.com&rnum=1&prev=/groups%3Fhl%3Den%26lr%
3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D624d0abc.0207250536.54067686%2540posti
ng.google.com

Dean Wells <dwe...@mask.msetechnology.com> uttered:

Dean Wells

unread,
Jan 8, 2003, 3:31:25 PM1/8/03
to
Please ignore me ... wrong newsgroup completely :-/

--
Dean Wells [MVP / Windows platform]
MSEtechnology
dwe...@msetechnology.com
[[ Please respond to the Newsgroup only ]]

"Dean Wells" <dwe...@mask.msetechnology.com> wrote in message

news:OtJKJQ1tCHA.2600@TK2MSFTNGP11...
> http://support.microsoft.com/default.aspx?scid=kb;en-us;Q316201


>
> --
> Dean Wells [MVP / Windows platform]
> MSEtechnology
> dwe...@msetechnology.com
> [[ Please respond to the Newsgroup only ]]
>
>

> "Dean Wells" <dwe...@mask.msetechnology.com> wrote in message

> news:uQm$DM1tCHA.2304@TK2MSFTNGP12...

Marty List

unread,
Jan 8, 2003, 3:31:41 PM1/8/03
to

In my testing the timeout would never occur, all CMD.EXE processes waiting
on a choice would never timeout. I did some very quick testing a while back
and if I remember correctly, Choice.com from Windows 95 OEMSR2 seemed to
work fine. Phil has more info about it, he seems to be on some sort of
crusade to stop people from using Choice.exe.

PS - That link you posted points to an article titled "RID Pool Allocation
and Sizing Changes in Windows 2000 SP4"


"Dean Wells" <dwe...@mask.msetechnology.com> wrote in message

> --
> Dean Wells [MVP / Windows platform]
> MSEtechnology
> dwe...@msetechnology.com
> [[ Please respond to the Newsgroup only ]]
>
>

> "Dean Wells" <dwe...@mask.msetechnology.com> wrote in message

> news:uQm$DM1tCHA.2304@TK2MSFTNGP12...

Phil Robyn

unread,
Jan 8, 2003, 3:33:24 PM1/8/03
to
Dean Wells wrote:
> Please elaborate, though I don't personally use CHOICE I am interested
> to know what you're referring to by clobber. I just wrote a small script
> and ran it in 10 command shells simultaneously, each instance was
> provided with a different response and reacted accordingly.
>
> Dean

Now at the same time, run another script that uses CHOICE to implement
a short time delay. . . . Also see the discussion at

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=9g4dho%2475enp%241%40ID-55970.news.dfncis.de&rnum=9&prev=/groups%3Fq%3Dclobber%2Bgroup:alt.msdos.batch.nt%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D9g4dho%252475enp%25241%2540ID-55970.news.dfncis.de%26rnum%3D9%26filter%3D0

(Note: these results were for WinNT 4.0; I have not retested this in Win2000.)

Dean Wells

unread,
Jan 8, 2003, 3:36:13 PM1/8/03
to
Same results here. Appreciate the information.

Dean

--
Dean Wells [MVP / Windows platform]
MSEtechnology
dwe...@msetechnology.com
[[ Please respond to the Newsgroup only ]]


"Marty List" <Bill....@sun.com> wrote in message

news:ePLsrT1tCHA.968@TK2MSFTNGP12...

Dean Wells

unread,
Jan 8, 2003, 3:35:37 PM1/8/03
to
Uh huh, interesting stuff ain't it :)

--
Dean Wells [MVP / Windows platform]
MSEtechnology
dwe...@msetechnology.com
[[ Please respond to the Newsgroup only ]]


"Marty List" <Bill....@sun.com> wrote in message

news:ePLsrT1tCHA.968@TK2MSFTNGP12...

Dean Wells

unread,
Jan 8, 2003, 3:35:59 PM1/8/03
to
Thanks!

--
Dean Wells [MVP / Windows platform]
MSEtechnology
dwe...@msetechnology.com
[[ Please respond to the Newsgroup only ]]


"Curtis Anderson" <ned...@hotmail.com> wrote in message
news:#LmWjQ1tCHA.2332@TK2MSFTNGP12...

Dean Wells

unread,
Jan 8, 2003, 3:25:20 PM1/8/03
to
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q316201

--
Dean Wells [MVP / Windows platform]
MSEtechnology
dwe...@msetechnology.com
[[ Please respond to the Newsgroup only ]]

"Dean Wells" <dwe...@mask.msetechnology.com> wrote in message

news:uQm$DM1tCHA.2304@TK2MSFTNGP12...

Curtis Anderson

unread,
Jan 8, 2003, 3:40:12 PM1/8/03
to
Well you were having such problems posting to the right groups and all.
<BG>

Dean Wells <dwe...@mask.msetechnology.com> uttered:
> Thanks!

Curtis Anderson

unread,
Jan 8, 2003, 3:43:55 PM1/8/03
to
Marty List <Bill....@sun.com> uttered:

> Phil has more info about it,
> he seems to be on some sort of crusade to stop people from using
> Choice.exe.

LOL I don't know if it counts as a crusade as such, but he definitely does
*not* seem impressed with its behaviour. I actually had no clue that CHOICE
behaved that way, and was pretty happy Phil'd done the investigation that I
(obviously) hadn't. It's likely saved me a few troubleshooting headaches by
simply not having the problem occur in the first place. :-)


Phil Robyn

unread,
Jan 8, 2003, 4:11:29 PM1/8/03
to

Yeah, I'm not on any *crusade* or anything . . . just trying to save someone
else the aggravation that I went through of not being able to figure out why
a process would inexplicably hang (because it was using CHOICE to implement
a short delay) when it got stepped on by another invocation of CHOICE. You
think there's a reason for Microsoft's not providing CHOICE *except* in the
Resource Kit? :-)

Marty List

unread,
Jan 8, 2003, 4:15:31 PM1/8/03
to

Usually I'm not worried about the fact that the Resource Kit tools are
"unsupported", but then things like this make me wonder if I should be!

The good news is that Windows XP Pro (and most likely Windows .NET Server)
do not have any tools in the Resource Kit, they are all free and either
included in the OS or on the install CD.


"Phil Robyn" <zipp...@uclink.berkeley.edu> wrote in message

news:3E1C9401...@uclink.berkeley.edu...

Torgeir Bakken (MVP)

unread,
Jan 8, 2003, 7:18:02 PM1/8/03
to
Marty List wrote:

> Usually I'm not worried about the fact that the Resource Kit tools are
> "unsupported", but then things like this make me wonder if I should be!
>
> The good news is that Windows XP Pro (and most likely Windows .NET Server)
> do not have any tools in the Resource Kit, they are all free and either
> included in the OS or on the install CD.

The ones that comes with WinXP is still far away what comes with W2k RK.

And for Windows .NET Server, I would not be surprised that it will released a
ResKit tool together with it:


From: "Mike Brannigan [MS]" <mike...@online.microsoft.com>
Subject: Re: Why no Resource Kit Programs?
Date: Wed, 8 Jan 2003 17:03:00 -0000
Message-ID: <OfuoFfztCHA.432@TK2MSFTNGP10>
Newsgroups: microsoft.public.windowsxp.general

<quote>
"Norm Dresner" <nd...@worldnet.att.net> wrote in message
news:_xYS9.33385$p_6.2...@bgtnsc04-news.ops.worldnet.att.net...
> WinXP is AFAIK the first M/S Windows OS not to have a CD full of
> "Resource Kit" programs. I have the book "Microsoft Windows Professional
> Resource Kit Documentation" and a subscription to M/S's MSDN OS and haven't
> seen anything either on the M/S web site or MSDN material.

The majority of Resource Kit tools for Windows 2000 function on Windows
XP.
You may also see a newer set of ResKit tools ship with the Windows
Server 2003 Resource Kit

Regards,

Mike

Mike Brannigan [MS]

</quote>

--
torgeir
Microsoft MVP Scripting and WMI
Porsgrunn Norway


Torgeir Bakken (MVP)

unread,
Jan 11, 2003, 9:04:10 PM1/11/03
to
Marty List wrote:

> The good news is that Windows XP Pro (and most likely Windows .NET Server)
> do not have any tools in the Resource Kit, they are all free and either
> included in the OS or on the install CD.

It will be released a new Resource Kit for Windows Server 2003 that will contain
a CD with new tools and utilities, see
http://www.microsoft.com/mspress/books/5555.asp

--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and a ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter


Marty List

unread,
Jan 12, 2003, 11:21:42 AM1/12/03
to

That's disappointing. At first I was confused when the Windows XP Resource
Kit did not have any tools included, but then I decided that was a good
thing, that all of the tools should come with the base OS anyway. I was
hoping this would be the case for Windows Server 2003, but I apparently not.


"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
news:3E20CD1A...@hydro.com...

Torgeir Bakken (MVP)

unread,
Jan 12, 2003, 2:28:56 PM1/12/03
to
Marty List wrote:

> "Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
> news:3E20CD1A...@hydro.com...
> >

> > It will be released a new Resource Kit for Windows Server 2003 that will
> > contain a CD with new tools and utilities, see
> > http://www.microsoft.com/mspress/books/5555.asp
>

> That's disappointing. At first I was confused when the Windows XP Resource
> Kit did not have any tools included, but then I decided that was a good
> thing, that all of the tools should come with the base OS anyway. I was
> hoping this would be the case for Windows Server 2003, but I apparently not.

At least some of the tools in the Win2k RK comes with the base OS in
WinXP/Win2003 ;-)

I am pretty sure that the main reason for releasing the tools in a separate kit
is that they in this way can make the tools unsupported in an clear and easy way
(and that even if you pay to get them ;-) . If MS had put them in the base OS,
MS also would have needed to take full responsibility for them. Sneaky ;-)

Al Dunbar

unread,
Jan 15, 2003, 12:42:35 AM1/15/03
to

"Phil Robyn" <zipp...@uclink.berkeley.edu> wrote in message

news:3E1C9401...@uclink.berkeley.edu...

If you are not "pro-choice", what are you: "pro-set/p"?

/Al


Al Dunbar

unread,
Jan 15, 2003, 12:45:52 AM1/15/03
to

"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message

news:3E21C1F8...@hydro.com...


> Marty List wrote:
>
> > "Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
> > news:3E20CD1A...@hydro.com...
> > >
> > > It will be released a new Resource Kit for Windows Server 2003 that
will
> > > contain a CD with new tools and utilities, see
> > > http://www.microsoft.com/mspress/books/5555.asp
> >
> > That's disappointing. At first I was confused when the Windows XP
Resource
> > Kit did not have any tools included, but then I decided that was a good
> > thing, that all of the tools should come with the base OS anyway. I was
> > hoping this would be the case for Windows Server 2003, but I apparently
not.
>
> At least some of the tools in the Win2k RK comes with the base OS in
> WinXP/Win2003 ;-)
>
> I am pretty sure that the main reason for releasing the tools in a
separate kit
> is that they in this way can make the tools unsupported in an clear and
easy way
> (and that even if you pay to get them ;-) . If MS had put them in the base
OS,
> MS also would have needed to take full responsibility for them. Sneaky ;-)

Another view could be that they tend to release O/S's before they are
completely finished ;-)

/Al


Al Dunbar

unread,
Jan 15, 2003, 12:44:09 AM1/15/03
to

"Marty List" <Bill....@sun.com> wrote in message

news:esTVLs1tCHA.2380@TK2MSFTNGP11...


>
> Usually I'm not worried about the fact that the Resource Kit tools are
> "unsupported", but then things like this make me wonder if I should be!
>
> The good news is that Windows XP Pro (and most likely Windows .NET Server)
> do not have any tools in the Resource Kit, they are all free and either
> included in the OS or on the install CD.

Begging the question: If there are no tools in the resource kit, what the
heck is actually /in/ there?

/Al

Dean Wells

unread,
Jan 15, 2003, 8:07:26 AM1/15/03
to

lol :)

--
Dean Wells [MVP / Windows platform]
MSEtechnology
dwe...@msetechnology.com
[[ Please respond to the Newsgroup only ]]


"Al Dunbar" <Luigi...@hotmail.com> wrote in message
news:uR5QfjFvCHA.1636@TK2MSFTNGP12...

Torgeir Bakken (MVP)

unread,
Jan 15, 2003, 10:15:06 PM1/15/03
to
Al Dunbar wrote:

> "Marty List" <Bill....@sun.com> wrote in message
> news:esTVLs1tCHA.2380@TK2MSFTNGP11...
> >
> > Usually I'm not worried about the fact that the Resource Kit tools are
> > "unsupported", but then things like this make me wonder if I should be!
> >
> > The good news is that Windows XP Pro (and most likely Windows .NET Server)
> > do not have any tools in the Resource Kit, they are all free and either
> > included in the OS or on the install CD.
>
> Begging the question: If there are no tools in the resource kit, what the
> heck is actually /in/ there?

Words and pictures ;-)

Microsoft® Windows® XP Professional Resource Kit Documentation, Sample Chapter

Chapter 7: Supporting Mobile Users
http://www.microsoft.com/mspress/books/sampchap/5566.asp

0 new messages