Page 1 of 1 1
Topic Options
#38776 - 2003-04-04 10:10 AM Dos and Kixtart
cellnet Offline
Starting to like KiXtart

Registered: 2002-02-26
Posts: 115
Loc: Sweden
Hallo

I have a couple of old PC that Im using as thin dos clients with the citrix client.

I have 3 diffrent applications. Desktop, Internet Explorer and Movex.

I have collected the mac address's in a txt file, that the client reads at boot.

code:
? "My Macaddress =  @address" ? ?

IF Open(3, "t:\movex.txt") = 0
$x = ReadLine(3)
WHILE @ERROR = 0
? "Line read: [" + $x + "]"
$x = ReadLine(3)
IF $x = "@address"
?"Starting MOvex....."
shell "t:\runapp.bat movex"
Close (3)
exit
quit
endif
LOOP
Close (3)
ELSE
BEEP
? "Config file not opened, error code: [" + @ERROR + "]"
ENDIF
exit

It works.

But how do I do if the client are supposed to start Desktop or IE.

Regards
\erik

Top
#38777 - 2003-04-04 03:12 PM Re: Dos and Kixtart
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
erik,

It really sounds like you are in a position where you need a lock-down policy. That is, you restrict the usage of what the client runs.

Look into the use of Policy Editor or GPO (Group Policy Objects). These are, of course, from Microsoft.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#38778 - 2003-04-07 08:46 AM Re: Dos and Kixtart
cellnet Offline
Starting to like KiXtart

Registered: 2002-02-26
Posts: 115
Loc: Sweden
The right to start a application is controlled by citrix, and NT rights.

Im using kixtart.exe, not kix32.

I would like kix to search the txt or ini file until it finds a match, and from that start the correct application.

Ex
[movex]
9q23829382

[Internet Explorer]
2343299

\erik

Top
#38779 - 2003-04-07 05:48 PM Re: Dos and Kixtart
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
READPROFILESTRING, however, not sure whether that's part of KiXtart 2.33
_________________________
There are two types of vessels, submarines and targets.

Top
#38780 - 2003-04-08 04:09 PM Re: Dos and Kixtart
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
READPROFILESTRING doesn't exist in kix2.33 but you can just extend what you are doing except put in an extra if test. Check each string for "[movex]", etc. As you encounter each app, set a toggle so you know which list you found it in.

Also I don't think the command "quit" is a kix2.33 command & I also think the command "exit" shuts down the current script right in the middle of your 2 if tests. Do you want to do this?
_________________________
Jack

Top
#38781 - 2003-04-10 04:08 PM Re: Dos and Kixtart
cellnet Offline
Starting to like KiXtart

Registered: 2002-02-26
Posts: 115
Loc: Sweden
A update

Kixtart script first

code:
 ; Script begins
cls
COLOR w+/b
; Ta bort startbara filer
SHELL "a:\COMMAND.COM /C del a:\net\net.exe"
SHELL "a:\COMMAND.COM /C del a:\autoexec.bat >nul"

flushkb
? "My Macaddress = @address"
sleep 10

IF Open( 3 , "T:\movex.txt" ) = 0

$x = ReadLine( 3 )
WHILE @ERROR = 0
IF $x = "@address"
:movex
? "MacAddress Match, starting Movex"
sleep 2
run "t:\runapp.bat movex"
exit
quit
ENDIF
$x = ReadLine( 3 )
LOOP
ENDIF

:desktop
? "No Match, starting Desktop"
run "t:\runapp.bat desktop"
exit
quit

:END

exit
quit

the "run..." sends variable to runapp.bat

code:
 @echo off
:START
cls
Echo Logging in to %1...
Echo.
@echo off
t:
cd wfclient
vsl >nul
t:\wfclient\wfclient.exe %1
goto START
:END

Jack, do you mean something like:
Content of movex.txt
*
movex00D0B768A5DB
ie03424331233
*

Please explain

\regards
erik

Top
#38782 - 2003-04-10 08:14 PM Re: Dos and Kixtart
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
If your lookup file is in INI format as you outlined above, then I was thinking of something like this:

code:
; Script begins
cls
COLOR w+/b
; Ta bort startbara filer
SHELL "a:\COMMAND.COM /C del a:\net\net.exe"
SHELL "a:\COMMAND.COM /C del a:\autoexec.bat >nul"

flushkb
? "My Macaddress = @address"
sleep 10

IF Open( 3 , "T:\movex.ini" ) = 0
$apps = ""
$fnd = 0
$x = ReadLine( 3 )
WHILE (@ERROR = 0 and $fnd=0)
If (INSTR( $x , "movex" )>0)
$apps="movex"
Else
If (INSTR( $x , "Internet Explorer" )>0)
$apps="IE"
Else
If (INSTR( $x , "Desktop" )>0)
$apps="Desktop"
Endif
Endif
Endif
IF $x = @address
$fnd=1
ENDIF
$x = ReadLine( 3 )
LOOP
Close ( 3 )
If ($apps="")
? "Error - Readings Apps file - No Apps Sections found"
Else
If ($fnd=0)
? "Error - Address not found in list"
Endif
Endif
Else
? "Error - App file not opened, error code : [" + @ERROR + "]"
ENDIF
If ($fnd>0 and $apps<>"")
shell "t:\runapp.bat " + $apps
Endif
Exit

Please note, I haven't tested this script & I haven't used version 2.33 for a while so it could have some bugs.

[ 10. April 2003, 20:19: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#38783 - 2003-04-11 10:20 AM Re: Dos and Kixtart
cellnet Offline
Starting to like KiXtart

Registered: 2002-02-26
Posts: 115
Loc: Sweden
How will the movex.ini file look like

I have tested several layouts

code:
 [MOvex]
0002A5BE048D0
0002A5BE048D0MOVEX
0002A5BE048D0"MOVEX"
0002A5BE048D0,MOVEX
Movex,0002A5BE048D0
"Movex",0002A5BE048D0
Movex0002A5BE048D0
"Movex"0002A5BE048D0

No match

No error messages

Thanks for the reply

\erik

Top
#38784 - 2003-04-11 10:22 AM Re: Dos and Kixtart
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ini-file is in format:
quote:

[section]
valuename=value
anothervaluename=yetanothervalue

[anothersection]
valuename=value

_________________________
!

download KiXnet

Top
#38785 - 2003-04-11 11:12 AM Re: Dos and Kixtart
cellnet Offline
Starting to like KiXtart

Registered: 2002-02-26
Posts: 115
Loc: Sweden
[Movex]
0002A5BE048D0=Movex
0002A5BE048D0="Movex"
Movex="0002A5BE048D0"
"Movex"=0002A5BE048D0

Also tested this layout = no match

\erik

Top
#38786 - 2003-04-11 04:53 PM Re: Dos and Kixtart
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Your second post suggested the lookup file was INI like so I assumed this. My code assumes that an @address value will only occur once in the file & it will appear under 1 of 3 different lists. If these assumptions are incorrect the logic may need to be modified. I assume an INI file something like this:

code:
[movex]
add1=value1 (i.e value1=0002A5BE048D0=an address)
add2=value2
etc

[Desktop]
add1=value3
add2=value4
etc

[Internet Explorer]
add1=value5
add2=value6
etc

All the "values" are assumpted to be unique. As written it does not have to be in exactly INI format. It just needs all the possible address divided into 3 lists headed by app name.

Note: I assume that "movex", "Desktop", & "Internet Explorer" will only occur once in the file & they must be at the top of each address list. This seemed to be the format you initially proposed.

[ 12. April 2003, 18:01: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#38787 - 2003-05-15 03:29 PM Re: Dos and Kixtart
cellnet Offline
Starting to like KiXtart

Registered: 2002-02-26
Posts: 115
Loc: Sweden
hallo

Sorry for the delay

never got it to work, now running the easy way

code:
 ;
; Script begins
cls
COLOR w+/b
; Ta bort startbara filer
SHELL "a:\COMMAND.COM /C del a:\net\net.exe"
SHELL "a:\COMMAND.COM /C del a:\autoexec.bat >nul"

flushkb
? "My Macaddress = @address"
sleep 5

IF Open( 3 , "T:\movex.txt" ) = 0

$x = ReadLine( 3 )
WHILE @ERROR = 0
IF $x = "@address"
:movex
? "MacAddress Match, starting Movex"
run "t:\runapp.bat movex"
exit
quit
ENDIF
$x = ReadLine( 3 )
LOOP
ENDIF

:Internet

IF Open( 3 , "T:\ie.txt" ) = 0
$x = ReadLine( 3 )
WHILE @ERROR = 0
IF $x = "@address"
? "Match, starting Internet Explorer"
run "t:\runapp.bat Internet"
exit
quit
ENDIF
$x = ReadLine( 3 )
LOOP
ENDIF

? "No Match, starting Desktop"
run "t:\runapp.bat Desktop"
exit
quit

:END
exit
quit


Thanks for the help, im going with diffrent files.
Cant get the *.ini files to work

Regards
\erik

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.071 seconds in which 0.033 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