Page 1 of 1 1
Topic Options
#70481 - 2002-10-02 05:42 PM program install
Anonymous
Unregistered


Trying to do a silent install on specific machines. I need to search in a text file for a machine name and if the name is there then run a .exe. I am sure this script has been written but can't find it. More than likely my lack of knowledge. Thanks for the help.

Jural

Top
#70482 - 2002-10-02 05:45 PM Re: program install
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Setup a file in INI format and use ReadProfileString() and WriteProfileString(). THey are well documented in the manual as well as a ton of examples on this board.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#70483 - 2002-10-02 07:05 PM Re: program install
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You can also SHELL out and use the FIND command. Please go to a command prompt and type 'FIND /?' to see the syntax.
_________________________
There are two types of vessels, submarines and targets.

Top
#70484 - 2002-10-02 07:27 PM Re: program install
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I will often use an uninstall reg key/value to see if an app is installed rather than rely on a text file. We scrub and re-ghost machines often and don't like having to manage a text file.

If it's not for broad distribution then an include list is fine. For broad distribution, I use an exclude list. Either way, I may include the reg key check as well.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#70485 - 2002-10-03 02:53 PM Re: program install
Anonymous
Unregistered


The reg would work but I only need the software loaded on certain machines. It is an app to protect the machine from changes being made. I looked into the readprofilestring command. I currently use writeprofilestring in mt login script. I am still uncertain as to how I should use readprofilestring to look for a certain line of text in the file. I will use @WKSTA to compare to the list. I just don't know how to make the script look through the entire file. Thanks for the help on this.

Jural

Top
#70486 - 2002-10-03 03:12 PM Re: program install
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
ReadProfileString won't help you if the file is not a .INi file. In order to find a string in an arbitrary text file, you can use the shell FIND command or read the text file with READLINE and check every line whether it contains the workstation's name.
_________________________
There are two types of vessels, submarines and targets.

Top
#70487 - 2002-10-03 03:17 PM Re: program install
Anonymous
Unregistered


Sorry for the typo. I am using an .ini file format.
Top
#70488 - 2002-10-03 03:18 PM Re: program install
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well, if you use Write..., Read... is just one less parameter.

They are APIs meaning that you just call them aand they sort out the where part. You don't need to search through the file, the API does that.

I then have to assume you don't understand the anatomy of an INI file.

An INI first off hase a filename. You should specify the full path to the INI.

Within the file, you have "Sections". They are the ones with [square brackets].

Within each section you have "Keys". They are on the left side of the '=' and the values are on the right.

If a Key does not exist, it will be created if you assign a value to it.

So then... setup an INI file on a share with write rights. Create a section [Computers] and add keys for every computer you want to include or exclude, depending on positive or negative logic. If you want to track progress you can also create sections for each computer and keys beneath them to flag.

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

Top
#70489 - 2002-10-03 03:32 PM Re: program install
Anonymous
Unregistered


That was it. I guess a little knowledge never hurt anyone. Thanks for all of the help.

Jural

Top
#70490 - 2002-10-03 04:07 PM Re: program install
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I don't know... always heard that a "little knowledge is dangerous"... [Wink]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

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 2630 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.062 seconds in which 0.029 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