I want to create a batch file that will copy files from the local drive (c:) to a network drive after I click the shutdown option in XP Pro. It seems that the network connections are closed before the script can be run. Does anyone know how I can do this?
- Anonymous1 decade agoFavourite answer
You really need a script to do the backup and then call the shutdown, no way to keep a connection alive afterwards. An Alternative would be to set a long enough delay to cover the backup time in the power settings. Then you could run the script and leave the machine to shut itself down or hibernate after that time.
- 1 decade ago
The best way to do this is to join the machine to a domain and map the My Documents folder to a network resource, this way they are always there.
Another way you can do this is to simply map a drive and store your files there, then there will be no need for a script. Right click My Computer and click Map Network Drive.
If you are stuck on using a logoff script then you need to be joined to a domain and set the logon/logoff scripts in Group Policy. Microsoft has a ton of scripts on their site.
Here are a couple of sites that will help you with writing scripts:
- emmittnervendLv 41 decade ago
Try local policies. It's a bit complicated to give you much detail here. Run gpedit.msc. Open User Config then Windows Settings. You'll see logon/logoff scripts. Be careful what policies you edit. You could lock yourself out of your system! Hope this helps get you started.