Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Syncing My Document to Network drive

5 views
Skip to first unread message

Amber

unread,
Sep 6, 2003, 8:22:43 PM9/6/03
to
Is it possible to Sync the My-Document folder to my
network drive every time I logout of the computer?

Doug Knox MS-MVP

unread,
Sep 6, 2003, 10:46:58 PM9/6/03
to
If you're running XP Pro, yes, you could create a VB Script or BAT file, and
set it as a Logoff Script.

If you're running XP Home you'd have to install 3rd party software to
replace the LogOff Script function.

--
Doug Knox, MS-MVP Windows XP/ Windows Smart Display
Win 95/98/Me/XP Tweaks and Fixes
http://www.dougknox.com
--------------------------------
Associate Expert
ExpertZone - http://www.microsoft.com/windowsxp/expertzone
--------------------------------
Please reply only to the newsgroup so all may benefit.
Unsolicited e-mail is not answered.

"Amber" <amb...@yahoo.com> wrote in message
news:331601c374d6$2786e0c0$a001...@phx.gbl...

Amber

unread,
Sep 7, 2003, 2:39:02 PM9/7/03
to
I am running XP pro.
Could you give me a hint to what command to use to write
the logoff script? Or where to get information.
Thanks

>.
>

Rob Schneider

unread,
Sep 7, 2003, 2:46:36 PM9/7/03
to
Amber,

Search XP's Help on your computer for "logoff script" and I believe
you'll find what you are looking for.

rms

Doug Knox MS-MVP

unread,
Sep 7, 2003, 4:09:44 PM9/7/03
to
Amber,

Simply copy and paste the following into a Notepad file and save it as
AmberNetCopy.VBS. The file needs to be in a location accessible to your
user profile.

--------------- Copy below this line -----------------------------------
'Sync My Documents to another network share
'By Doug Knox - 9/7/2003

On Error Resume Next
'Prevents errors from values that don't exist

'Set the Scripting Object
set WshShell = WScript.CreateObject("WScript.Shell")

'Set the File System Object
Set fso = CreateObject("Scripting.FileSystemObject")

'Get the location of the User's My Documents folder
strMyDocs = WshShell.SpecialFolders("MyDocuments")

'Get the current Username
Set WshNetwork = WScript.CreateObject("WScript.Network")
strUser = WshNetwork.UserName

'Define the path to the network share and destination folder
'Build the path to the network Share
strDestination = "\\machine1name\shareddrivename\backups\" & strUser & "\My
Documents"

'Copy the files
Copy the My Documents folder to the Destination
fso.CopyFolder strMyDocs,strDestination,True

'Alternate usage of a mapped drive
'Assumes Drive X is mapped to \\machine1name\shareddrivename\backups
'strDestination = "X:\" & strUser & "\My Documents"
'fso.CopyFolder strMyDocs,strDestination,True

Set WshShell = Nothing
Set WshShell = Nothing
Set fso = Nothing

-------------- End Copy above this
line --------------------------------------------
All you need to do is modify the strDestination line to point to the actual
network share. The alternative example assumes a Drive X is mapped to the
desired backup's folder. If you have a network share mapped for this
purpose, just change the drive letter in the script.

Then your system administrator can use Group Policies to assign the log off
script to your profile. If you're in non-domain environment, click Start,
Run and enter GPEDIT.MSC Go to User Configuration, Windows Settings,
Scripts (Logon/Logoff), Logoff. Click the Add button, then Browse, and
browse to the location you saved the AmberNetCopy.VBS file. There are no
parameters to set for the script. Click Apply and then OK.

This sets the script to run for all users on the machine, not just
individual users. So the script must be in a location that can be "read" by
all users. But, since the script uses the system to find out who the
"logged on user" is, there are no conflicts since each user will get their
own "<username>\My Documents" folder in the backup location.

This script will increase your logoff time. How long depends on how much
you have to backup.


--
Doug Knox, MS-MVP Windows XP/ Windows Smart Display
Win 95/98/Me/XP Tweaks and Fixes
http://www.dougknox.com
--------------------------------
Associate Expert
ExpertZone - http://www.microsoft.com/windowsxp/expertzone
--------------------------------
Please reply only to the newsgroup so all may benefit.
Unsolicited e-mail is not answered.

"Amber" <amb...@yahoo.com> wrote in message

news:3f5701c3756f$4ed24a90$a601...@phx.gbl...

0 new messages