6 Answers
This should do the trick.
Save as a REG file and import, unless that is blocked as well.
This effectively creates a logoff script entry.
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff\0\0]
"Script"="H:\your-script-here.bat"
"Parameters"=""
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00 ,00,00,00,00,00
Save your script to do the copy under the root of your H: drive.
1
Another similar option to what Tim Brigham already suggested is to save the text below as a .reg file:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0]
“GPO-ID”=”LocalGPO”
“SOM-ID”=”Local”
“FileSysPath”=”C:\Windows\System32\GroupPolicy\User”
“DisplayName”=”Local Group Policy”
“GPOName”=”Local Group Policy”
“PSScriptOrder”=dword:00000001[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logoff\0\0]
“Script”=”H:\yourScriptFileName.bat”
“Parameters”=””
“IsPowershell”=dword:00000000
“ExecTime”=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
This is similar to doing it yourself from the Group Policy Editor tool (gpedit.msc).
3
you can put that line at the end of your batch file
shutdown -l
this will log you off as soon as the script is done
1
I’m not sure which version of Windows added this program, but you could use the waitfor
command to pause a batch file for 3,000 seconds (i.e. 50 minutes), then continue with your copy command.
It’s definitely available in Windows 7, almost certainly in Vista, and not in XP. However, it may be available in the Windows 2003 Resource Kit Utilities that are available to download, which will run on XP.
There’s probably some batch trickery that’s possible to pause a script for a particular amount of time too.
Start -> Run and type “gpedit.msc”
Under User Configuration -> Windows Settings -> Scripts (Logon/Logoff) you can add your scripts
2
8