mdewals
(Just in Town)
2011-11-18 02:42 PM
script partially loaded??

Hello,

I'm experiencing some problems with Kixtart on a Windows 2008 Terminal Server.

Our script first deletes the current desktop and start menu and then proceeds to make a new one.

However some users end up with an empty start menu. The program shortcuts it should load are not there.

The script first deletes the old files before proceeding to creating the new one's. So it's not a user-error by doing it the wrong way around.

If said user experiences this, a simple logoff and logon fixes the problem.
I cannot really put my finger on the problem.

Any suggestions on how to debug this? Or anyone else had this happen as well?

Greetings,

Micha


LonkeroAdministrator
(KiX Master Guru)
2011-11-18 03:57 PM
Re: script partially loaded??

the shortcuts, do they come from different share?

mdewals
(Just in Town)
2011-11-18 04:18 PM
Re: script partially loaded??

no. All shortcuts are programs on the specific server like Notepad, calculator and locally installed software

LonkeroAdministrator
(KiX Master Guru)
2011-11-18 04:34 PM
Re: script partially loaded??

so...
might be that the timeout for the script is reached.

to debug it, start with checking the eventlog.
then, add debug lines to your script (every now and then, to locate what gets done before failure):
shell "%comspec% /c echo %time% - done thisandthat "+@error+", going to thatandthose >> %temp%\logon.log"


Les
(KiX Master)
2011-11-18 05:18 PM
Re: script partially loaded??

It may be possible to change the default timeout. On terminal servers I also often put stuff in UsrLogon or other compatibility scripts.

You could do the destruction in the first script but then put the rebuild portion in another script run via RunOnce in HKCU.

The sequence of events follows this order:
1.[System Boot]
2.HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
3.HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices
4.[Logon Dialog]
5.[Load User Profile]
6.[Apply Microsoft Policies]
7.[Network Logon Script]
8.HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
9.[Desktop/Shell]
10.HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
11.HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
12.HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
13.[Startup Folder]


mdewals
(Just in Town)
2011-12-27 01:07 PM
Re: script partially loaded??

Sorry for late reaction. Other, more important, problems, changes and personal stuff kept me from this one.

I have a functions.kix file which has the "delete desktop" and "Delete Start menu" options.
These are called from within the [username].kix file. The next step is loading all items.

so basically its doing the following

- Call function "delete desktop"
- Call function "delete start menu"
- Add desktop icons
- Add start menu icons.

So it seems the called function is not starting right away but the script continues anyway. And as a result, the start menu "stays" empty.

Or am I being silly and this isn't possible.


Glenn BarnasAdministrator
(KiX Supporter)
2011-12-27 02:14 PM
Re: script partially loaded??

Post your code..

Glenn


mdewals
(Just in Town)
2012-01-06 12:23 PM
Re: script partially loaded??

User kix file

 Code:
delmenustart()
delbureaublad()

$startmenu="C:\users\"+$userid+"\AppData\Roaming\Microsoft\windows\Start Menu\Programma's"

$kschijf="\\TELESALES\kwaliteitshandboek"
USE k: $kschijf
$=wshShortcut("Kwaliteitshandboek","\\TELESALES\Kwaliteitshandboek")

$=wshShortcut($startmenu+"\Bureau-accessoires\Kladblok","%SystemRoot%\system32\notepad.exe")
$=wshShortcut($startmenu+"\Bureau-accessoires\Imaging","C:\Program Files (x86)\Windows NT\Bureau-accessoires\ImageVue\kodakimg.exe")
$=wshShortcut($startmenu+"\Bureau-accessoires\Paint","%SystemRoot%\System32\mspaint.exe")
$=wshShortcut($startmenu+"\Bureau-accessoires\Rekenmachine","%SystemRoot%\System32\calc.exe")
$=wshShortcut("Ice Ten","C:\Program Files (x86)\J River\ICE.TEN\dejawin.exe")
; Microsoft Office 2000
$=wshShortcut($startmenu+"\Microsoft Excel","C:\Program Files (x86)\Microsoft Office\OFFICE\excel.exe")
$=wshShortcut($startmenu+"\Lotus Notes","C:\Program Files (x86)\IBM\Lotus\Notes\notes.exe",,"C:\Program Files (x86)\IBM\Lotus\Notes\framework/..")
$=wshShortcut($startmenu+"\Ice Ten","C:\Program Files (x86)\J River\ICE.TEN\dejawin.exe")
$=wshShortcut($startmenu+"\Firefox","C:\Program Files (x86)\Mozilla Firefox\firefox.exe")
$=wshShortcut($startmenu+"\Iptor","C:\Thinkwise Software\end_product_group1\tsf_dotnet.exe",iam_160_winlogon.ini,"C:\Thinkwise Software\end_product_group1")
$=wshShortcut("Bestandsbeheer","E:\share\Bestandsbeheer")
$=wshShortcut("Iptor Handleiding","E:\iptor\index.html")

; Open Office
$oo=$startmenu+"\Openoffice.org 3"
MD $oo
$=wshShortcut($oo+"\OpenOffice.org Base","C:\Program Files (x86)\OpenOffice.org 3\program\sbase.exe",,"C:\Program Files (x86)\OpenOffice.org 3\basis\progam")
$=wshShortcut($oo+"\OpenOffice.org Impress","C:\Program Files (x86)\OpenOffice.org 3\program\simpress.exe")
$=wshShortcut($oo+"\OpenOffice.org Math","C:\Program Files (x86)\OpenOffice.org 3\program\smath.exe")
$=wshShortcut($oo+"\OpenOffice.org Calc","C:\Program Files (x86)\OpenOffice.org 3\program\scalc.exe")
$=wshShortcut($oo+"\OpenOffice.org Writer","C:\Program Files (x86)\OpenOffice.org 3\program\swriter.exe")
$=wshShortcut($oo+"\OpenOffice.org Draw","C:\Program Files (x86)\OpenOffice.org 3\program\sdraw.exe")

; Opstarten
$opstarten=$startmenu+"\startup"
MD $opstarten
$=wshShortcut($opstarten+"\OpenOffice.org SnelStarten","C:\Program Files (x86)\OpenOffice.org 3\program\quickstart.exe",,"C:\Program Files (x86)\OpenOffice.org 3\program")
; Adobe Acrobat Reader 10
$=wshShortcut($startmenu+"\Adobe Acrobat Reader 10","C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe")


$=wshShortcut("Lotus Notes","C:\Program Files (x86)\IBM\Lotus\Notes\notes.exe",,"C:\Program Files (x86)\IBM\Lotus\Notes\framework/..")
$=wshShortcut("Iptor","C:\Thinkwise Software\end_product_group1\tsf_dotnet.exe",iam_160_winlogon.ini,"C:\Thinkwise Software\end_product_group1")


; Microsoft Office 2000
$=wshShortcut($startmenu+"\Microsoft Excel","C:\Program Files (x86)\Microsoft Office\OFFICE\excel.exe")




functions.kix

 Code:
; (C) Mosadex CV, L.Maes
; Date written: 17/06/2005
; Modified: 
;
; functions.kix
; functies

; debug($string) : schrijf een debug bericht in de console als debugging aanstaat
function debugstr($string)
	if $debug=1
		? $string
	endif
endfunction

function sysok()
	if exist($sysok_location+$wksta+".ok")
		debugstr ("Systeempolicies zijn geconfigureert...")
		$sysok=1
	else
		debugstr ("Systeempolicies zijn NIET geconfigureert...")
		sendadminmessage()
		? "Deze computer is niet klaar voor gebruik!"
		? "Neem contact op met afdeling systeembeheer"
		get $x
		logoff()
		$sysok=0
	endif
endfunction

function sendadminmessage()
 for each $admin in $admins
    sendmessage($admin,"Systeem: "+$wksta+" is niet gereed! "+$userid+" probeerde hierop in te loggen!")
 next 
endfunction

function delstartmenu()
	DeleteFF("C:\Documents and Settings\"+$userid+"\Start Menu\Programs","Content","True")
endfunction

function delNLstartmenuNL()
	DeleteFF("C:\Documents and Settings\"+$userid+"\menu start\Programma's","Content","True")
endfunction

function delmenustart()
	DeleteFF("C:\Users\"+$userid+"\AppData\Roaming\Microsoft\Windows\Start Menu\","Content","True")
endfunction

function delbureaublad()
	DeleteFF("C:\Users\"+$userid+"\Desktop","Content","True")
endfunction

function deldesktop()
	DeleteFF("C:\Documents and Settings\"+$userid+"\Desktop","Content","True")
endfunction

function delNLdesktopNL()
	DeleteFF("C:\Documents and Settings\"+$userid+"\Bureaublad","Content","True")
endfunction

; Externe functies laden

; WshShortCut()
call $lib_location+"wshshortcut.kix"
call $lib_location+"deleteff.kix"


AllenAdministrator
(KiX Supporter)
2012-01-06 02:21 PM
Re: script partially loaded??

A couple of things.

DeleteFF, can you provide the code for that?

In your first post you mention a simple logoff and log back in fixes the problem. This sounds similar to the old problem of Windows running scripts before the network was ready. I don't know if it applies but this might be worth looking into:

Windows XP Professional Fast Logon Optimization -
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=112428#Post112428