Loading ...
Sorry, an error occurred while loading the content.
 

Re: [BATCH WORLD] re : getting a batchfile to prompt user for a password

Expand Messages
  • stevepoirier
    This is a link to gawk which should work in Win98. ftp.bu.edu/pub/mirrors/simtelnet/gnu/djgpp/v2gnu/gwk311b.zip Steve ... wife version 1.0 preferring you ...
    Message 1 of 2 , Aug 9, 2002
      This is a link to gawk which should work in Win98.

      ftp.bu.edu/pub/mirrors/simtelnet/gnu/djgpp/v2gnu/gwk311b.zip

      Steve


      --- In batchworld@y..., Jon Sinck <jonsinck@y...> wrote:
      >
      > how about the chioce command?
      > Cecilio Morales wrote:Been enjoying your posts and humor (esp.
      wife version 1.0 preferring you
      > to download porn to making more batches) and the particular
      masterpiece
      > below calls for some questions.
      >
      > Is AWK or GAWK available for Win 98 (I use SE at home and in
      office)? I
      > thought this was Unix stuff.
      >
      > Windows scripting has me puzzled. You're using a vbs and on the
      > Microsoft site they push js and there's also another I can't
      remember.
      >
      > Then there's rexx and regina.
      >
      > And, of course, QB (or even GWBasic) and Qbasic etc.
      >
      > This being the case, of great guru (this goes for Michael, too)
      which
      > language is the easiest step from batch for performing tasks that
      twist
      > batches into pretzels (or spaghetti) and where does one go about
      getting
      > it and finding out about it?
      >
      >
      >
      > Bob Bissinnar wrote:
      > > At 01:25 PM 7/1/2002 +0100, Derek Byrne Writes
      > >
      > >> I'm wondering if its possible to get a batch file to prompt a
      user for an
      > >>input, and take that input and use it in the rest of the batch
      file.
      > >> So far, I have the following batch file setup, but it requires
      me to edit
      > >>the batch file first to update the password.
      > >
      > >
      > > Greetings Derek,
      > >
      > > I enjoy putting scripts in my batches to prompt for input and
      have listed below
      > > some that I've used in the past.
      > >
      > > I want to point out that I use Win98 and I am the only user so I
      have not
      > > tested
      > > these batch files in other OS's or with multiple users. (I do
      this for fun!)
      > >
      > > Maybe one of these days I'll move up to W2k and made use of the
      batch
      > > enhancements
      > > as demonstrated in Michael Marquart's example. <grin>
      > >
      > > My personal favorite is Timo Salmi's use of Qbasic for a password!
      > >
      > > Good luck and best wishes!
      > >
      > > ####### Using AWK OR GAWK
      > > @echo off
      > > echo Type Your Password and Press Enter:
      > > awk "BEGIN{getline;print \"set pwd=\"$0;exit}">%temp%.\_tmp$$$.bat
      > > for %%c in (call del) do %%c %temp%.\_tmp$$$.bat
      > > echo Your Password is [%pwd%]
      > > set pwd=
      > >
      > > ####### Using Qbasic
      > > ::Timo Salmi's Batch Faq. Source Item #148
      > > ::ftp://ftp.garbo.uwasa.fi/pc/link/tsbat.zip
      > > @echo off
      > > echo %0 | find /i ".bat" > nul
      > > set prog_=%0
      > > if errorlevel==1 set prog_=%0.bat
      > > set skip=
      > > find "'Q%skip%B" <%prog_% > tmp$$$.bas
      > > goto _jump
      > > PRINT "Type Your Password and Press Enter: "; 'QB
      > > DO UNTIL 1 = 2 'QB
      > > LET a$ = INKEY$ 'QB
      > > IF NOT LEN(a$) = 0 THEN 'QB
      > > IF ASC(a$) = 13 THEN GOTO 1 'QB
      > > PRINT "*"; 'QB
      > > LET w$ = w$ + a$ 'QB
      > > END IF 'QB
      > > LOOP 'QB
      > > 1 OPEN "tmp$$$.bat" FOR OUTPUT AS #1 'QB
      > > PRINT #1, "@set pwd=" + w$ 'QB
      > > CLOSE #1 'QB
      > > SYSTEM 'QB
      > > :_jump
      > > qbasic /run tmp$$$.bas
      > > call tmp$$$.bat
      > > echo.
      > > cls
      > > echo Your Password is [%pwd%]
      > > for %%f in (tmp$$$.bas tmp$$$.bat) do if exist %%f del %%f
      > > for %%v in (prog_ pwd) do set %%v=
      > >
      > > ####### Using FC
      > > @echo off
      > > ::Adaptation of a routine by Tom Lavedas to get user input. Source
      > > ::http://www.pressroom.com/~tglbatch/
      > > echo Type Your Password and Press Enter:
      > > fc con nul /LB1 /n |date |find "1:"> %temp%.\set_pwd.bat
      > > echo :loop > %temp%.\enter.bat
      > > echo set pwd=%%5>> %temp%.\enter.bat
      > > echo SHIFT >> %temp%.\enter.bat
      > > echo if not "%%5"=="" goto loop >> %temp%.\enter.bat
      > > path> %temp%.\tmp_path.bat
      > > path %temp%.\;%path%
      > > for %%c in (call del) do %%c %temp%.\set_pwd.bat
      > > for %%c in (call del) do %%c %temp%.\tmp_path.bat
      > > del %temp%.\enter.bat
      > > echo Your Password is [%pwd%]
      > > set pwd=
      > >
      > > ####### Using SED
      > > ::Batch file will not run with sed15, I used
      > > ::sed302b ren to sed.exe
      > > ::ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/sed302b.zip
      > > @echo off
      > > echo Type Your Password and Press Enter:
      > > sed -n "s/^/Set pwd=/p;q">%temp%.\_tmp$$$.bat
      > > for %%c in (call del) do %%c %temp%.\_tmp$$$.bat
      > > echo Your Password is [%pwd%]
      > > set pwd=
      > >
      > > ####### Using Win95cmd
      > > @echo off
      > > echo.@set /P input=Type Your Password and Press Enter: >%
      temp%.\input.bat
      > > echo.@e... pwd=%%input%%%%"%%>%%"%%%temp%.\_marker$.bat>>%
      temp%.\input.bat
      > > win95cmd /c %temp%.\input.bat
      > > call %temp%.\_marker$.bat
      > > echo Your Password is [%pwd%]
      > > for %%a in (%temp%.\_marker$ %temp%.\input) do if exist %%a.bat
      del %%a.bat
      > > set pwd=
      > >
      > > ####### Using Windows Scripting
      > > ::Source http://www.fpschultze.de/bsh.htm#a14
      > > ::Frank-Peter Schultze
      > > @echo off
      > > set amp=&
      > > if '==%amp%' set amp=^^^&
      > > echo wscript.echo "set pwd=" %amp% inputbox("Type Your Password
      and Press
      > > Enter or Click OK","Password")>%temp%.\$tmpo.vbs
      > > cscript //nologo //I %temp%.\$tmpo.vbs > %temp%.\$tmpo.bat
      > > call %temp%.\$tmpo.bat
      > > del %temp%.\$tmpo.*
      > > echo Your password is %pwd%
      > > for %%a in (amp pwd) do set %%a=
      > >
      > >
      > >
      > >
      > > [Non-text portions of this message have been removed]
      > >
      > >
      > > To Post a message, send it to: batchworld@e...
      > >
      > > To Unsubscribe, send a blank message to: batchworld-
      unsubscribe@e...
      > >
      > > Your use of Yahoo! Groups is subject to
      http://docs.yahoo.com/info/terms/
      > >
      > >
      > >
      >
      >
      >
      > --
      > Cecilio Morales
      > Publisher
      > MII Publications
      > 733 15th Street NW, Suite 900
      > Washington, D.C. 20005-2112
      >
      > voice: 202-347-4822
      > fax: 202-347-4893
      >
      > http://www.miipublications.com
      >
      >
      > Yahoo! Groups Sponsor
      > To Post a message, send it to: batchworld@e...
      >
      > To Unsubscribe, send a blank message to: batchworld-
      unsubscribe@e...
      >
      > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      Service.
      >
      >
      >
      > ---------------------------------
      > Do You Yahoo!?
      > HotJobs, a Yahoo! service - Search Thousands of New Jobs
      >
      > [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.