#135656 - 2005-03-15 10:21 PM
startup script from network resource
|
marticus
Fresh Scripter
Registered: 2005-03-15
Posts: 12
|
Hi all, this is my first post, so be gentle. I've been working w/kix now for about 6 months and have learned quite a bit about it... so here goes:
I'm trying to use an executable file to install a program on all of our client PCs here via a kix-script ran through a windows server 2k AD startup script onto XP and 2k clients. The relevant line of code is simply:
shell "\\server\install$$\setup.exe"
This is of course preceded by code that i KNOW works, but for some reason, when the code gets to the command above, the exe file is simply not ran. Is there some reason why the executable will not execute one some test runs, but will on others? Is there something I'm overlooking about the way startup scripts are processed? I'm using a startup script as opposed to a login script because our users are not administrators and do not have sufficient permissions to install softare. If I'm missing something please let me know, and perhaps maybe suggest a better way to do it. I've ruled out permissions on the file server, and also, the XP clients are set to wait for the network to fully initialize so that should not be an issue either. Please help, thanks.
|
Top
|
|
|
|
#135659 - 2005-03-16 01:59 PM
Re: startup script from network resource
|
marticus
Fresh Scripter
Registered: 2005-03-15
Posts: 12
|
Permissions cannot be the issue because anything that's ran during a startup script uses the system permission level, and the permissions on the share are set to allow 'Everyone' read and execute access, so that's why I'm really doubting permissions as the issue. I hadn't read about the SETOPTION() function of kix, but will take full advantage of it now that I know... thanks. And for a look at the code see below, it just checks the registry, then runs the install:
setconsole("hide") ;hides the dos window
;array containing list of subnets to install on ;as we continue to add subnets, we'll still run on the other subnets that have already been ran on ;to ensure inclusion of everyone $SUBNETS = "168", "169", "170", "171", "228", "229", "86", "221", "223" ;parses for each NIC on the machines that may have more than one NIC For $NIC = 0 to 10 ;if there is no information for the NIC, we've reached the end of available NICs If EnumIPInfo ($NIC, 0) <> "" ;checks every subnet in the array until it finds the subnet of this NIC, or until the ;end of the array is reached without finding this NICs subnet for each $SUBNET in $SUBNETS if($SUBNET = "86") ;the substr function works differently since the 86 is a two-digit ;subnet if((substr(EnumIPInfo($NIC,0),7 ,2)="86") and (substr(EnumIPInfo($NIC,0),9 ,1)=".")) commonTasks endif ;works with all of the other 3 digit subnets else if(substr(EnumIPInfo($NIC,0),7 ,3)=$SUBNET) commonTasks endif endif next EndIf
next
quit(1) ;machine is not to be included, so exit
;*************************************************************************** Function commonTasks
;check to see if it's already installed $Index = 0 :Loop1 $KeyName = ENUMKEY("HKEY_LOCAL_MACHINE\Software\", $Index) If @ERROR = 0 ;quits if the program has already been installed if $KeyName = "LANDesk" quit(1) endif $Index = $Index + 1 goto Loop1 Endif ;if we got here, the client is NOT installed already and must be installed MessageBox("IT is installing new software. This could take up to 20 minutes depending on your machine speed, PLEASE BE PATIENT. " +"You will be prompted to reboot upon completion of the install. " +"If you wish to reboot, then click 'yes', if you do not, then click 'no'. " +"If you click 'no' be sure that you do reboot sometime throughout the day. Thank you." , "Message from IT", 48) ;run the command to install MDAS shell "\\fs2\install$$\mdas.exe" quit(1)
EndFunction
****************END OF CODE************************
The funny part about it, is that I know the script is running for the test machines, but once it gets to that one line it does not run the executable. Some of the test machines run it and install just fine, while the others, receive the message box, and then that's it nothing more. And I've confirmed that the registry key that is used as the check does not exist on the machines that it is not working on. So that's the story, any more pointers would be appreciated. Thanks again.
|
Top
|
|
|
|
#135661 - 2005-03-16 05:08 PM
Re: startup script from network resource
|
marticus
Fresh Scripter
Registered: 2005-03-15
Posts: 12
|
The install is mostly silent, it just prompts the user for a restart after completion. And the permission level is under machine, it has to be, because since it's a startup script, it runs before a user is given a chance to login.
|
Top
|
|
|
|
#135662 - 2005-03-16 05:25 PM
Re: startup script from network resource
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11625
Loc: CA
|
Quote:
it runs before a user is given a chance to login
Precisely... which, until you hit the built-in time out for a logon script the user has no way to interact with the script.
Think you should do some Microsoft and Google searches for Best Practices for Windows Startup Scripts. There is documentation out there to help show you what works and what doesn't, or what is problematic. Think finding that information would be more useful to help you accomplish your task.
|
Top
|
|
|
|
#135663 - 2005-03-16 05:29 PM
Re: startup script from network resource
|
marticus
Fresh Scripter
Registered: 2005-03-15
Posts: 12
|
Agreed. Appreciate the help.
|
Top
|
|
|
|
#135665 - 2005-03-16 07:52 PM
Re: startup script from network resource
|
marticus
Fresh Scripter
Registered: 2005-03-15
Posts: 12
|
I've been doing some experimenting all day today, and have found the following:
The .exe file does infact run at startup time, before the user is logged in just fine.
If I move the install file to the netlogon folder of one of our DCs then it runs every time, as it should
I think that for whatever reason, although I added the group "Domain Computers" to the ACL of the install$ share on the file server, that something is stopping the PCs from communicating w/that file server during startup time. I'm not really sure but I do know that it works from netlogon. So that is what I'm going with. Let me know if you have any more input. Thanks again.
marty
|
Top
|
|
|
|
#135667 - 2005-03-16 08:31 PM
Re: startup script from network resource
|
marticus
Fresh Scripter
Registered: 2005-03-15
Posts: 12
|
That's how I had the install$ share setup originally on the file server, when I first posted. That was not the trick.
|
Top
|
|
|
|
#135669 - 2005-03-16 09:37 PM
Re: startup script from network resource
|
marticus
Fresh Scripter
Registered: 2005-03-15
Posts: 12
|
Yep, made sure both SHARE and NTFS permissions were set. As far as the machines not being able to find the share, I know that they can find it after login, but whether or not they can find it before login is questionalbe though. I did check the error logs on both the test client and the DCs but nothing jumped out and grabbed my attention. I'm sure that the .exe will always be found now, since now have it residing in netlogon.
|
Top
|
|
|
|
#135672 - 2005-03-17 02:07 PM
Re: startup script from network resource
|
marticus
Fresh Scripter
Registered: 2005-03-15
Posts: 12
|
I wrote a test script and tried to make a directory in the NETLOGON share, a normal file share, and a hidden file share... none of which were successful. I then planted dummy *.txt files in these locations and attempted to open them, none of which were successful either. I do know that it's possible to run .exe files from at least the netlogon share though, I've tested that on six different machines so far all of which were successful. Tests on running the .exe file during startup on the hidden file share were randomly successful. I think it's just a permission difference btw that share and netlogon.
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1574 anonymous users online.
|
|
|