Choice cmnd workaround (etc.), anyone?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This crazy yahoo toolbar pop-up blocker kept blocking the "New Question"
window - even after I said it's OK and allowed "would you like to enable
pop-ups from Microsoft.com" or something like that. Finally had to disable it
at the Yahoo icon to get here.
-----------------------------------------------

I've read thru all the threads on DOS here (including the one on "choice")
and not sure now whether to try my luck here or not. Perhaps at least someone
could direct me to the correct forum but I don't think there's one for DOS in
these Microsoft communities.

In any case, here goes:

23-Feb-06

Have some nifty batch files left over from good old DOS days, which like to
use
under Win XP Pro. Unfortunately my XP version no longer supports a lot of the
most useful DOS commands; in particular:

1. "CHOICE" and
2. "Command/y/c" for stepping thru and debugging batch files.

Also, even w/ the "@echo " cmnd preceding certain words and symbols (ex: the
ampersand, &), XP produces an error message like "unrecognized command". I can
easily get around the latter but I can't live w/o 1. and 2.

Are there any substitutes or workarounds for the above two? Would it be
possible, at least in case 1., to place a DOS 6 or 7 version "CHOICE.COM"
in System32 folder and hope for the best? maybe in conjunction w/ "setver"
in config.nt?

Another problem is that XP won't recognize batch files as "DOS programs",
resulting in loss of ability to set some of the important properties up in
the 'Properties' window and which now only show up for a "... .com" or an
"... .exe" file.

Any info greatly appreciated,

Ted... ( (e-mail address removed)[delete_this_suffix] )
 
Download choice.com
ftp://ftp.microsoft.com/Services/TechNet/Windows/msdos/RESKIT/SUPPDISK/CHOICE.COM

choice.exe comes with Microsoft Windows Server 2003.
I believe that the following version is from a Windows NT4 or 2000 Resource
kit.

Download choice.exe
http://informatics.ntu.edu.au/staff/dewhurst/ITP201/CHOICE.EXE

Here are the XP command.com switches...
C:\>command /?
Starts a new instance of the MS-DOS command interpreter.

COMMAND [[drive:]path] [device] [/E:nnnnn] [/P] [/C string] [/MSG]

[drive:]path Specifies the directory containing COMMAND.COM file.
device Specifies the device to use for command input and output.
/E:nnnnn Sets the initial environment size to nnnnn bytes.
/P Makes the new command interpreter permanent (can't exit).
/C string Carries out the command specified by string, and then stops.
/MSG Specifies that all error messages be stored in memory. You
need to specify /P with this switch.
----------

Help for choice.exe and choice.com...

C:\>choice.exe /?
CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text]

/C[:]choices Specifies allowable keys. Default is YN
/N Do not display choices and ? at end of prompt string.
/S Treat choice keys as case sensitive.
/T[:]c,nn Default choice to c after nn seconds
text Prompt string to display

ERRORLEVEL is set to offset of key user presses in choices.

C:\>choice.com /?
Waits for the user to choose one of a set of choices.

CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text]

/C[:]choices Specifies allowable keys. Default is YN
/N Do not display choices and ? at end of prompt string.
/S Treat choice keys as case sensitive.
/T[:]c,nn Default choice to c after nn seconds
text Prompt string to display

ERRORLEVEL is set to offset of key user presses in choices.
-----

A .bat file should show as an MS-DOS Batch File, unless something is messed
up in your registry.

..bat file Properties do not show up as 16-bit. So you do not get Properties
like you do with a .com file or a 16-bit .exe file.

A .cmd file should show as Windows NT Command Script.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
tedoniman said:
This crazy yahoo toolbar pop-up blocker kept blocking the "New Question"
window - even after I said it's OK and allowed "would you like to enable
pop-ups from Microsoft.com" or something like that. Finally had to
disable it at the Yahoo icon to get here.
-----------------------------------------------

I've read thru all the threads on DOS here (including the one on "choice")
and not sure now whether to try my luck here or not. Perhaps at least
someone could direct me to the correct forum but I don't think there's
one for DOS in these Microsoft communities.

In any case, here goes:

23-Feb-06

Have some nifty batch files left over from good old DOS days, which like
to use
under Win XP Pro. Unfortunately my XP version no longer supports a lot of
the most useful DOS commands; in particular:

1. "CHOICE" and
2. "Command/y/c" for stepping thru and debugging batch files.

Also, even w/ the "@echo " cmnd preceding certain words and symbols (ex:
the ampersand, &), XP produces an error message like "unrecognized
command". I can easily get around the latter but I can't live w/o 1. and
2.

Are there any substitutes or workarounds for the above two? Would it be
possible, at least in case 1., to place a DOS 6 or 7 version "CHOICE.COM"
in System32 folder and hope for the best? maybe in conjunction w/ "setver"
in config.nt?

Another problem is that XP won't recognize batch files as "DOS programs",
resulting in loss of ability to set some of the important properties up in
the 'Properties' window and which now only show up for a "... .com" or an
"... .exe" file.

Any info greatly appreciated,

Ted... ( (e-mail address removed)[delete_this_suffix] )
 
1. In NT set can take user input.

2. No. Command doesn't run batch files in XP and these features weren't introduced yet (Dos 5 is XP's dos) anyway.
 
26-02-06
Sorry, accidentally put my 1st reply in new thread. it was:

(23 Feb., 06)
Well, thank you both gentlemen (Wesley and David) for the links and advice.
This is amazing. I wonder why there's no reference to any of this in XP Help.
I will go back now and check out all this and let you know if any of it
worked on
this system (XP Pro). Be a while...

gracias,
--------------------------------------------

(26 Feb., 06)

Re: CHOICE and COMMAND/Y/C subjects - in Windows XP General

Thanks to Wes and Kandy for links & info on above subjects. Problems solved.

1. The "ping" command (got that from reading thru another forum here) for
exit delay, works just fine.

2. CHOICE.EXE (48KB) works perfect for my batch file in Win XP Pro, when
placed
in C:\Windows\System32 folder. One odd thing, though, after copy to folder,
the file creation date was listed as 24 Feb., 2006. I thought the
original would
be maintained.

3. Been playing w/ the "SET" command - but so far no luck.

After check all the links and then some, somewhere along line a link took me
to
Eric Phelps' site (the basic link is: http://www.ericphelps.com).

Somewhere in there there's a page full of "Windows Scripting Samples".
Clicking on
"Miscellaneous" takes one down near end of page where I found "YC" - a
script file
which supposedly reasonably simulates the old "command/y/c". Quote:

" "YC" Windows 2000/XP only One thing I missed when I got moved from
Win95 to
Win2000 was the ability to single-step my batch files with the "command /y
/c"
command. Unfortunately, Win2K doesn't seem to have a way to single-step
batch files.
Not even if you try using an old copy of Win95 command.com! So I wrote this
script.

It works by constructing a special debug version of your batch file,
launching it,
then putting everything back to normal after the batch file finishes. It
isn't the
same as what I could do in Win95 (it won't single-step a "call"ed batch
file), but it
beats the heck out of watching programs crash and close before you can
analyze
things! It also adds "//x" to the command line for scripts to launch them
with the
debugger. Just drop a batch file on the script and start stepping through. "

In the 'comments' p/o the "yc.vbs" script file, he notes:

'Makes an on-the-fly copy of BAT Or CMD files with SET /P
'statements before every line, then runs it so you
'can debug the batch file. Your actual batch file *is*
'replaced by the modified version, but is put back To
'normal afterwards. (Your batch file is backed up With
'a ".bak" file extension while the debug version runs)

Without actually running my batchfile w/ this script, I tried to emulate his
suggestion (which I presumed was similar to David Candy's implication)
in a sample batch file by placing "SET /P " ahead of the sample
commands. Ex:

@SET
@ECHO.
@ECHO pausing for a moment...
@pause > nul
@SET /?
@ECHO.
@PAUSE

SET /P ECHO.
SET /P ECHO Hi!
SET /P SET
ping -n 05 127.0.0.1 >nul

The result was that for every command preceded by "SET /P ", I got the
following
error message (all other cmds OK) :

"The syntax of the command is incorrect"

None of the "SET /P " cmds executed and there was no 'stepping' (just for
fun,
I used 'ping' (in lieu of 'pause') to delay the exit and view the screen
output).

The SET cmnd works fine in my Win XP Pro. The following is an extract from
"SET /?" (only the applicable portions are shown):

----------------------------------------------------
Two new switches have been added to the SET command:

SET /A expression
SET /P variable=[promptString]

.. . .

The /P switch allows you to set the value of a variable to a line of input
entered by the user. Displays the specified promptString before reading
the line of input. The promptString can be empty.
----------------------------------------------------

I'm not to hip on the exact interpretation. Is there anything in there that
says "SET /P " won't work in a batch file in the manner proscribed by Phelps?

In any case, I've still to try the vbs file. Thought I'd drop by here first to
leave my thanks.

-----
Ted...



Wesley Vogel said:
Download choice.com
ftp://ftp.microsoft.com/Services/TechNet/Windows/msdos/RESKIT/SUPPDISK/CHOICE.COM

choice.exe comes with Microsoft Windows Server 2003.
I believe that the following version is from a Windows NT4 or 2000 Resource
kit.

Download choice.exe
http://informatics.ntu.edu.au/staff/dewhurst/ITP201/CHOICE.EXE

Here are the XP command.com switches...
C:\>command /?
Starts a new instance of the MS-DOS command interpreter.

COMMAND [[drive:]path] [device] [/E:nnnnn] [/P] [/C string] [/MSG]

[drive:]path Specifies the directory containing COMMAND.COM file.
device Specifies the device to use for command input and output.
/E:nnnnn Sets the initial environment size to nnnnn bytes.
/P Makes the new command interpreter permanent (can't exit).
/C string Carries out the command specified by string, and then stops.
/MSG Specifies that all error messages be stored in memory. You
need to specify /P with this switch.
----------

Help for choice.exe and choice.com...

C:\>choice.exe /?
CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text]

/C[:]choices Specifies allowable keys. Default is YN
/N Do not display choices and ? at end of prompt string.
/S Treat choice keys as case sensitive.
/T[:]c,nn Default choice to c after nn seconds
text Prompt string to display

ERRORLEVEL is set to offset of key user presses in choices.

C:\>choice.com /?
Waits for the user to choose one of a set of choices.

CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text]

/C[:]choices Specifies allowable keys. Default is YN
/N Do not display choices and ? at end of prompt string.
/S Treat choice keys as case sensitive.
/T[:]c,nn Default choice to c after nn seconds
text Prompt string to display

ERRORLEVEL is set to offset of key user presses in choices.
-----

A .bat file should show as an MS-DOS Batch File, unless something is messed
up in your registry.

..bat file Properties do not show up as 16-bit. So you do not get Properties
like you do with a .com file or a 16-bit .exe file.

A .cmd file should show as Windows NT Command Script.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
tedoniman said:
This crazy yahoo toolbar pop-up blocker kept blocking the "New Question"
window - even after I said it's OK and allowed "would you like to enable
pop-ups from Microsoft.com" or something like that. Finally had to
disable it at the Yahoo icon to get here.
-----------------------------------------------

I've read thru all the threads on DOS here (including the one on "choice")
and not sure now whether to try my luck here or not. Perhaps at least
someone could direct me to the correct forum but I don't think there's
one for DOS in these Microsoft communities.

In any case, here goes:

23-Feb-06

Have some nifty batch files left over from good old DOS days, which like
to use
under Win XP Pro. Unfortunately my XP version no longer supports a lot of
the most useful DOS commands; in particular:

1. "CHOICE" and
2. "Command/y/c" for stepping thru and debugging batch files.

Also, even w/ the "@echo " cmnd preceding certain words and symbols (ex:
the ampersand, &), XP produces an error message like "unrecognized
command". I can easily get around the latter but I can't live w/o 1. and
2.

Are there any substitutes or workarounds for the above two? Would it be
possible, at least in case 1., to place a DOS 6 or 7 version "CHOICE.COM"
in System32 folder and hope for the best? maybe in conjunction w/ "setver"
in config.nt?

Another problem is that XP won't recognize batch files as "DOS programs",
resulting in loss of ability to set some of the important properties up in
the 'Properties' window and which now only show up for a "... .com" or an
"... .exe" file.

Any info greatly appreciated,

Ted... ( (e-mail address removed)[delete_this_suffix] )
 
I wonder why there's no reference to any of this
in XP Help.

There is....

Unavailable MS-DOS Commands

The following MS-DOS commands are not available at the command prompt.

Command New procedure or reason for obsolescence
------------------------------------------------------------
choice Not currently supported.

Start | Run | Paste the following line and click OK...

hh ntcmds.chm::/dos_diffs.htm

Scroll down to Unavailable MS-DOS Commands

hh ntcmds.chm::/set.htm

User Input
http://www.robvanderwoude.com/userinput.html

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
tedoniman said:
26-02-06
Sorry, accidentally put my 1st reply in new thread. it was:

(23 Feb., 06)
Well, thank you both gentlemen (Wesley and David) for the links and
advice. This is amazing. I wonder why there's no reference to any of this
in XP Help. I will go back now and check out all this and let you know if
any of it worked on
this system (XP Pro). Be a while...

gracias,
--------------------------------------------

(26 Feb., 06)

Re: CHOICE and COMMAND/Y/C subjects - in Windows XP General

Thanks to Wes and Kandy for links & info on above subjects. Problems
solved.

1. The "ping" command (got that from reading thru another forum here) for
exit delay, works just fine.

2. CHOICE.EXE (48KB) works perfect for my batch file in Win XP Pro, when
placed
in C:\Windows\System32 folder. One odd thing, though, after copy to
folder, the file creation date was listed as 24 Feb., 2006. I thought
the
original would
be maintained.

3. Been playing w/ the "SET" command - but so far no luck.

After check all the links and then some, somewhere along line a link took
me to
Eric Phelps' site (the basic link is: http://www.ericphelps.com).

Somewhere in there there's a page full of "Windows Scripting Samples".
Clicking on
"Miscellaneous" takes one down near end of page where I found "YC" - a
script file
which supposedly reasonably simulates the old "command/y/c". Quote:

" "YC" Windows 2000/XP only One thing I missed when I got moved from
Win95 to
Win2000 was the ability to single-step my batch files with the "command /y
/c"
command. Unfortunately, Win2K doesn't seem to have a way to single-step
batch files.
Not even if you try using an old copy of Win95 command.com! So I wrote
this script.

It works by constructing a special debug version of your batch file,
launching it,
then putting everything back to normal after the batch file finishes. It
isn't the
same as what I could do in Win95 (it won't single-step a "call"ed batch
file), but it
beats the heck out of watching programs crash and close before you can
analyze
things! It also adds "//x" to the command line for scripts to launch them
with the
debugger. Just drop a batch file on the script and start stepping
through. "

In the 'comments' p/o the "yc.vbs" script file, he notes:

'Makes an on-the-fly copy of BAT Or CMD files with SET /P
'statements before every line, then runs it so you
'can debug the batch file. Your actual batch file *is*
'replaced by the modified version, but is put back To
'normal afterwards. (Your batch file is backed up With
'a ".bak" file extension while the debug version runs)

Without actually running my batchfile w/ this script, I tried to emulate
his suggestion (which I presumed was similar to David Candy's implication)
in a sample batch file by placing "SET /P " ahead of the sample
commands. Ex:

@SET
@ECHO.
@ECHO pausing for a moment...
@pause > nul
@SET /?
@ECHO.
@PAUSE

SET /P ECHO.
SET /P ECHO Hi!
SET /P SET
ping -n 05 127.0.0.1 >nul

The result was that for every command preceded by "SET /P ", I got the
following
error message (all other cmds OK) :

"The syntax of the command is incorrect"

None of the "SET /P " cmds executed and there was no 'stepping' (just for
fun,
I used 'ping' (in lieu of 'pause') to delay the exit and view the screen
output).

The SET cmnd works fine in my Win XP Pro. The following is an extract from
"SET /?" (only the applicable portions are shown):

----------------------------------------------------
Two new switches have been added to the SET command:

SET /A expression
SET /P variable=[promptString]

. . .

The /P switch allows you to set the value of a variable to a line of input
entered by the user. Displays the specified promptString before reading
the line of input. The promptString can be empty.
----------------------------------------------------

I'm not to hip on the exact interpretation. Is there anything in there
that says "SET /P " won't work in a batch file in the manner proscribed
by Phelps?

In any case, I've still to try the vbs file. Thought I'd drop by here
first to leave my thanks.

-----
Ted...



Wesley Vogel said:
Download choice.com
ftp://ftp.microsoft.com/Services/TechNet/Windows/msdos/RESKIT/SUPPDISK/CHOICE.COM

choice.exe comes with Microsoft Windows Server 2003.
I believe that the following version is from a Windows NT4 or 2000
Resource kit.

Download choice.exe
http://informatics.ntu.edu.au/staff/dewhurst/ITP201/CHOICE.EXE

Here are the XP command.com switches...
C:\>command /?
Starts a new instance of the MS-DOS command interpreter.

COMMAND [[drive:]path] [device] [/E:nnnnn] [/P] [/C string] [/MSG]

[drive:]path Specifies the directory containing COMMAND.COM file.
device Specifies the device to use for command input and
output. /E:nnnnn Sets the initial environment size to nnnnn
bytes. /P Makes the new command interpreter permanent
(can't exit). /C string Carries out the command specified by
string, and then stops. /MSG Specifies that all error
messages be stored in memory. You need to specify /P
with this switch. ----------

Help for choice.exe and choice.com...

C:\>choice.exe /?
CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text]

/C[:]choices Specifies allowable keys. Default is YN
/N Do not display choices and ? at end of prompt string.
/S Treat choice keys as case sensitive.
/T[:]c,nn Default choice to c after nn seconds
text Prompt string to display

ERRORLEVEL is set to offset of key user presses in choices.

C:\>choice.com /?
Waits for the user to choose one of a set of choices.

CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text]

/C[:]choices Specifies allowable keys. Default is YN
/N Do not display choices and ? at end of prompt string.
/S Treat choice keys as case sensitive.
/T[:]c,nn Default choice to c after nn seconds
text Prompt string to display

ERRORLEVEL is set to offset of key user presses in choices.
-----

A .bat file should show as an MS-DOS Batch File, unless something is
messed up in your registry.

..bat file Properties do not show up as 16-bit. So you do not get
Properties like you do with a .com file or a 16-bit .exe file.

A .cmd file should show as Windows NT Command Script.

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
tedoniman said:
This crazy yahoo toolbar pop-up blocker kept blocking the "New Question"
window - even after I said it's OK and allowed "would you like to enable
pop-ups from Microsoft.com" or something like that. Finally had to
disable it at the Yahoo icon to get here.
-----------------------------------------------

I've read thru all the threads on DOS here (including the one on
"choice") and not sure now whether to try my luck here or not. Perhaps
at least someone could direct me to the correct forum but I don't think
there's one for DOS in these Microsoft communities.

In any case, here goes:

23-Feb-06

Have some nifty batch files left over from good old DOS days, which like
to use
under Win XP Pro. Unfortunately my XP version no longer supports a lot
of the most useful DOS commands; in particular:

1. "CHOICE" and
2. "Command/y/c" for stepping thru and debugging batch files.

Also, even w/ the "@echo " cmnd preceding certain words and symbols (ex:
the ampersand, &), XP produces an error message like "unrecognized
command". I can easily get around the latter but I can't live w/o 1. and
2.

Are there any substitutes or workarounds for the above two? Would it be
possible, at least in case 1., to place a DOS 6 or 7 version
"CHOICE.COM" in System32 folder and hope for the best? maybe in
conjunction w/ "setver" in config.nt?

Another problem is that XP won't recognize batch files as "DOS
programs", resulting in loss of ability to set some of the important
properties up in the 'Properties' window and which now only show up for
a "... .com" or an "... .exe" file.

Any info greatly appreciated,

Ted... ( (e-mail address removed)[delete_this_suffix] )
 
Thanks again, gents, for your input. Let me digest for while and follow up.
Let you know. Meanwhile, I got me another little problem posted under
"Won't remember Explorer window size".

Appreciate,

--
Ted...


Wesley Vogel said:
There is....

Unavailable MS-DOS Commands

rest deleted to keep the charges down...
 
Back
Top