chrischambers
Content Type
Profiles
Forums
Events
Posts posted by chrischambers
-
-
First thing I see is this:
set docsfolder=%docsfolder:\chris.txt=%
If you are after setting dodsfolder to say c:\chris.txt it should be
set docsfolder=%docsfolder%:\chris.txt
other wise it will stay being just the drive letter.
Second I believe the way you are setting the environment variable, by adding it to the registry requires a reboot before it is available in any applications or command windows other than the original window it was created in.
I think that you might have miss read the code, set docsfolder=%docsfolder%:\chris.txt - is setting the docsfolder to the path of the "My documents" as this folders has different locations
regarding setting up the Variables for Desktop and Fav, this I don't want to do, as this code is only backing up and zipping up the folders in readiness for transfer.
0 -
Hi
looking through some of the posting I found the problem to one of my problems were I need to find and set a DocFolder Variable for My Documents as my users has there My Docs in different places.
here is the code I found.
@echo off
set tagfile==%UserName%.txt
echo %UserName%.txt
for %%d in (c d e f g h i j k l m n o p q r s t u v w x y z) do (
if exist %%d:\nul (
pushd "%%d:\"
for /f "usebackq delims==" %%i in (`dir /s /b %tagfile% ^2^>nul`) do (
set docsfolder=%%i
)
popd
)
)
set docsfolder=%docsfolder:\chris.txt=%
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Personal /d "%docsfolder%" /f >nul
echo %docsfolder%
pause:
goto :eofI have a little script that creates and place a txt file in each users my documents.
this was in readiness for the migrating of Users to a new Computer. so I need to do is copy there profile details and My documents and place on a backup server.
I am able to do find and backup the user’s desktop and Favourites from they profile, but when I use my New Variable %docsfolder% to locate and backup the users data. For some reason it is not finding the variable reference.
here is my backup code.
echo Off
REM - FIRST MAKE SURE THAT THE TAGFILE PROGRAM IS RAN.
REM -
REM - this Batch file is to backup and zip all the users files from the local
REM - machine and to place it onto a share folder on a server
REM -
rem ** Map to a share location
net use I: \\chris_laptop\mirgation
rem - Create a User Folder on the server and local machine
mkdir I:\users\%Username%
mkdir c:\archive
REM copy pkzipc to the local machine
REM copy I:\pkzipc.exe c:\
REM - Zip the Default folders from the user profile and place then into the archive folder
Echo Archiving %username% Profile
pkzipc -add -silent -path=specify c:\archive\profile.zip "c:\%homepath%\desktop\*.*"
pkzipc -add -silent -path=specify c:\archive\profile.zip "c:\%homepath%\favorites\*.*"
Echo Archiving %username% MyDocuments
REM pkzipc -silent -add -path=specify c:\archive\profile.zip "c:\%commydocdir%\My Documents\*.*"
REM pkzipc -silent -add -path=specify c:\archive\profile.zip "c:\%homepath%\My Documents\*.*"
echo My Documents location - %docsfolder%
pkzipc -silent -add -path=specify c:\archive\profile.zip "%docsfolder%\Convenandes\*.*"
REM - check for other application
IF not EXIST "C:\Lotus\Notes\ah7lena.dat" goto ENDNOTES
Echo Archving Lotus Notes
pkzipc -add -silent -path=specify c:\archive\notes.zip "c:\lotus\notes\*.*"
goto end
:ENDNOTES
Echo Not a Lotus Notes Users
REM Put more If statements here
:end
REM - Copy all the files from the C:\archive
echo Moving files to Archive Folder
xcopy c:\archive\*.* I:\users\%Username% /e/i/y/r/k
REM - BACKUP COMPLETE
echo Archving of all user information is complated
REM - clean up hard drive
rmdir c:\archive /s /q
pauseCan anyone see why this is not working. ?
0
Post-SP2 Updates for Office 2010 (Updated 14 NOV 2015)
in User Contributed Update Lists
Posted
I am sorry if this sounds a bit dumb, but I have just found your site, and I am hoping someone, can inform me on how I can use the "office2010-sp2-x86.ulz" files, as I need to download and keep up today the office 2010 application at work,
I see that MS Office has about 52 updates, and patch's after the release of SP2, and I have a few standalone machines that I need to update, and also to import the update into WDS.