#182067 - 2007-10-29 11:19 PM
kix2exe trouble
|
sjefferson
Lurker
Registered: 2006-02-24
Posts: 4
|
I have a script that I am trying to turn into an exe file, which works fine until I try to use /runasuser /runaspassword. I get the following error message:
ERROR: unexpected command! Script: C:\DOCUME~1\ [...]\ke2~1000842\k2erun.dat Line: 112
Does anyone have any idea what may be going on here? I haven't used kix2exe before now, and don't know how to go about troubleshooting this issue.
Thanks, Shawn
|
Top
|
|
|
|
#182101 - 2007-10-30 05:20 PM
Re: kix2exe trouble
[Re: Gargoyle]
|
sjefferson
Lurker
Registered: 2006-02-24
Posts: 4
|
That's the trouble I'm having, since I can't actually see what's at line 112 in the script. My original script doesn't even have 100 lines.
Here's the script anyway:
Break On
Dim $Sessions[60,2] Dim $line Dim $x Dim $RadioButtons[60] Dim $session
; Run qwinsta to enumerate sessions SHELL "%comspec% /c qwinsta.exe /server:nmmtermserv01 > userlist.txt"
; Parse the session list $x = 0 IF OPEN (10, "userlist.txt") = 0 $line = READLINE(10) $line = READLINE(10) $line = READLINE(10) $line = READLINE(10) WHILE @ERROR = 0 $Sessions[$x,0] = RTrim(SubStr($line,20,20)) $Sessions[$x,1] = LTrim(SubStr($line,42,5)) ;? "Username:" + $Sessions[x,0] + " Session ID: " + $Sessions[x,1] $line = ReadLine(10) $x = $x + 1 LOOP ENDIF $nul = CLOSE(10) DEL "userlist.txt"
$session = 10000
; Display form with KixForms $Form = CreateObject("Kixtart.Form") $Form.FontName = "Tahoma" $Form.FontSize = 10 $Form.FormBorderStyle = 4 $Form.SizeGripStyle = 1 $Form.Size = 600,500 $Form.Text = "Reset GP Terminal Session" $Form.tag = 0
$GroupBox = $Form.Controls.Add("GroupBox") $GroupBox.Top = 10 $GroupBox.Left = 10 $GroupBox.Height = $Form.Height - 110 $GroupBox.Width = $Form.Width - 20
$y = 10 For $x = 0 To 59 If $Sessions[$x,0] <> "" $RadioButtons[$x] = $GroupBox.Controls.Add("RadioButton") $RadioButtons[$x].Top = $y + (($x mod 15) * $RadioButtons[x].Height) $RadioButtons[$x].Left = 10 + (120 * ($x / 15)) $RadioButtons[$x].Name = $Sessions[$x,0] $RadioButtons[$x].Text = $Sessions[$x,0] $RadioButtons[$x].Width = 120 $RadioButtons[$x].OnClick = "$$session = $Sessions[$x,1]" EndIf Next
$Button = $Form.ToolButton $Button.Top = $Form.ClientHeight - $Button.Height - 10 $Button.Left = $Form.ClientWidth - $Button.Width - 10 $Button.Text = "Reset" $Button.Icon = 37 $Button.OnClick = "$$form.tag=1" $Button.Anchor = 2+8
$Form.Center $Form.Show While $Form.Visible and $form.tag = "0" $= Execute($Form.DoEvents) Loop
if $form.tag = "1" RUN "%comspec% /c RESET SESSION $session /server:nmmtermserv01" else endif
Exit 0
|
Top
|
|
|
|
#182104 - 2007-10-30 05:30 PM
Re: kix2exe trouble
[Re: sjefferson]
|
sjefferson
Lurker
Registered: 2006-02-24
Posts: 4
|
Hmmm, looking at this a little more and I think it has something to do with the unregistering of the kixforms (?)
Edited by sjefferson (2007-10-30 07:49 PM)
|
Top
|
|
|
|
#182135 - 2007-10-31 05:55 PM
Re: kix2exe trouble
[Re: Richard H.]
|
sjefferson
Lurker
Registered: 2006-02-24
Posts: 4
|
Hi,
That seems to have solved my problem! Although, I found that I have to have kixforms.dll registered on the machine BEFOREHAND, even though the user credentials I'm using to run the script (with /runasuser) should have admin rights to the local workstation. Anyway, thanks everyone for your help!
Shawn
|
Top
|
|
|
|
#182162 - 2007-11-01 08:50 AM
Re: kix2exe trouble
[Re: NTDOC]
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
And (computer) Startup Scripts are part of a GPO, so I presume that you both agree
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 248 anonymous users online.
|
|
|