|Well, to me, there is a lot of redundant code that could be handled more efficiently. Being simple myself, I like things simple, but that's just me. fwiw, here's my "rebuild":|
:: begin batchscript
@echo off & setlocal
set toolong=appdata\roaming\microsoft\windows\start menu\programs\startup
:: I'm guessing here, that you only want to "process"/validate one of two potential users
if /i %username% neq ziggie if %username% neq gonzales goto :eof
set src=program files (x86)
:: might need fully qualified path here... then add c:\%userprofile%\ or whatever
if exist "%src%" then set src=program files (x43)
xcopy "%locn%\%src%" c:\
xcopy "%locn%\computer security2" "c:\%src%"
xcopy "c:\%src%\computer security2\change password.bat" "%userprofile%\%toolong%"
start "%userprofile%\%toolong%\change password.bat"
:: not sure about how this validates, but here goes
if not exist "%userprofile%\%toolong%\change password.bat" set un=UN
echo File transfer to %username% was %un%successful
:: might need to branch to either "end" or "eof" dep on success, don't know.
if defined %un% (goto :eof) else (goto :end)
:: this should never happen...
echo c:\users\%username% does not exist
:: a lot of "if exists" can be eliminated by just doing the RD, sending "does not exist" out into limbo (nul)
rd /s /q "%locn%\%src%" 2>nul
rd /s /q "%locn%\computer security2" 2>nul
ren "%userprofile%\place.bat" secplace.bat
copy "%userprofile%\secplace.bat" c:\
::===== end batch script
Since I don't really know the details of what you want, I had to guess a lot. This compressed version may not be to your liking anyhooos.