PC Review


Reply
Thread Tools Rate Thread

Batch at shutdown get prematurely terminated

 
 
ToddAndMargo
Guest
Posts: n/a
 
      17th Apr 2009
Hi All,

I have a batch file that I run at shutdown on an
XP-Pro-SP3 computer:

REGEDIT4

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff\0\0]
"Script"="C:\\NtUtil\\Backup-ExtHD3.bat"
"Parameters"=""
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

The last thing I do in the batch file it call Abakt, which
copies a list of files to my backup drive:

echo Backing up selected files (Abakt)
echo Your Abakt profile is: %Profile2%
%Abakt% -b -x "%Profile2%"

Abakt will run for about 10 minutes, the windows shutdown
screen will come up stating that it is running logoff
scripts, switch to Windows is Shutting Down, and
then the machine powers off.

Problem: Abakt takes about 30 minutes to complete is tasks.

Is there a way to tell windows to wait for my backup script to
complete fully before shutting down?

Many thanks,
-T

 
Reply With Quote
 
 
 
 
Terry R.
Guest
Posts: n/a
 
      17th Apr 2009
The date and time was Friday, April 17, 2009 2:40:16 PM, and on a whim,
ToddAndMargo pounded out on the keyboard:

> Hi All,
>
> I have a batch file that I run at shutdown on an
> XP-Pro-SP3 computer:
>
> REGEDIT4
>
> [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff\0\0]
> "Script"="C:\\NtUtil\\Backup-ExtHD3.bat"
> "Parameters"=""
> "ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
>
> The last thing I do in the batch file it call Abakt, which
> copies a list of files to my backup drive:
>
> echo Backing up selected files (Abakt)
> echo Your Abakt profile is: %Profile2%
> %Abakt% -b -x "%Profile2%"
>
> Abakt will run for about 10 minutes, the windows shutdown
> screen will come up stating that it is running logoff
> scripts, switch to Windows is Shutting Down, and
> then the machine powers off.
>
> Problem: Abakt takes about 30 minutes to complete is tasks.
>
> Is there a way to tell windows to wait for my backup script to
> complete fully before shutting down?
>
> Many thanks,
> -T
>


Hi Todd,

I have a backup script run at shutdown also. Have you tested it at a
command prompt so you can watch it execute? I have copy and error logs
written in my batch file that open on Startup the next day, so I can
verify it completed properly. You might want to add something like that
to your batch file, or have the log from your backup program open.

As an aside, if you're launching the file using the group policy
Shutdown script, echo isn't really needed since you don't see what is
happening anyway.


Terry R.
--
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
Reply With Quote
 
John John (MVP)
Guest
Posts: n/a
 
      17th Apr 2009
ToddAndMargo wrote:
> Hi All,
>
> I have a batch file that I run at shutdown on an
> XP-Pro-SP3 computer:
>
> REGEDIT4
>
> [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff\0\0]
>
> "Script"="C:\\NtUtil\\Backup-ExtHD3.bat"
> "Parameters"=""
> "ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
>
> The last thing I do in the batch file it call Abakt, which
> copies a list of files to my backup drive:
>
> echo Backing up selected files (Abakt)
> echo Your Abakt profile is: %Profile2%
> %Abakt% -b -x "%Profile2%"
>
> Abakt will run for about 10 minutes, the windows shutdown
> screen will come up stating that it is running logoff
> scripts, switch to Windows is Shutting Down, and
> then the machine powers off.
>
> Problem: Abakt takes about 30 minutes to complete is tasks.
>
> Is there a way to tell windows to wait for my backup script to
> complete fully before shutting down?


By default the maximum wait time for Group Policy scripts is set to 10
minutes, you can change this timeout value via the Group Policy Snap-in
(enter gpedit.msc in the Start menu Run box).

If you change the settings via GPO it will add MaxGPOScriptWait value at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system

Another way around your problem would be to launch the backup and
shutdown entirely from a batch file instead of using a logoff or
shutdown script. If you call the backup batch from another batch file
it will wait for the backup to complete before returning control to the
batch file that made the call, then the batch file can run a shutdown
command.

John
 
Reply With Quote
 
ToddAndMargo
Guest
Posts: n/a
 
      17th Apr 2009
John John (MVP) wrote:
> ToddAndMargo wrote:
>> Hi All,
>>
>> I have a batch file that I run at shutdown on an
>> XP-Pro-SP3 computer:
>>
>> REGEDIT4
>>
>> [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff\0\0]
>>
>> "Script"="C:\\NtUtil\\Backup-ExtHD3.bat"
>> "Parameters"=""
>> "ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
>>
>> The last thing I do in the batch file it call Abakt, which
>> copies a list of files to my backup drive:
>>
>> echo Backing up selected files (Abakt)
>> echo Your Abakt profile is: %Profile2%
>> %Abakt% -b -x "%Profile2%"
>>
>> Abakt will run for about 10 minutes, the windows shutdown
>> screen will come up stating that it is running logoff
>> scripts, switch to Windows is Shutting Down, and
>> then the machine powers off.
>>
>> Problem: Abakt takes about 30 minutes to complete is tasks.
>>
>> Is there a way to tell windows to wait for my backup script to
>> complete fully before shutting down?

>
> By default the maximum wait time for Group Policy scripts is set to 10
> minutes, you can change this timeout value via the Group Policy Snap-in
> (enter gpedit.msc in the Start menu Run box).
>
> If you change the settings via GPO it will add MaxGPOScriptWait value at
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system
>
>
> Another way around your problem would be to launch the backup and
> shutdown entirely from a batch file instead of using a logoff or
> shutdown script. If you call the backup batch from another batch file
> it will wait for the backup to complete before returning control to the
> batch file that made the call, then the batch file can run a shutdown
> command.
>
> John


Hi John,

I see your point. I will take your advice and have the batch
file do the shutdown.

Thank you,
-T
 
Reply With Quote
 
ToddAndMargo
Guest
Posts: n/a
 
      17th Apr 2009
Terry R. wrote:

> As an aside, if you're launching the file using the group policy
> Shutdown script, echo isn't really needed since you don't see what is
> happening anyway.


It is so I can see what is happening when I test it outside of shutdown.
 
Reply With Quote
 
John John (MVP)
Guest
Posts: n/a
 
      18th Apr 2009
ToddAndMargo wrote:
> John John (MVP) wrote:
>> ToddAndMargo wrote:
>>> Hi All,
>>>
>>> I have a batch file that I run at shutdown on an
>>> XP-Pro-SP3 computer:
>>>
>>> REGEDIT4
>>>
>>> [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff\0\0]
>>>
>>> "Script"="C:\\NtUtil\\Backup-ExtHD3.bat"
>>> "Parameters"=""
>>> "ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
>>>
>>> The last thing I do in the batch file it call Abakt, which
>>> copies a list of files to my backup drive:
>>>
>>> echo Backing up selected files (Abakt)
>>> echo Your Abakt profile is: %Profile2%
>>> %Abakt% -b -x "%Profile2%"
>>>
>>> Abakt will run for about 10 minutes, the windows shutdown
>>> screen will come up stating that it is running logoff
>>> scripts, switch to Windows is Shutting Down, and
>>> then the machine powers off.
>>>
>>> Problem: Abakt takes about 30 minutes to complete is tasks.
>>>
>>> Is there a way to tell windows to wait for my backup script to
>>> complete fully before shutting down?

>>
>> By default the maximum wait time for Group Policy scripts is set to 10
>> minutes, you can change this timeout value via the Group Policy
>> Snap-in (enter gpedit.msc in the Start menu Run box).
>>
>> If you change the settings via GPO it will add MaxGPOScriptWait value
>> at
>> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system
>>
>>
>> Another way around your problem would be to launch the backup and
>> shutdown entirely from a batch file instead of using a logoff or
>> shutdown script. If you call the backup batch from another batch file
>> it will wait for the backup to complete before returning control to
>> the batch file that made the call, then the batch file can run a
>> shutdown command.
>>
>> John

>
> Hi John,
>
> I see your point. I will take your advice and have the batch
> file do the shutdown.
>
> Thank you,


You're welcome.

John
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch execution is terminated Lubomir Microsoft ASP .NET 0 12th Jan 2010 09:04 PM
RAID 0 HDD's shutdown prematurely while hibernating Boxman Windows XP Performance 0 8th Jul 2008 10:12 AM
Install file terminated prematurely Alan T Windows Vista General Discussion 1 30th Aug 2007 07:15 AM
installer terminated prematurely =?Utf-8?B?QnV0Y2g=?= Windows XP General 0 11th Jan 2006 01:46 AM
RPC terminated and automatic shutdown Cedric Windows XP General 2 14th Aug 2003 02:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:24 PM.