Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
"Choice" alternative for NT
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Phil Robyn  
View profile  
 More options Mar 2 2001, 4:06 pm
Newsgroups: alt.msdos.batch.nt
From: Phil Robyn <pro...@uclink.berkeley.edu>
Date: Fri, 02 Mar 2001 13:04:21 -0800
Local: Fri, Mar 2 2001 4:04 pm
Subject: Re: "Choice" alternative for NT

romeynj wrote:
> I have a script that works fine for Win95/98, however it needs to be
> modified to also work for NT/2000. The script currently uses the "choice"
> command to ask the user several questions. Based on their responses,
> different version of software are then installed onto their machines. Can
> any of you point me in the right direction to find some information on
> alternatives for using "choice"? Thanks for any help you can give.

You can copy CHOICE from Win95/98 to c:\winnt\system32 and it
will work.  However, in NT/2000 you should ONLY use it for capturing
single-keystroke responses from the user in an interactive process.
Don't use it in a non-interactive process as a method of delaying up
to 99 seconds.  You must avoid using it as a delay because, in the
multi-tasking environment of NT/2000, sooner or later two or more
concurrent instances of CHOICE (one interactive waiting for user
input, one or more non-interactive delays) will execute and they will
all clobber each other; you will never be able to figure out what happened.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil Robyn  
View profile  
 More options Mar 2 2001, 4:36 pm
Newsgroups: alt.msdos.batch.nt
From: Phil Robyn <pro...@uclink.berkeley.edu>
Date: Fri, 02 Mar 2001 13:34:40 -0800
Local: Fri, Mar 2 2001 4:34 pm
Subject: Re: "Choice" alternative for NT

romeynj wrote:
> Thanks for the suggestion.  However, I don't always know what OS the user is
> using when running the script (It could be 95, 98, NT or 2000).  We're
> trying to make the script as seamless as possible without requiring the user
> to load additional code to his machine before continuing with execution of
> the script.  Is there an alternative to using choice?

You mean a single alternative, other than CHOICE, that works on any version
of Windows?  I can't think of one....  Why not have your script determine
which environment the user is in?  If it's Win2000, you can use 'SET /P' to
read input.  If it's NT4.0, you can use a batch file to get user input.  Otherwise,
assume that the environment is Win9x and that CHOICE is available.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
lab  
View profile  
 More options Mar 2 2001, 10:20 pm
Newsgroups: alt.msdos.batch.nt
From: l...@bounceit.net
Date: Fri, 02 Mar 2001 22:07:36 -0500
Local: Fri, Mar 2 2001 10:07 pm
Subject: Re: "Choice" alternative for NT

How about "ASK" from Norton??
Or search the web or search zdnet?

LB


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil Robyn  
View profile  
 More options Mar 3 2001, 3:29 am
Newsgroups: alt.msdos.batch.nt
From: Phil Robyn <pro...@uclink.berkeley.edu>
Date: Sat, 03 Mar 2001 08:26:19 GMT
Local: Sat, Mar 3 2001 3:26 am
Subject: Re: "Choice" alternative for NT

I think the original poster said he didn't want any third-party software.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Walter Briscoe  
View profile  
 More options Mar 6 2001, 12:36 pm
Newsgroups: alt.msdos.batch.nt
From: Walter Briscoe <wbris...@ponle.demon.co.uk>
Date: Tue, 6 Mar 2001 08:36:49 +0000
Local: Tues, Mar 6 2001 3:36 am
Subject: Re: "Choice" alternative for NT
In article <3AA00AD5.AD7A4...@uclink.berkeley.edu> of Fri, 2 Mar 2001
13:04:21 in alt.msdos.batch.nt, Phil Robyn <pro...@uclink.berkeley.edu>
writes

I am interested in your remarks about concurrency.
Is this experience or can you point to a URL giving the experience.
What is the mechanism? Why the different behavior?
--
Walter Briscoe

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil Robyn  
View profile  
 More options Mar 6 2001, 1:08 pm
Newsgroups: alt.msdos.batch.nt
From: Phil Robyn <pro...@uclink.berkeley.edu>
Date: Tue, 06 Mar 2001 10:08:29 -0800
Local: Tues, Mar 6 2001 1:08 pm
Subject: Re: "Choice" alternative for NT

This is experience gained from attempting to synchronize two separate
but interrelated processes, each utilizing CHOICE to effect a fixed-length
delay to wait for the other to complete an action.  The invocation of
CHOICE by the second process clobbers the CHOICE previously
invoked by the first process.  In a multi-tasking system there can be
any number of processes running simultaneously; however, there seems
to be only one keyboard buffer....

Example:  Process A writes frequent messages to a log file, and Process
B (see retail.cmd below) displays the last n lines of the log file every
so many seconds.  If line 38 below is changed to utilize CHOICE to
implement the delay, the process will be clobbered as soon as any
other CHOICE command is issued by another process.  If a TEST
version of Process A (the process that writes entries to the file that
is being monitored by Process B) is implemented using CHOICE to
effect a delay, then the 'clobbering' behavior will be immediately
demonstrated.

==========begin file C:\cmd\TEST\retail.cmd ==========
001. @echo off
002. if [%1]==[?]  goto :syntax
003. if [%1]==[/?] goto :syntax
004. if not exist "%2" goto :nofile
005. goto :begin
006. :nofile
007. echo File "%2" does not exist.
008. echo.
009. echo                  Press any key to EXIT.
010. pause > nul
011. goto :EOF
012. :syntax
013. echo.
014. echo %0 - run tail every x seconds
015. echo.
016. echo syntax:  RETAIL {num of seconds} {file name} {num of lines}
017. echo.
018. echo usage:   to monitor the 'tail' of a file (e.g., a system log file)
019. echo          in a separate console window.  To start the separate
020. echo          console, type the following command at the CMD prompt:
021. echo.
022. echo     start cmd /c c:\cmd\test\retail.cmd 5 \\bai3\data\bfs\ctmajf.log 10
023. echo.
024. echo where '5' is the number of seconds between displays
025. echo       '\\bai3\data\bfs\ctmajf.log' is the file being monitored
026. echo       '10' is the number of lines to be displayed from the end
027. echo            of the file
028. echo.
029. goto :EOF
030. :begin
031. title monitoring file %2
032. set /a conlines = %3 + 2
033. mode con lines=%conlines% cols=100
034. color 1e
035. :LOOP
036. cls
037. call tail %2 %3
038. call c:\cmd\util\wait %1
039. goto :LOOP
040. :EOF
041.
==========end   file C:\cmd\TEST\retail.cmd ==========

The called TAIL command is
==========begin file C:\cmd\TEST\tail.cmd ==========
001. @echo off
002. ::
003. :: show tail of {file} [ for {nnn} lines ]
004. ::
005. if [%1]==[] echo You must enter a file name.&goto :EOF
006. if not exist %1 echo File %1 does not exist.&goto :EOF
007. setlocal
008. set /a lines=%2
009. if not defined lines set /a lines=15
010. call wccount %1
011. if %lines% GTR %wccount% set /a lines=15
012. if %lines% GTR %wccount% set startline=1&goto :display
013. set /a startline = wccount - lines
014.
015. :display
016. more /e +%startline% %1
017. endlocal
==========end   file C:\cmd\TEST\tail.cmd ==========

The called WCCOUNT command is
==========begin file C:\cmd\TEST\wccount.cmd ==========
001. @echo off
002. ::
003. :: new reccount using 'wc' from the Resource Kit
004. ::
005. if not exist %1 goto :NoFile
006. setlocal
007. set infile=%1
008. for /f "tokens=1* delims= " %%a in (
009.  'wc %1'
010. ) do set recs=%%a
011. if "%2"=="." (
012.   echo File %1 contains %recs% records.
013. )
014. endlocal&set %~n0=%recs%&goto :EOF
015. :NoFile
016. echo. File %1 does not exist.
017. goto :EOF
018. :EOF
019.
==========end   file C:\cmd\TEST\wccount.cmd ==========


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »