RE: Domain Startup Scripting
- From: Shawn Romine <ShawnRomine@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 1 Nov 2006 14:17:04 -0800
I wanted to add another piece of interesting info that might help. As
stated, the following command always works and logs the appropriate info
echo %DATE% %TIME% %COMPUTERNAME% %systemroot%
access>>\\dclib3\tech\MaintScript\log\maint_log.txt
.....the stuff after this command sometimes logs correctly and sometimes
doesnt...it never works properly for our remote branches...it always logs the
above which tells me it is accessing the script, but it never moves any
farther than logging the above info.....the main branch library, it will
sometimes go all the way through the script and properly log into
diskcleanup.txt....most of the time it stops somewhere in the middle of the
process....what i mean by stops is that it logs some info from the various
scripts.....
is there an issue with running something like cleanmgr.exe as a startup
script do you think? i know it would be preferrable not to do this, but we
have some reasons why we need to do this....
"Shawn Romine" wrote:
If there is a better forum for this please let me know. Any help would be.
greatly appreciated.
I work for a library and we are trying to automate a lot of maintenance
routines as we have numerous branches over a large area. I am hoping someone
could help me with troubleshooting a domain startup script routine. I have
placed all the relevant script and logs below this post. dos is the only
scripting language i know at this point, so moving to vbscript is not an
option at this point for this project (hope to move to the more robust
vbscript skill soon)....
We have our domain configured to run a script that points to a .bat file on
our library server. It is done this way because the county is in charge of
the domain administration and we wanted a way to run scripts against our OU
without having to involved them each and everytime.
What is happening is that if I look at the log we are creating sometimes the
domain scripting works and sometimes it doesn’t. More specifically it logs
through part of the process and then hangs at some point, but doesn’t always
hang at the same point and not always on the same machine. I sometimes think
that it is in fact running the script but not properly logging back, only
because I think I see the hard drive activity light and hear the familiar
sound of cleanmgr.exe running, but I am not sure.
Any idea why sometimes this would run all the way through and sometimes not?
Any ideas of ways to better track what exactly is going on for
troubleshooting reasons?
I have a suspicion that our network is kind of slow and that it is timing
out at some points? I will say that it appears the portion of the script
within staff_maint.bat that echos the initial access always works it seems.
It is the rest of the script that works on and off…..
Domain Startup Script:
CODE
'This script will look at the \\dclib3\tech\MaintScript directory
'to see if there is an update.txt file. If there is, it will call
'the staff_maint.bat batch file.
'Set Objects
Set fso = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WSCript.Shell")
'Set variables
strCommand = "\\dclib3\tech\MaintScript\staff_maint.bat"
'Look for the update.txt file
If fso.FileExists("\\dclib3\tech\MaintScript\update.txt") Then
WshShell.Run strcommand
Else
WScript.Quit
End IF
staff_maint.bat
CODE
@echo off
rem ***************** Maintenance Script *************************
rem ***************** Last Modified 10/26/06 seromine
*************************
echo %DATE% %TIME% %COMPUTERNAME% %systemroot%
access>>\\dclib3\tech\MaintScript\log\maint_log.txt
IF "%systemroot%"=="C:\WINNT" echo
%computername%>>\\dclib3\tech\MaintScript\log\win2000.txt
FINDSTR /C:%computername% \\dclib3\tech\MaintScript\log\diskcleanup.txt > NUL
echo %DATE% %TIME% %COMPUTERNAME% %errorlevel%
errorlevel>>\\dclib3\tech\MaintScript\log\maint_log.txt
IF %ERRORLEVEL%==0 goto exit
IF "%systemroot%"=="C:\WINDOWS" call
\\dclib3\tech\maintscript\winxp\weekly\winxp_weekly.bat
IF "%systemroot%"=="C:\WINNT" call
\\dclib3\tech\maintscript\win2k\weekly\win2k_weekly.bat
echo %DATE% %TIME% %COMPUTERNAME%
complcall>>\\dclib3\tech\MaintScript\log\maint_log.txt
exit
:exit
echo %DATE% %TIME% %COMPUTERNAME% %systemroot%
exited>>\\dclib3\tech\MaintScript\log\maint_log.txt
winxp_weekly.bat
CODE
@echo off
rem ***************** Maintenance Script for Windows XP
*************************
rem ***************** Last Modified 9/29/06 seromine
*************************
rem ******** defrag primary hard drive c **************
echo %DATE% %TIME% %COMPUTERNAME% winxp weekly
CleanMgr_begin>>\\dclib3\tech\MaintScript\log\maint_log.txt
start /MIN
\\dclib3\tech\MaintScript\winxp\scripts\Auto_Disk_Cleanup\AutoRegEntriesXP.vbs
echo %DATE% %TIME% %COMPUTERNAME% winxp weekly
CleanMgr_setregistry>>\\dclib3\tech\MaintScript\log\maint_log.txt
start /MIN cleanmgr.exe /sagerun:100
echo %computername%>>\\dclib3\tech\MaintScript\log\diskcleanup.txt
echo %DATE% %TIME% %COMPUTERNAME% winxp weekly
CleanMgr_run>>\\dclib3\tech\MaintScript\log\maint_log.txt
echo %DATE% %TIME% %COMPUTERNAME% winxp weekly
CleanMgr_exit>>\\dclib3\tech\MaintScript\log\maint_log.txt
example of maint_log
Wed 11/01/2006 8:36:22.53 LIBRSBADU5 C:\WINDOWS access
Wed 11/01/2006 8:36:22.68 LIBRSBADU5 1 errorlevel
Wed 11/01/2006 8:36:22.79 LIBRSBADU5 winxp weekly CleanMgr_begin
Wed 11/01/2006 8:36:22.87 LIBRSBADU5 winxp weekly CleanMgr_setregistry
Wed 11/01/2006 8:36:23.03 LIBRSBADU5 winxp weekly CleanMgr_run
Wed 11/01/2006 8:38:51.33 LIBRSBADU3 C:\WINNT access
Wed 11/01/2006 8:38:51.42 LIBRSBADU3 0 errorlevel
Wed 11/01/2006 8:38:51.42 LIBRSBADU3 C:\WINNT exited
Wed 11/01/2006 8:43:19.56 LIBRSBEXT C:\WINDOWS access
Wed 11/01/2006 8:55:48.23 LIBRSBADU2 C:\WINNT access
Wed 11/01/2006 9:00:34.42 LIBCANCRC2 C:\WINDOWS access
Wed 11/01/2006 9:02:37.00 LIBWINCRC2 C:\WINDOWS access
Wed 11/01/2006 9:06:51.75 LIBRSBCAL C:\WINNT access
Wed 11/01/2006 9:06:52.07 LIBRSBCAL 1 errorlevel
Wed 11/01/2006 9:06:52.11 LIBRSBCAL win2k weekly CleanMgr_begin
Wed 11/01/2006 9:06:52.30 LIBRSBCAL winxp weekly CleanMgr_copyregfile
Wed 11/01/2006 9:07:03.64 LIBRSBADU4 C:\WINNT access
Wed 11/01/2006 9:07:06.63 LIBDRNCRC1 C:\WINDOWS access
Wed 11/01/2006 9:07:59.19 LIBRSBCRC7 C:\WINNT access
Wed 11/01/2006 9:10:56.47 LIBDRNSTF C:\WINDOWS access
Wed 11/01/2006 9:15:47.67 LIBRSBADU6 C:\WINDOWS access
Wed 11/01/2006 9:15:47.75 LIBRSBADU6 0 errorlevel
Wed 11/01/2006 9:15:47.76 LIBRSBADU6 C:\WINDOWS exited
Wed 11/01/2006 9:22:03.81 LIBRDSCRC2 C:\WINDOWS access
Wed 11/01/2006 9:19:10.55 LIBRDSCRC1 C:\WINDOWS access
Wed 11/01/2006 9:23:28.54 LIBDRNCRC2 C:\WINDOWS access
Wed 11/01/2006 9:27:31.25 LIBRSBCHI6 C:\WINDOWS access
Wed 11/01/2006 9:27:32.65 LIBRSBCHI6 1 errorlevel
Wed 11/01/2006 9:27:33.90 LIBRSBCHI6 winxp weekly CleanMgr_begin
Wed 11/01/2006 9:27:35.18 LIBRSBPCT C:\WINDOWS access
Wed 11/01/2006 9:27:35.50 LIBRSBPCT 1 errorlevel
Wed 11/01/2006 9:27:35.64 LIBRSBPCT winxp weekly CleanMgr_begin
Wed 11/01/2006 9:30:32.88 LIBYONCRC2 C:\WINNT access
Wed 11/01/2006 9:30:05.43 LIBYONSTF C:\WINDOWS access
Wed 11/01/2006 9:36:28.09 LIBMYTCRC2 C:\WINDOWS access
Wed 11/01/2006 9:44:29.74 LIBRSBCAC C:\WINNT access
Wed 11/01/2006 9:48:40.03 LIBRIDCRC1 C:\WINDOWS access
Wed 11/01/2006 9:49:03.92 LIBRSBPCT C:\WINDOWS access
Wed 11/01/2006 9:49:04.34 LIBRSBPCT 1 errorlevel
Wed 11/01/2006 9:51:12.03 LIBRIDCRC1 C:\WINDOWS access
Wed 11/01/2006 9:51:25.34 LIBMYTCRC1 C:\WINDOWS access
Wed 11/01/2006 9:51:30.75 LIBMYTSTF C:\WINDOWS access
Wed 11/01/2006 9:55:29.29 LIBRSBACF C:\WINDOWS access
Wed 11/01/2006 9:55:29.42 LIBRSBACF 1 errorlevel
Wed 11/01/2006 9:55:29.59 LIBRSBACF winxp weekly CleanMgr_begin
Wed 11/01/2006 10:13:13.14 LIBRSBPCT C:\WINDOWS access
Wed 11/01/2006 10:13:13.34 LIBRSBPCT 1 errorlevel
- References:
- Domain Startup Scripting
- From: Shawn Romine
- Domain Startup Scripting
- Prev by Date: Domain Startup Scripting
- Next by Date: Retrieve File version on Remote Server (WMI; C#)
- Previous by thread: Domain Startup Scripting
- Next by thread: Re: Domain Startup Scripting
- Index(es):