- Drivers
Keys
List all programs installed
All documents (in all profiles & Predefined folders)
I want the ability to exclude some usernames/profiles automatically and ask the user to "Copy this user Yes/No/All". I may just exclude some and copy all others.
I have two methods so far for listing the usernames. One uses a for loop, but I can't put a input prompt in the loop.
The Seconds loops listing all the usernames and you select the number that refers to the user you want to copy, which works good, but we want the ability to exclude some (Administrator) and maybe automate it.
Please ignore these if you have a better way.
Here is my code snippets;
----------------------------------
Type1 -
setlocal EnableDelayedExpansion
:documents
cls
echo.
echo.
echo.
set /P c=Would you like to backup Documents? Y/N?....
if /I "%c%" EQU "N" goto keys
for /f "delims=" %%a in ('dir "%ProfileFolder%\." /b') do (
cls
echo.
echo.
echo.
echo Backing up %%a
pause
echo Desktop
xcopy "%ProfileFolder%\%%a\Desktop\*.*" "%destination%\%FOLDER%\%username%\Desktop\" /e /c /h /k /y
pause
echo favorites
xcopy "%ProfileFolder%\%%a\Favorites\*.*" "%destination%\%FOLDER%\%username%\Favorites\" /e /c /h /k /y
rem xcopy "%ProfileFolder%\%%a\My Documents\*.*" "%destination%\%FOLDER%\%username%\My Documents\" /e /c /h /k /y
xcopy "%ProfileFolder%\%%a\Application Data\Microsoft\Outlook\*.*" "%destination%\%FOLDER%\%username%\Outlook2\" /e /c /h /k /y
rem xcopy "%ProfileFolder%\%%a\Local Settings\Application Data\Microsoft\Outlook\*.*" "%destination%\%FOLDER%\%username%\Outlook\" /e /c /h /k /y
xcopy "%ProfileFolder%\%%a\Application Data\Identities\*.*" "D:\Backup\001\%FOLDER%\%username%\oe\" /e /c /h /k /y
pause
)
:
pause
goto keys
-------------------------------------
Type2 -
@echo off & setLocal enableDELAYedeXpansioN
:start
cls
for /f "tokens=* delims= " %%a in ('dir/b "C:\Documents and Settings" ^| find /n /v "\\\"') do (
echo %%a
)
set /p C= Choose a profile to backup. (Press enter to end) -
echo !C!
set exit=%errorlevel%
if %exit% EQU 1 goto exitusers
::pause
goto start
:exitusers
echo exiting user selection
pause
--------------------------------------------
I'm new at batch files and don't know very much so bear with me.