Re: DOS Script for pop up question ?

2002-07-12 Thread Bob Robert

Thanks for the Oracle list members who responded very
promptly for my question. At the moment, I am very
satisfied with pause command.

I have one more question for the DOS Gurus.

Is there a way to change the fond size from the DOS
Script ?

Thanks,
Bob

--- James J. Morrow [EMAIL PROTECTED] wrote:
 
 
 Bob Robert wrote:
  
  All,
  
  I have a DOS batch file. In between this script, I
  would like to add user interactive question.
  
  Ex: Do you want to Continue [Y/N]?
  
  Once they hit Y, it will continue rest of the
 batch
  file.
  
  Could someone able to help me out as per the above
  requirement?
  
  Thanks,
  Bob
 
 Well, the simplest answer would be to use the
 Pause command.  This assumes, of
 course, that you don't really care what key they
 press...
 simply:
 
 echo Hit Control-C to abort or...
 pause
 
 Will return:
 
 Hit Control-C to abort or...
 Press any key to continue
 
 I'm pretty sure that the DOS batch language
 doesn't have any get keystroke
 functionality built-in.  However, the CMD language
 might.
 
 A search on google for dos cmd batch get

(http://www.google.com/search?sourceid=navclientq=dos+cmd+batch+get)
 yields
 this link:
 
 http://www.simtel.iif.hu/pub/msdos/batchutl/
 
 Which has a whole slew of MS-DOS based utilities. 
 I'm sure one of them would
 have a little *.exe that would read a line or a
 character from stdin.
 
 Additionally, you could consider Cygnus for
 Windows (aka Cygwin) available
 through redhat.com.  Cygwin is a Windows tool that
 gives you Unix
 functionality.  Including some of the popular unix
 shells for scripting (Bash,
 Tcsh).  This product (free, as in beer) provides the
 same functionality as the
 (much more expensive) MKS Toolkit (available from
 MKS Software...
 http://www.mks.com).  The MKS toolkit is required
 for Oracle Applications 11i on
 MS Windows NT/2000.  
 

http://freshmeat.net/projects/cygwin/?topic_id=45%2C74
 or
 http://cygwin.com
 
 -- James


 James J. Morrow
 E-Mail:  [EMAIL PROTECTED]
 Senior Principal Consultant
 Tenure Systems, Inc.
 McKinney, TX, USA
 
 The reasonable man adapts himself to the world: 
 the unreasonable man
   persists in trying to adapt the world to himself. 
 Therefore all progress
depends on the unreasonable man.  -- George
 Bernard Shaw
 -- 
 Please see the official ORACLE-L FAQ:
 http://www.orafaq.com
 -- 
 Author: James J. Morrow
   INET: [EMAIL PROTECTED]
 
 Fat City Network Services-- (858) 538-5051  FAX:
 (858) 538-5051
 San Diego, California-- Public Internet
 access / Mailing Lists


 To REMOVE yourself from this mailing list, send an
 E-Mail message
 to: [EMAIL PROTECTED] (note EXACT spelling of
 'ListGuru') and in
 the message BODY, include a line containing: UNSUB
 ORACLE-L
 (or the name of mailing list you want to be removed
 from).  You may
 also send the HELP command for other information
 (like subscribing).


__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Bob Robert
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



RE: DOS Script for pop up question ?

2002-07-12 Thread Sherman, Edward

I'm not a windows guy but I think you should quit writing DOS batch files
and use VBScript instead.

I think if you look in any windows magazine you will see VBScript listings
instead of batch file listings.

VBScript is powerful like Perl and handles pop up windows well.

VBScript doesn't seem to email very well, however, because an earlier post I
sent contained a simple VBScript demo in the body of the email and it got
bounced from ORACLE-L because it contained a virus signature.


So here's a link to some simple code you can try:
http://www.devguru.com/Technologies/wsh/quickref/wshshell_Popup.html

Save the code to a file with a .vbs extension and click the resulting icon.

You can get a book or search the web for code snippets like I do.

Have fun!
Ed


- Original Message - 
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Sent: Thursday, July 11, 2002 4:37 PM


 All,
 
 I have a DOS batch file. In between this script, I
 would like to add user interactive question.
 
 Ex: Do you want to Continue [Y/N]?
 
 Once they hit Y, it will continue rest of the batch
 file.
 
 Could someone able to help me out as per the above
 requirement?
 
 Thanks,
 Bob
 
 
 
 __
 Do You Yahoo!?
 Sign up for SBC Yahoo! Dial - First Month Free
 http://sbc.yahoo.com
 -- 
 Please see the official ORACLE-L FAQ: http://www.orafaq.com
 -- 
 Author: Bob Robert
   INET: [EMAIL PROTECTED]
 
 Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
 San Diego, California-- Public Internet access / Mailing Lists
 
 To REMOVE yourself from this mailing list, send an E-Mail message
 to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
 the message BODY, include a line containing: UNSUB ORACLE-L
 (or the name of mailing list you want to be removed from).  You may
 also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Igor Neyman
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Sherman, Edward
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



Re: DOS Script for pop up question ?

2002-07-11 Thread Igor Neyman

You could use utility choice.exe (I think it comes with NT Resource Kit).
Here is an example of the batch file:

echo off
choice /c:YN Do you want to Continue ?
if errorlevel 2 goto end 

rem do whatever you need here
...
..
:end
echo End of processing.


Obviously N answer returns errorlevel 2.


Igor Neyman, OCP DBA
[EMAIL PROTECTED]
  


- Original Message - 
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Sent: Thursday, July 11, 2002 4:37 PM


 All,
 
 I have a DOS batch file. In between this script, I
 would like to add user interactive question.
 
 Ex: Do you want to Continue [Y/N]?
 
 Once they hit Y, it will continue rest of the batch
 file.
 
 Could someone able to help me out as per the above
 requirement?
 
 Thanks,
 Bob
 
 
 
 __
 Do You Yahoo!?
 Sign up for SBC Yahoo! Dial - First Month Free
 http://sbc.yahoo.com
 -- 
 Please see the official ORACLE-L FAQ: http://www.orafaq.com
 -- 
 Author: Bob Robert
   INET: [EMAIL PROTECTED]
 
 Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
 San Diego, California-- Public Internet access / Mailing Lists
 
 To REMOVE yourself from this mailing list, send an E-Mail message
 to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
 the message BODY, include a line containing: UNSUB ORACLE-L
 (or the name of mailing list you want to be removed from).  You may
 also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Igor Neyman
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



Re: DOS Script for pop up question ?

2002-07-11 Thread James J. Morrow



Bob Robert wrote:
 
 All,
 
 I have a DOS batch file. In between this script, I
 would like to add user interactive question.
 
 Ex: Do you want to Continue [Y/N]?
 
 Once they hit Y, it will continue rest of the batch
 file.
 
 Could someone able to help me out as per the above
 requirement?
 
 Thanks,
 Bob

Well, the simplest answer would be to use the Pause command.  This assumes, of
course, that you don't really care what key they press...
simply:

echo Hit Control-C to abort or...
pause

Will return:

Hit Control-C to abort or...
Press any key to continue

I'm pretty sure that the DOS batch language doesn't have any get keystroke
functionality built-in.  However, the CMD language might.

A search on google for dos cmd batch get
(http://www.google.com/search?sourceid=navclientq=dos+cmd+batch+get) yields
this link:

http://www.simtel.iif.hu/pub/msdos/batchutl/

Which has a whole slew of MS-DOS based utilities.  I'm sure one of them would
have a little *.exe that would read a line or a character from stdin.

Additionally, you could consider Cygnus for Windows (aka Cygwin) available
through redhat.com.  Cygwin is a Windows tool that gives you Unix
functionality.  Including some of the popular unix shells for scripting (Bash,
Tcsh).  This product (free, as in beer) provides the same functionality as the
(much more expensive) MKS Toolkit (available from MKS Software...
http://www.mks.com).  The MKS toolkit is required for Oracle Applications 11i on
MS Windows NT/2000.  

http://freshmeat.net/projects/cygwin/?topic_id=45%2C74
or
http://cygwin.com

-- James

James J. Morrow E-Mail:  [EMAIL PROTECTED]
Senior Principal Consultant
Tenure Systems, Inc.
McKinney, TX, USA

The reasonable man adapts himself to the world:  the unreasonable man
  persists in trying to adapt the world to himself.  Therefore all progress
   depends on the unreasonable man.  -- George Bernard Shaw
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: James J. Morrow
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



RE: DOS Script for pop up question ?

2002-07-11 Thread Reardon, Bruce (CALBBAY)

Bob,

Is it really a DOS batch file or is it 95 or NT4 or W2K / XP - or does it need to run 
on all of them?
This is important as the options vary.

Anyway, below is a copy of a post I made in March 2002 describing some of the options:

HTH,
Bruce Reardon

In W2K it is easy, you can use set/p - type set/? to get the help and see below.
H:\set/p  fred=[input value for fred]
[input value for fred]oracleis?

H:\echo %fred%
oracleis?

H:\


Or you can call sqlplus and have sqlplus do the prompting and then have it host out to 
the bat file and pass in the parameters.
Or you could Perl or a Unix emulator or I imagine their are many shareware / freeware 
utilities.

Under NT4 other options are not easy and I have listed a number of ways and links that 
show how you can achieve this:

Or from a Tom Lavedas posting on the newsgroup alt.msdos.batch.nt
(dated Tue, 05 Jun 2001 09:04:04 -0400  entitled prompting for a parameter

Old problem - batches were initially assumed to run unattended -
therefore, there was no need for user interaction.  However, in the
PC/Windows environment, they are useful for scripting many redundant
tasks, even some that require/benefit user interaction.
 
MS finally added recognized this fact by adding the /P (prompt)
functionality to the SET statement in Win 2000 (but not before that).
So, if you are in a pure Win 2000 environment, type SET/? at a command
prompt to get information on the use of the /P switch.
 
If you are using NT 4 or are in a mixed NT/2000 environment, there is no
'perfect' solution.  I have been interested in the subject of user input
for a long time and have developed and collected various techniques,
which I offer for your consideration:
 
1.  Get a third party utility like, Strings.com from PC Magazine,
(e.g. see ftp://ftp.zdnet.com/pcmag/1992/1222/strings.zip) -
recently reported to be broken in NT.  A third party utility is
probably the most viable solution for use in Win NT, though
AFAIK all of the little utilities out there were written for
the original DOS (pre-NT).  See http://www.Simtel.net
 
2.  Another NT approach, posted by Bennett Benson, is explained at
this link:  http://www.jsiinc.com/TIP0300/rh0323.htm
[this doesn't seem to be working as at 1-Mar-2002]
 
3.  Write a Win Script Host script using the InputBox function
(requires Win 98, Win NT 4.0, IE 5 or a free download from MS),
 
For example ...
 
  Dim Input
  Input = InputBox(Enter your name)
  MsgBox (You entered:   Input)
 
(see http://msdn.microsoft.com/scripting/default.htm to get
started)
 
4.  A variation on the theme of 3 above is a hybrid WSH script/batch
function
 
:: InWSH.bat - A WSH/Batch hybrid string input routine.
:: Requires Windows Script Host version 1.0 or later.
:: Use optional command line argument UCASE to convert
:: input to all uppercase or LCASE for lowercase.
:: With WSH V2+, EVAL allows math operations, as well.
:: Tom Lavedas [EMAIL PROTECTED]
:: http://www.pressroom.com/~tglbatch/
 @echo off
  Set _T=%temp%\~tmp
  echo Set oFS=CreateObject(Scripting.FileSystemObject)%_T%.vbs
  Echo oFS.OpenTextFile(CON,2).Write Enter a string: %_T%.vbs
  echo S=%1(Trim(oFS.OpenTextFile(CON,1).Readline))%_T%.vbs
  echo Wscript.Echo set Input=+CStr(S)%_T%.vbs
  cscript.exe //nologo %_T%.vbs  %_T%.bat
  for %%v in (%_T%.bat del) do call  %%v %_T%.???
  set _T=
  % For Example % echo You typed %Input%
 
  If you call this with a single command line parameter of Ucase or
  LCase, it will return the string input by the user in the
  appropriate case.  If you have WSH v5.1+ and use EVAL as the command
  line argument, it will do math operations as well, as in 
 
C:\ inwsh eval
Enter a string: 11 * 12
You typed 132
 
  This approach will work with Win 98 and Win 2000 and probably NT
  right out of the box.
 
5.  In Win2K the following works:
 
  SET /P variable=[promptString]
 
6. Finally, this NT specific approach, originally given by Walter
   Zachery, improved and supplied by Clay Calvert, 
 
  @echo off
  echo.
  echo Enter Input:
  for /f tokens=* %%a in (
'format/f:160 a: ^|find ...') do set Input=%%a
  set Input=%Input:~30%
 
  This approach will spin the floppy drive, but won't change
  anything.  The drive does not need to be occupied.
---
 
Tom Lavedas http://www.pressroom.com/~tglbatch/



I have seen a web site showing how to do it using label (similar to the format 
command).
 
You Can also use choice command - available from 
ftp://ftp.microsoft.com/Services/TechNet/Windows/msdos/RESKIT/suppdisk/choice.com

And from another alt.msdos.batch.nt posting:

Date:   Tue, 20 Feb 2001 16:28:40 -0800 
...
Here's one way that will work in WinNT4.0.  If you are using Win2000,
you can use 'SET /P' instead.
 
==begin file C:\cmd\TEST\ZZZINPUT.CMD ==
001.