Page 1 of 1 1
Topic Options
#209532 - 2014-10-18 04:34 AM Option list during logon script
Jimay3677 Offline
Fresh Scripter

Registered: 2010-02-17
Posts: 9
Loc: Australia
Hi all, I have a logon script that runs with a form, I'd like to have a box that pops up during logon asking people which VDI collection they want to log on to and once selected will run the command to open the desired rdp file.

I don't care if it's a drop down menu or buttons but I'd basically like it to say please choose the desired VDI collection and then you choose it from the menu and click OK or just click an icon/button.

Thanks.

Top
#209533 - 2014-10-18 04:22 PM Re: Option list during logon script [Re: Jimay3677]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
When you say form... What is it made of? Html? Winforms (aka kixforms)?
_________________________
!

download KiXnet

Top
#209537 - 2014-10-20 10:24 AM Re: Option list during logon script [Re: Jimay3677]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
An example in Kixforms.NET. Just to show a possible solution. Untested.

 Code:
Break On
$System = CreateObject("Kixforms.System")
If Not $System
   $nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf
$nul = $System.Application.EnableVisualStyles

$Form1 = $System.Form()
$Form1.FormBorderStyle = 1  ;FormBorderStyle_FixedSingle
$Form1.StartPosition = 1  ;FormStartPosition_CenterScreen
$Form1.Size = $System.Size(227,134) ;(Width,Height)
$Form1.Text = "Question..."

$ComboBox1 = $System.ComboBox()
$ComboBox1.DropDownWidth = 190
$ComboBox1.Left = 10
$ComboBox1.Text = ""
$ComboBox1.Top = 40
$ComboBox1.Width = 190
$nul = $Form1.Controls.Add($ComboBox1)

$ComboBox1Item0 = $ComboBox1.Items.Add("VDI 1")
$ComboBox1Item1 = $ComboBox1.Items.Add("VDI 2")
$ComboBox1Item2 = $ComboBox1.Items.Add("VDI 3")

$Label1 = $System.Label()
$Label1.Left = 10
$Label1.Text = "Please select your VDI collection"
$Label1.Top = 10
$Label1.Width = 190
$nul = $Form1.Controls.Add($Label1)

$Button1 = $System.Button()
$Button1.Click = "ButtonOKClick()"
$Button1.Left = 10
$Button1.Text = "OK"
$Button1.Top = 70
$nul = $Form1.Controls.Add($Button1)

$Form1.Show  ;Displays the Form

While $Form1.Visible
   $Nul = Execute($Form1.DoEvents())
Loop
Exit 0

Function ButtonOKClick()
	Select
		Case $ComboBox1.Text = "VDI 1"
			? "Execute VDI 1 RDP file"
		Case $ComboBox1.Text = "VDI 2"
			? "Execute VDI 2 RDP file"
		Case $ComboBox1.Text = "VDI 3"
			? "Execute VDI 3 RDP file"
		Case 1
			?"Invalid VDI collection selected."
EndFunction
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#209539 - 2014-10-20 02:04 PM Re: Option list during logon script [Re: Mart]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Bored much ? \:\)
_________________________
!

download KiXnet

Top
#209544 - 2014-10-20 04:44 PM Re: Option list during logon script [Re: Lonkero]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
 Originally Posted By: Lonkero
Bored much ? \:\)


Just a bit after an hour and a half in 14km traffic jam on a Monday morning. Nice start of the week.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

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 739 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.055 seconds in which 0.027 seconds were spent on a total of 13 queries. Zlib compression enabled.

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