|
|
|||||||
Can anyone tell me why this script works if I run it manually but not through the actual logon script? The script runs during the login process but it doesn't do anyhting. It just exits. The program was not installed to a common group. If DelProgramGroup("Sentry Spelling Checker Engine", 0) = 0 ?"Spell Checker Program Group Deleted...." EndIf Thanks |
||||||||
|
|
|||||||
Check the @ERROR/@SERROR error code, it'll tell you why it fails. code:And take a look at the FAQ Forum!$rc=DelProgramGroup("Sentry Spelling Checker Engine", 0) |
||||||||
|
|
|||||||
Ran your code and did not get any errors. But the program group does not delete. |
||||||||
|
|
|||||||
Maybe the program group is not available at logon. Topic: Sequence of events during logon |
||||||||
|
|
|||||||
You should have at least gotten an 'Error 0 - ...' ! |
||||||||
|
|
|||||||
Any other suggestions? |
||||||||
|
|
|||||||
Sorry, crystal ball is in the shop now. |
||||||||
|
|
|||||||
Maybe the the problem is somewhere else in your code? |
||||||||
|
|
|||||||
Recommendation: The most basic of any debugging procedures. Put a DEBUG ON into the first line of your code and step through it, you'll then see where it'll fail. |
||||||||
|
|
|||||||
Meaning? |
||||||||
|
|
|||||||
Meaning that you are not providing enough information for us to help you. Jens suggested you you check @Error. Instead of reporting back what it returned, you simply said "did not get any errors". The line had to return something but without your co-operation we can't say much more. I suggested that it may be a "Sequence" issue but you did not acknowledge it let alone describe what you did to disprove it. So... as you see, without your co-operation, all we have to go by is our crystal balls. |
||||||||
|
|
|||||||
And essential things like reading the KiXtart Manual and the FAQ Forum are normally a given. |
||||||||
|
|
|||||||
I did read the manual and the example I used from the manual doesn't work. Anyway, the code below works fine. If Exist ("%USERPROFILE%\Start Menu\Programs\Sentry Spelling Checker Engine") Shell 'CMD /C RD /s /q "%USERPROFILE%\Start Menu\Programs\Sentry Spelling Checker Engine"' EndIf |
||||||||
|
|
|||||||
Just to understand this. The correct usage of the code to return the error is not @error. The function return zero for success and the errorcode if it fails according to the manual. So could you run this code and tell me what happens? |
||||||||
|
|
|||||||
Ok. When I run your code through the script it displays Kixtart Version 4.02 Spell Checker Program Group Deleted.... But it really doesn't delete the group. When I run your code manually I get Kixtart Version 4.02 DelProgramGroup ERROR:1. Running it this way deletes the group. |
||||||||
|
|
|||||||
Looks to me like you may have found a KiXtart 4.02 bug either in the function or documentation. The 4.21 docs also show it this way. Could you retest using 4.21 to see if the behavior is the same or different? I am still confused by the fact that your behavior is different inside and outside your script. Without seeing the balance of your code I can't comment any further. The behavior should be the same. [ 28. July 2003, 22:02: Message edited by: Howard Bullock ] |
||||||||
|
|
|||||||
When you run the code in your other script is it executing in a manual mode or as a logon script during logon? If it is during logon then you have some OS level thing happening causing the different behavior. You didn't specify what OS you were testing with in any previous post that I saw. |
||||||||
|
|
|||||||
Same exact result with version 4.21. |
||||||||
|
|
|||||||
Is the following registry value implemented: W2k/XP - Keep the Window visible on login? |
||||||||
|
|
|||||||
The problem occurs with W2k SP3 and WinXP SP1. The only way it works, including your code, is manually. Maybe it is a bug. |
||||||||
|
|
|||||||
And you have ReadValue($hklms+"\Microsoft\Windows NT\CurrentVersion\Winlogon", "RunLogonScriptSync") set to 1 on your computers? Please check and let us know. The return code of 1 seems to be a bug in either docs or the function. We will need some clarification from Ruud on that. |
||||||||
|
|
|||||||
The delete during login will not work if RunLoginScriptSync=0, thus it would not be an error as the user profile is not loaded by the time the deleet is issued. Thus, please answer the question! |
||||||||
|
|
|||||||
Yes, I have that value set to 1 already. |
||||||||
|
|
|||||||
Jens, based in the test code I furnished and the posted results, I think that the DelProgramGroup function is returning 0=fail 1=success. DOCs are wrong in this case. I agree with you that the RunLoginScriptSync setting could be skewing the problem by changing the ability to delete the group. In this case the function is reporting 0=Fail and pring the text of the supposed action. [ 28. July 2003, 22:20: Message edited by: Howard Bullock ] |
||||||||
|
|
|||||||
So to get both the return code and error code could you run this code and report the report? Run it both at the command line and as part of a logon script. Use KiXtart 4.21 if possible. [ 29. July 2003, 15:13: Message edited by: Howard Bullock ] |
||||||||
|
|
|||||||
Command Prompt: Deletes Group KiXtart version: 4.21 OS: 5.0 Product: Windows 2000 Professional LogonMode: DelProgramGroup Result: 1 Errorcode: 0 The operation completed successfully. Logon Scrip: Does not Delete Group KiXtart version: 4.21 OS: 5.0 Product: Windows 2000 Professional LogonMode: Spell Checker Program Group Deleted.... DelProgramGroup Result: 0 Errorcode: 2 |
||||||||
|
|
|||||||
These results confirm that the documentation is incorrect. DelProgramGroup return 1=success or 0=fails and sets @error. The function fails in the logon script becuase it encounters error 2 "The system cannot find the file specified." Apparently the path to the file is not known at the time of execution during the logon script. You could possibly try to provide the full path using variable (determined from the registry or Environment). The inability to find the file in itself does not seem to be a KiXtart error to me. Anybody else have thoughts? |
||||||||
|
|
|||||||
I also find it strange that the macro @LogonMode did not return a value. Is this a bug in 4.21? |
||||||||
|
|
|||||||
Check for the existance of the folder via EXIST before doing the DELPOROGRAMGROUP. Maybe the profile is not fully loaded by the time the DELPROGRAMGROUP is issued. However that would contradict the statement that RunLoginScriptSync=1 is implemented for all users. |
||||||||
|
|
|||||||
Jens, I think you may have the logic reversed on RunLogonScriptSync. If set to 1 then the profile does not load until after the logon script completes. If set to 0, the profile start to load in sync but there is still no guarantee as it still depends on timing. |
||||||||
|
|
|||||||
I was alwasy under the impression that RunLoginScriptSync=1 will result in the following login process events: a) Load profile if necessary b) Start login script after profile finished loading c) Start Run/RunOnce registry keys after logins cript finished d) Start the shell |