I need a script that will backup a specific folder in Application Data for multiple user profiles.
We are planning a Dragon Medical upgrade to a new version. As a safe guard, I would like to be able to copy the cache folder located at C:\Documents and Settings\%username%\Application Data\Nuance\NaturallySpeaking10\Cache to C:\Dragon Cache Backup. The Dragon Cache Backup will need to be created as well. Please let me know if more information is needed. Thank you in advance for your time.
Answers (3)
this link may give you an idea
http://stackoverflow.com/questions/10710265/batch-file-to-copy-from-all-user-profiles
Comments:
-
the doubled greater than symbols (>>), will append to the log.txt file, rather than creating a new one - SMal.tmcc 11 years ago
Here is what I have come up with so far after browsing Google.
@ECHO ON
MKDIR C:\Dragon_Cache_Backups
REM Going through all the local profiles and performing the backup
setlocal
set ProfileFolder=%ALLUSERSPROFILE:\All Users=%
for /f "delims=" %%a in ('dir "%ProfileFolder%\." /b') do (
xcopy "%ProfileFolder%\%%a\Application Data\Nuance\NaturallySpeaking10\Cache\*.*" "C:\Dragon_Cache_Backups\%FOLDER%\%%a\" /e /c /h /k /y >> C:\Dragon_Cache_Backups\Backup.txt
)
@ECHO ON
Comments:
-
Source: http://www.experts-exchange.com/Programming/Misc/Q_23354855.html
Used this as a guide - xstatic411 11 years ago -
Use 2 greater them symbols pointing to the log file to append
the doubled greater than symbols (>>), will append to the log.txt file, rather than creating a new one - SMal.tmcc 11 years ago
XCopy batch. See this other question:
http://www.itninja.com/question/copy-folders-subfolders-and-files-using-batch-file
Comments:
-
Wrong page. Derp. http://www.itninja.com/question/xcopy-via-kace1000 - gcarpenter 11 years ago
-
I may be missing something, but does this explain how to use XCOPY to copy a folder from Application Data from multiple local user profiles to a newly created folder on C:\ - xstatic411 11 years ago
-
The answers in the link will not do what you are trying to accomplish - SMal.tmcc 11 years ago