Page 1 of 1 1
Topic Options
#58901 - 2001-09-07 04:09 AM Questions at login
Anonymous
Unregistered


I'm trying to create a login script that prompts the user to enter predefined keywords eg. "acrobat", "nav", "notes" which then stores the users input into a sequential text file eg.

acrobat
nav
notes

The text file can then be read by another script, which given the contents of the text file, loads applications eg. "acrobat" loads the acrobat reader installation. see my previous post "deployment scripts"

I have already got the second script reading from the text file, but I need some help in creating the text file from login??

I've pulled down the following code from http://www.robvanderwoude.com and it creates a temporary file from the user input, but only allows one line to be entered.

:: Create a temporary Kix script that will
:: in turn create a temporary batch file:
> %TEMP%.\UserIn.kix ECHO REDIRECTOUTPUT( "NUL" )
>>%TEMP%.\UserIn.kix ECHO GETS $UserIn
>>%TEMP%.\UserIn.kix ECHO IF OPEN( 1, "@SCRIPTDIR\UserIn.bat", 5 ) = 0
>>%TEMP%.\UserIn.kix ECHO WRITELINE( 1, "SET UserIn=" + $UserIn )
>>%TEMP%.\UserIn.kix ECHO ELSE
>>%TEMP%.\UserIn.kix ECHO ? "Error opening temporary file, errorcode = " + @ERROR
>>%TEMP%.\UserIn.kix ECHO ENDIF
:: Prompt for user input:
ECHO Type anything you like and press Enter when finished:
:: retrieve user input using the Kix script, and
:: then store the result in a temporary batch file:
if
KIX32.EXE %TEMP%.\UserIn.kix
:: Call the temporary batch file to store
:: the result in an environment variable:
CALL %TEMP%.\UserIn.bat
:: Clean up the temporary files:
IF EXIST %TEMP%.\UserIn.* DEL %TEMP%.\UserIn.*
:: Finaly, display the result:
ECHO You typed: %UserIn%

Is it possible to edit this file so it allows for mulitple line entries which creates a text file or am I better off editing my "deployment script" to read the one line created in the temporary file and for each space within the string ("acrobat nav notes")pass the text into an array and then create a text file from the array??? The reason I need a text file is because some of the applications need the pc to restart, so by having a text file of programs to install, when the pc is rebooted the login script reads the text file which saves the user needing to re-type the applications they want installed.

I also need flag that tells the login script that a the text file has been created so dont prompt the user for input...a simple "if exists" should to the trick.

Any help would be greatly appreciated.

Top
#58902 - 2001-09-07 05:47 AM Re: Questions at login
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Alowing free-form user input... You must have better users than I. Mine have trouble finding the "any" key.

Better I think, to take a peek in the reg to see if prog installed and then toss up a MessageBox with a simple Yes/No. I cxan't imagine you'd want to do more than one install per logon anyway. Even if you wanted to you could call them serially.

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#58903 - 2001-09-07 07:05 AM Re: Questions at login
Anonymous
Unregistered


LLigetfa,

I guess I should have explained the purpose of my script a little. Its actually only for myself and other admins. It'll be used to setup p/c's from scratch. basically just saving a bit of time and hassle of installing each program individually.

The message box is a good idea and I'm testing out right now as you read this.

Cheers
Jezz

Top
#58904 - 2001-09-07 07:12 AM Re: Questions at login
Anonymous
Unregistered


Message boxes work fine, but I'd still like a little less interaction from me so I can basically walk away and it'll do its thing. With msg boxes I have to still be there to select yes or no. I really want something that I can define at the start during login and not do anything untill all the programs are installed.

Jezz

Top
#58905 - 2001-09-07 04:03 PM Re: Questions at login
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
OK, I get it. There's a sample menu that shipped with KIX called test.kix you should look at. It has a console based menu in it. Wouldn't be too hard to make it stuff choices into your file.

You could sill do the same thing with MessageBox. Just call it for each option; catch the Y/N; stuff your file; call it for next option; etc.

Personally, I hate console based stuff, preferring GUI. I can see though where char based could be a fracton of a second quicker.

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#58906 - 2001-09-07 10:50 PM Re: Questions at login
Paul_Berquam Offline
Hey THIS is FUN

Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
From your description I'm assuming that you (the admins) are logging into these machines, then going to a share that only you have access to and then running this install script? If so, then why don't you just set up an INI file that has a listing of the programs available and pull from that (readprofilestring). That way you just have to insert the program information there instead of having to mod the script code every time there's a program change or new entry. Plus this will keep your size down substantially.
_________________________
He was a good little monkey and always very curious...

Top
#58907 - 2001-09-10 07:33 AM Re: Questions at login
Anonymous
Unregistered


I think I know what your trying to say Paul, and yes your assumptions are correct. I haven't had much experience in INI files so how do I go about creating the INI file you are describing.

By not modifying the scipt and putting the info into an ini file haven't I still got the same amount of data required by the script, but just split up into different file locations.

Jezz

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 978 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.052 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org