Page 1 of 1 1
Topic Options
#18889 - 2002-03-22 12:12 AM Logon script skips commands
mikkie Offline
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
#18890 - 2002-03-21 03:10 PM Re: Logon script skips commands
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Please post the script so we can check out your code for potential errors.
And since you didn't post your code and you're reporting problems with Windows 9x computers, please check your code that you do not use the Z: drive within your script. The Z: drive is mapped to the NETLOGON share during login which might explain why your code doesn't work during login but afterwards.
_________________________
There are two types of vessels, submarines and targets.

Top
#18891 - 2002-03-21 05:08 PM Re: Logon script skips commands
mikkie Offline
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
#18892 - 2002-03-21 09:09 PM Re: Logon script skips commands
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
The HKEY_CURRENT_USER subkey is normally not available during login on windows NT/2000 computers. Mosto of the time, you'll have to make changes after the login by e.g. by scheduling a RunOnce event that makes the appropriate changes.

The HKCU is created during the login. The original HKCU data is in HKEY_USERS\SID and the profile. If the domain profile is newer than the local profile the domain profile gets dowmloaded and replaces the local profile including HKCU. Thus you'll have to make the changes after download of the profile and creation of HKCU.
_________________________
There are two types of vessels, submarines and targets.

Top
#18893 - 2002-03-22 07:26 AM Re: Logon script skips commands
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
#18894 - 2002-03-22 07:39 AM Re: Logon script skips commands
jtrainer Offline
Fresh Scripter

Registered: 2002-03-06
Posts: 36
Mind if I step in?

All,

bStyles is right. 9x loads the profile after the script. NT based loads the profile then excutes the script.

I've been going round for a bout a week now on some reg updates as well.

a new guy to these here forums

jtrainer
_________________________
Bumped my mouse again, time to reboot Windoze....
Top
#18895 - 2002-03-22 08:14 AM Re: Logon script skips commands
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Brian,
To reinforce your memory, you could have referred to your own website.

http://www.scriptlogic.com/support/teknotes/s1056.asp
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#18896 - 2002-03-22 08:34 AM Re: Logon script skips commands
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Now now boys... don't forget that there are multiple methods of controlling what happens via the policies.

However, just TEAR OUT any profiles on Win9x and be done with it. Come on (sharing) a Win9x box is not worth it. No real security anyways, why waste time with it. If you want or need to share a workstation put NT/2000/XP on it and be done with it. Otherwise using no profiles on Win9x you will be able to modify the keys during logon.

Top
#18897 - 2002-03-22 10:33 AM Re: Logon script skips commands
mikkie Offline
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
#18898 - 2002-03-22 02:34 PM Re: Logon script skips commands
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
SLEEPing in the logon script will only delay the logon. It won't change the behaviour. If you want to keep the profiles on the Wintendos then you nned to stuff RunOnce. Do a quick search on RunOnce for ideas.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#18899 - 2002-03-25 06:15 AM Re: Logon script skips commands
MCA Offline
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
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 484 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.066 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

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