Page 1 of 1 1
Topic Options
#144315 - 2005-07-26 11:07 PM Shell causes script to exit
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
Just thinking about it I'm sure this is possible, but have you ever seen the SHELL command call an install and for some reason that install causes kix to stop processing the script, but the install continues?

Background on this is that I'm developing a script that uninstalls Office 97, uninstalls Office 2000, runs eraser2k to cleanup extra junk, and installs Office 2003. And the script is being run on computer startup via group policy.

For some reason when the Office 2003 install kicks off with the SHELL command, after it's part way through the install (maybe like 2-3 min into it) the script stops processing. Mind you, the install continues, but then you are returned to the ctrl+alt+del and able to login. Funny part is that the install is still taking place even after you login.

Enough blabbing, here is some code.

Code:
 ;**** Office 2003 Deployment Script
$CDROM = "\\uncpath\cdrom"
$OFFCLN = "C:\download\eraser2k"
$HDrive = "\\uncpath\apps1"

IF @PRODUCTTYPE = "Windows XP Professional"
exit
Endif

; *** Office 97 Remove (Add/Remove)
:OFFICE97

SHELL "$CDROM\office97\setup.exe /ua /qnt /g+ C:\log\O97-Uninstall.log"
SLEEP 10

; *** Office 2000 Remove (Add/Remove)
:OFFICE2000

SHELL "$HDrive\office2000sp3\msiexec.exe /x $HDrive\Office2000SP3\DATA1PRM.MSI /qb-! /l* C:\log\O2KSP3-Uninstall.log"
SLEEP 10

; *** Office 2000 Eraser2k (Manual Remove)
:OFFICECLN

MD "$OFFCLN"
COPY "$HDrive\office2000sp3\eraser2k\*.*" "$OFFCLN"
SLEEP 2
SHELL '"$OFFCLN\offcln9.exe" /a /q /LC:\log\eraser2k.log "$OFFCLN\offcln9b.opc"'
SLEEP 10
DEL "C:\download\eraser2k\*.*"
SLEEP 2
RD "C:\download\eraser2k"


; *** Office 2000 Final Removal Steps
Shell 'cmd /c attrib -h -s -r "C:\Program Files\Microsoft Office 2000\*.*" /s'
Shell 'cmd /c deltree /y "C:\Program Files\Microsoft Office 2000"'

del "%allusersprofile%\Start Menu\Programs\Microsoft Office 2000\*.*"
rd "%allusersprofile%\Start Menu\Programs\Microsoft Office 2000"
del "%allusersprofile%\Start Menu\Programs\Microsoft Office Tools\*.*"
rd "%allusersprofile%\Start Menu\Programs\Microsoft Office Tools"
del "%allusersprofile%\Start Menu\Programs\Office 2000\*.*"
rd "%allusersprofile%\Start Menu\Programs\Office 2000"

del "%allusersprofile%\Start Menu\Programs\Startup\*Outlook*.*"
del "%allusersprofile%\Start Menu\Programs\Startup\Microsoft Office*.*"


; *** Office 2003 Installation
:OFFICE2003

SHELL '$HDrive\office2003\setuppro.exe TRANSFORMS="$HDrive\Office2003\Office2003Rollout.MST" /wait /qb- /l* C:\log\O2K3SP1-Install.log'
Sleep 10




It doesn't matter what I do after the SHELL command of the Office 2003 install. It doesn't continue. I've already tried executing the Office 2003 install like this.

Code:
 
SHELL '$HDrive\office2003\msiexec.exe /i $HDrive\office2003\pro11.msi TRANSFORMS="$HDrive\Office2003\Office2003Rollout.MST" /qn /l* C:\log\O2K3SP1-Install.log'



Both kick off the install properly, but both suffer from the same issue. I've tried different /q options but none seem to help.

I also tried to use RUN to kick off the install and then a SLEEP 1400 to give the install plenty of time to finish, but it doesn't even get to the SLEEP line.

Any ideas would be greatly appreciated. Also, the reason I'm not doing the install with group policy software install is because it doesn't properly upgrade to Office 2003 from our current versions. Hence the need for removal first and then install fresh.


Edited by cyri (2005-07-26 11:10 PM)

Top
#144316 - 2005-07-26 11:26 PM Re: Shell causes script to exit
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1341
Loc: NL
Did you run your script in debug mode?
start the script with the Break ON command. If you don't use Break ON the system logs off when you Break the script...
_________________________
Co


Top
#144317 - 2005-07-27 12:23 AM Re: Shell causes script to exit
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
check your eventlog also...
if you say 2 min, there is some timeout stuff going on...
_________________________
!

download KiXnet

Top
#144318 - 2005-07-27 12:51 AM Re: Shell causes script to exit
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
Break on is in my script, but that really doesn't do anything anyway since I'm running at computer startup and I'm not logged on yet. I'm trying it in debug mode now. To do this I have to use two batch files with a start /wait batch2.bat in the first batch and then kix32.exe scriptname.kix in the second due to group policy hiding computer startup scripts. I'm running through debug mode right now. So far no problems, but I'll let you know once it's done.

There isn't anything reported in the eventlog other than the successful uninstall of Office 2000 and then the install of Office 2003 successfully completing like 15min after the script stopped.

Also, to make testing easier I'm doing this in VMWare. Sorry I didn't mention that earlier. It really shouldn't matter at all though.

Top
#144319 - 2005-07-27 02:16 AM Re: Shell causes script to exit
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
After running in debug mode, I ran the SHELL line for Office 2003, but a little ways into the install the script exited and took me to the login screen. No errors were present that I could tell, the script just quit.

Checking over the eventlog proved to be worthwhile though. This time I noticed in the system log the following errors. There were multiples just like this event. The timestamp matches that of when the Office 2003 install kicked off. However, it doesn't match the timestamp of when the script quit. Which would have been more like 4:52 or 4:53.

Event Type: Information
Event Source: Windows File Protection
Event Category: None
Event ID: 64002
Date: 7/26/2005
Time: 4:50:14 PM
User: N/A
Computer: VM1
Description:
File replacement was attempted on the protected system file c:\program files\common files\microsoft shared\triedit\triedit.dll. This file was restored to the original version to maintain system stability. The file version of the system file is 6.1.0.9211.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


The events are being caused by eraser2k running and trying to remove the Office shared components, but WFP won't let it. Not directly related, but might be doing something.


Edited by cyri (2005-07-27 02:22 AM)

Top
#144320 - 2005-07-27 02:43 AM Re: Shell causes script to exit
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
There is a hard coded time limit and a software set time limit as to how long a Logon Script can run before it times out. The software can be set, the hardcoded can not.

Sorry, don't have time to hunt it down but there are White papers that discuss these limits.

Not saying this IS the issue, but something to look at.
 

Top
#144321 - 2005-07-27 09:12 PM Re: Shell causes script to exit
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
I think you hit the nail on the head NTDOC. Boy do I feel stupid. I've worked with a lot of group policies and some scripting before, but never one that takes this long to complete. That was it.
Top
#144322 - 2005-07-28 12:21 AM Re: Shell causes script to exit
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
how you know?
any reference to the facts?
_________________________
!

download KiXnet

Top
#144323 - 2005-08-10 01:44 AM Re: Shell causes script to exit
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
Well Lonkero, once I changed the maximum time for script processing in the GPO, the problem was resolved. My script finished as intended. The main way I could tell that this resolved my issue was to time the script from the point it kicked off to the point it exited. It was about 10min exactly. By the way I tested the timing in debug mode. Which goes much slower and I paused between certain steps to see if the script exited at different points. My tests proved correct. If I kicked the script off in debug mode and waited 5 min before going to the next step, my script would bomb out at a totally different point. So I knew then that it was the timeout killing my script and not the script itself.
Top
#144324 - 2005-08-10 02:42 AM Re: Shell causes script to exit
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
nice. good to know.

and thanks.
_________________________
!

download KiXnet

Top
#144325 - 2005-08-10 09:12 AM Re: Shell causes script to exit
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
You're welcome
Top
#144326 - 2005-08-15 03:20 AM Re: Shell causes script to exit
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Do I understand it correctly that your login script run in the order of minutes? Shudder
_________________________
There are two types of vessels, submarines and targets.

Top
#144327 - 2005-08-15 07:18 PM Re: Shell causes script to exit
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Well since you replied to me Jens... No, not that I know of. As for Cyri I can't answer

Just poking fun at you Jens as this is a Threaded Board so one should click on and reply to the comment/post intended and not just reply to the last poster.


Edited by NTDOC (2005-08-15 07:18 PM)

Top
#144328 - 2005-08-16 05:14 PM Re: Shell causes script to exit
cyri Offline
Getting the hang of it

Registered: 2005-06-27
Posts: 95
No I didn't specifically say login script. The timeout value in group policy pertains to all scripts. Computer scripts and login scripts. So from the time the first computer script starts running to the time the login script is done processing. That is the max value I'm setting in group policy.

And the script I'm refering to in this post is a computer startup script designed to deploy Office 2003. So to answer your question, no the login script only takes a few seconds, but the computer startup script takes a good 15min to complete even on a fast computer.

Top
#144329 - 2005-08-17 07:10 PM Re: Shell causes script to exit
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
so, is there a limit for all scripts in your environment?
_________________________
!

download KiXnet

Top
#144330 - 2006-03-22 03:55 AM Re: Shell causes script to exit
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Okay, this post is a bit old but I found a Microsoft article that discusses these time-out limits.

Group Policy Processing
http://technet2.microsoft.com/WindowsServer/en/Library/89d7ec5f-a909-4f61-aded-c5b69f5f730b1033.mspx

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
2 registered (morganw, mole) and 414 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.071 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

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