Adding files to the ALLUSERSPROFILE%\Documents folder

Hi,I need to deploy a number of files to the Common Documents folder (ALLUSERSPROFILE%\Documents or CSIDL_COMMON_DOCUMENTS) as this is the only location which is shared amongst users and has read/write access. I don't think this folder is specified in the folders list of wyBuild. What are my options for putting files into this folder?

Thanks

Stu

There might be a better way, but here's what I'd do (since the folder you're looking for isn't supported by WyUpdate):1. Copy the files to a new folder with any arbitrary name inside TEMP.2. Create a bat file (it should have extension .bat) to copy all the files you copied into whatever folder you want.3. Add the bat file to the same folder inside the TEMP folder (the one containing the rest of your files).4. Execute the bat file after the update.

Note (Step 2):The bat file could contain:copy * %ALLUSERSPROFILE%

where the * indicates copying all files from that folder, and the %ALLUSERSPROFILE% is an environment variable which points to the folder you were looking for. (For more information about environment variables, go to http://en.wikipedia.org/wiki/Environment_variable)

Note that it's better to replace the * in the above command with individual file names, and call the command multiple times, because that way, you'll make sure that if there are any other files already present in the folder you created, they won't be copied as well. That way, your bat file looks like:copy <FILE1> %ALLUSERSPROFILE%copy <FILE2> %ALLUSERSPROFILE%copy <FILE3> %ALLUSERSPROFILE%

Also, calling the bat file will pop up a command prompt window at the end of the update. If you wish to avoid showing that to your users, then create another file with the extension .vbs containing the following:Set WshShell = CreateObject("WScript.Shell") WshShell.Run chr(34) & "<YOURBATFILENAME>.bat" & Chr(34), 0Set WshShell = Nothing

And run that .vbs file at the end of the update instead. It'll call the bat file in an invisible window.

That's a good tip Omaer.

We'll add the "Common Documents" folder as a target folder in the next version of wyBuild & wyUpdate coming in about a week. But until then, just use Omaer's method.