KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Form not showing when run from GPO\Logon\scripts

 
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic
View previous topic :: View next topic  
Author Message
Radimus
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 157
Location: Tampa, Florida

PostPosted: Thu Jun 25, 2009 7:13 pm    Post subject: Form not showing when run from GPO\Logon\scripts Reply with quote

I have my gui logon script running fine from a batch

If I call the batch via GPO, the cmd window never goes away. I did include:
$nul = setconsole("hide")
but the cmd window is still present

When I configure the GPO to run:
name: %windir%\wkix32.exe
parameter: \\server\share\gpo.kix

It never shows the form, but the script does run...

Any ideas?

snippet:
Code:

;********** Revision Record **********
;
;********** End Revision Record **********


; *********** Set environment ***************
$nul = setconsole("hide")
If Not @LogonMode     Break On     EndIf

$logfile = 'c:\Logon_' + @mdayno + '.log'
If exist($logfile)
   $logdate = split(getfiletime($logfile))[0]
   if not $logdate = @date
      Del $logfile
   endif
endif

; *********** Prevent script from running on a server ***************
If not instr(@producttype,'Workstation') and not instr(@producttype,'Professional')   Quit   endif

; *********** Install KixForms ***************
if not keyexist('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2A7A3941-F2FB-432F-A3B4-3B57F6EB5949}')
   shell 'cmd /c '+$setup+'\KiXtart\kixforms.NET.msi /qb-!'
endif
if not keyexist('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{E1E637F0-8D92-4B45-A7D2-408BDD39C671}')
   shell 'cmd /c '+$setup+'\KiXtart\kixforms.msi /qb-!'
endif

;****************************************** Set Variables for script *********************************************
   $HKLMSCCS    ="HKLM\SYSTEM\CurrentControlSet"
   $HKCUSMWCV   ="HKCU\Software\Microsoft\Windows\CurrentVersion"
   $HKLMSMWCV   ="HKLM\Software\Microsoft\Windows\CurrentVersion"
   $HKLMSMWNTCV ="HKLM\Software\Microsoft\Windows NT\CurrentVersion"
   $HKCUSMWNTCV ="HKCU\Software\Microsoft\Windows NT\CurrentVersion"
   $ier        =readvalue("HKLM\Software\Microsoft\Internet Explorer", "Version")   

   
   $appdata     =readvalue($HKCUSMWCV+"\Explorer\Shell Folders","AppData")
   $desktop     =readvalue($HKCUSMWCV+"\Explorer\Shell Folders","Desktop")
   $startmenu   =readvalue($HKCUSMWCV+"\Explorer\Shell Folders","Start Menu")
   $favorites   =readvalue($HKCUSMWCV+"\Explorer\Shell Folders","Favorites")
   $alldesktop  =expandenvironmentvars(readvalue("$HKLMSMWCV\Explorer\User Shell Folders","Common Desktop"))
   $allstartmenu=expandenvironmentvars(readvalue("$HKLMSMWCV\Explorer\User Shell Folders","Common Start Menu"))
   $qlbar         ="$appdata\Microsoft\Internet Explorer\Quick Launch"
   $toggle = 0
   $handle = 0
   $opened = 0

   $admin = iif(ingroup("\\@wksta\Administrators"),1,0)
   $adminText = iif($admin,'LocalAdmin','Standard User')


;****************************************** Build Form *********************************************
$System = CreateObject("Kixtart.System")
$ClosingTimer = $System.Timer()
$ClosingTimer.Interval = 3 * 1000   ;seconds untill closing the Form
$ClosingTimer.OnTick = "ExitForm()"

$Form = $System.Form()
$Form.Height = 285   ;190
$Form.Text = "Welcome to AHCA. Please wait for logon to complete"
$Form.Width = 505
$Form.MaximizeBox = "False"
$Form.TopMost = "False"
$Form.FormBorderStyle = 1
;$Form.ControlBox = "False"

$StatusBar = $Form.StatusBar()
$StatusBar.Dock = "Bottom"
$StatusBar.SizingGrip = 0

$Panel1 = $Form.Panel()
$Panel1.BackColor = $System.Color.FromName("White")
$Panel1.Dock = 1  ;Top
$Panel1.Height = 130
$nul = $Form.Controls.Add($Panel1)

$Panel1.BackGroundImage = @scriptdir+'\AHCA-IT4.bmp'

$ProgressBar1 = $Form.ProgressBar('',5,111,485,20)
$ProgressBar1.Style = 1
$nul = $Panel1.Controls.Add($ProgressBar1)

$Panel2 = $Form.Panel()
$Panel2.BackColor = $System.Color.FromName("White")
$Panel2.Dock = 5  ;Fill
$nul = $Form.Controls.Add($Panel2)

$ListBox1 = $Form.ListBox()
$ListBox1.Height = 80
$ListBox1.Left = 5
$ListBox1.Top = 15
$ListBox1.Width = 485
$ListBox1.BorderStyle = 1
$nul = $Panel2.Controls.Add($ListBox1)


;****************************************** Start Form *********************************************

$StatusBar.Text = PadStr(@fullname+' ('+@userid+')',' ',45,'R') + PadStr($adminText, ' ', 20,'R')+ PadStr(@wksta, ' ', 25,'R') + PadStr($ip, ' ', 20,'R')

$Form.Show

show('Logon Script Started: '+@date + ' ' +@time)

Show(@ProductType +' - ' +@CSD + iif(@OnWoW64,' - 64 Bit',' - 32 Bit'))

$Functions = Split('GetLocation UserAccount UpdateApps Policies GroupDrives GroupApps LocalDrives LocalScripts')
$ProgressBar1.Max = ubound($functions) + 1

For Each $sFunction in $Functions
   $ProgressBar1.Value = $ProgressBar1.Value+1
   $nul=Execute('show("-"+$$sFunction)')
   $nul=Execute($sFunction)
Next


show('Logon Script Ended: '+@date + ' ' +@time)
show('Form auto closing in 3 seconds')
show(' ')
$ClosingTimer.Start

While $Form.Visible
   $=Execute($Form.DoEvents(1))
Loop
Exit 1

Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Gargoyle
KiXforms Aficionado
KiXforms Aficionado


Joined: 30 Dec 2003
Posts: 366
Location: Arizona

PostPosted: Fri Jun 26, 2009 12:55 pm    Post subject: Reply with quote

In the GPO under

Computer configuration / Administrative Template / System / Scripts

There is an option to run scripts visible - Is this set to enabled?

_________________
Parents were invented to make children happy by giving them something to ignore.
Back to top
View user's profile Send private message
Radimus
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 157
Location: Tampa, Florida

PostPosted: Fri Jun 26, 2009 5:02 pm    Post subject: Reply with quote

it was due to using wkix32, instead of kix32.

I changed it and now it works correctly...
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Starters Code Clinic All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group