#18889 - 2002-03-22 12:12 AM
Logon script skips commands
|
mikkie
Lurker
Registered: 2002-03-21
Posts: 3
Loc: Netherlands
|
Hi, I encountered something strange and want to know if it sound familiar to any one? I added some lines in the logonscript with the delprogramitem and addprogramitem commands. On the NT machines this works fine, but when logging on to Windows9x stations, all commands are excecuted, except removing and creating icons. When logging on, a batch file is excecuted that calls the script. When I am logged on and I start the batch file manually, the commands are working fine. I tried it 100 times, but when logging on the commands are not executed, and running the batchfile manually it works. Has anyone seen this before?
|
|
Top
|
|
|
|
#18891 - 2002-03-21 05:08 PM
Re: Logon script skips commands
|
mikkie
Lurker
Registered: 2002-03-21
Posts: 3
Loc: Netherlands
|
OK, here is the code you asked for. The logon script is test.bat this file contains: code:
%0\..\Kix32 test.kix
The test.kix script contains: code:
$key = existkey("HKEY_CURRENT_USER\software\company") IF $key <> 0 $temp=addkey("HKEY_CURRENT_USER\software\company") ENDIF $image = Readvalue ("HKEY_CURRENT_USER\software\company", "software") IF $image < "1" ; some commands that are completed successful; $temp=delprogramitem ("CdFoongids") $temp=addprogramitem ("Q:\WIN32\KPNWIN.EXE","CDFoongids","",0,"Q:\WIN32",0,0) $temp=addprogramitem ("\\Server1\travel\Travman.exe","Travelmanager","",0,"\\license\travel",0,0) $temp=addprogramitem ("F:\APPS\Euroglot\EUROGLOT.EXE","Euroglot","",0,"F:\APPS\Euroglot",0,0) $Temp=Writevalue("HKEY_CURRENT_USER\software\company","software","1","REG_SZ") ENDIF ; End of script;
When logging on, all looks OK, even the value of sofware in the registry is changed to 1, but nothing happens in the program folder. When changing this value back and starting the script manually it works fine.
|
|
Top
|
|
|
|
#18893 - 2002-03-22 07:26 AM
Re: Logon script skips commands
|
Anonymous
Anonymous
Unregistered
|
Jens,
Are you sure of that?
It was my understanding that the users profile, and thus the HKCU hive, was loaded before the logon script kicks off on NT/2K/XP.
Now 9x with user profiles is just the opposite... the script executes and then the profile loads.
Anyway, what about a potential problem with the line: IF $image < "1"
if $Image is numeric, then comparing it to a string could have wierd results. Cast to numeric before doing your comparison: IF 0+$image<1 [ 22 March 2002, 07:29: Message edited by: bstyles ]
|
|
Top
|
|
|
|
#18897 - 2002-03-22 10:33 AM
Re: Logon script skips commands
|
mikkie
Lurker
Registered: 2002-03-21
Posts: 3
Loc: Netherlands
|
So, in simple words: The startup folder is not available dring the logon script on Win9x computers?
Any idea if: run "%\..\kix32 postpone.scr"
whith postpone.scr: sleep 50 addprogramitem(...)
Will work? [ 22 March 2002, 10:33: Message edited by: mikkie ]
|
|
Top
|
|
|
|
#18899 - 2002-03-25 06:15 AM
Re: Logon script skips commands
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
We advise you to use an additional control file for W9x environment and verify the actual file by a registry setting for your NT/W2K/XP environment.
Our example handles about KIX32.EXE
code:
$groupname="KiXtart Group" IF @inwin = 1 ; -NT/W2K/XP- IF (Exist(ReadValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Programs")+"\"+$groupname+"\kixtart.lnk") = 0) $nul=AddProgramGroup($groupname) IF (AddProgramItem("c:\winnt\kix32.exe","KiXtart","",0,"c:\windows",0,0) <> 0) ? "@error (@serror)" ENDIF IF (Exist(ReadValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Programs")+"\"+$groupname+"\kixtart.lnk") = 1) ? "installation completed." ELSE ? "already installed." ENDIF ELSE ; -W9x/ME- IF (Len(ReadProfileString("c:\software.ok",$groupname,"@userid")) = 0) $nul=AddProgramGroup($groupname) IF (AddProgramItem("c:\windows\kix32.exe","KiXtart","",0,"c:\windows",0,0) <> 0) ? "@error (@serror)" ENDIF $nul=WriteProfileString("c:\software.ok",$groupname,"@userid","@date @time") ? "installation completed." ELSE ? "already installed." ENDIF ENDIF ;? "location: "+ReadValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Programs")+"\"+$groupname+"\kixtart.lnk"
An example of file c:\software.ok:
code:
[KiXtart Group] mca=2002/03/25 02:37:22
greetings.
btw: another way for W9x environment is by copy created shortcuts to right startup folder. In W9x startmenu will not removed existing shortcuts during logging off. Possible is the desktop a better location for those icons, which is much easierto handle in W9x environmentswith or without user pro- files. please let us know you need more help.
btw: verified with Kixtart 3.63,4.02
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 484 anonymous users online.
|
|
|