It starts with a batch file, which calls the kix32 scripts.


The whole thing starts with "migrate <username>"

(Migrate.bat)
====================================
@echo off

:setuser
IF "%1"=="" GOTO ERROR
set username=%1

C:\TEMP\TOOLS\KIX32.EXE first.scr
GOTO FINISH

:ERROR
echo ********************
echo the right syntax is
echo migrate <username>
echo for sample "migrate ee00430
echo ********************

Goto END

:FINISH
echo *********************
echo migration succesful!!
echo *********************

:END

====================================


(first.scr)
====================================
USE B: /D
USE B: "\\distrsrv\USERDATA\" + "%USERNAME%"
Shell '%comspec% /c md "B:\Application Data\Lotus\Notes"'
Shell '%comspec% /c md "B:\My Documents"'

USE Z: /D
USE Z: "\\server1\USERDATA\" + "%USERNAME%"

Shell '%comspec% /c C:\TEMP\TOOLS\ROBOCOPY.EXE "Z:\NOTES" "B:\APPLICATION DATA\LOTUS\NOTES" /E'
SHELL 'c:\winnt\system32\cmd.exe /c COPY "Z:\Notes.ini" "B:\Applic~1\LOTUS\NOTES\notes.ini" /Y'

CALL C:\TEMP\TOOLS\second.scr

:end
====================================


(second.scr)
====================================
USE B: /D
USE B: "\\distrsrv\USERDATA\" + "%USERNAME%"

USE Z: /D
USE Z: "\\server4\USERPROF\" + "%USERNAME%"
Shell '%comspec% /c md "B:\BACKUP"'

Shell '%comspec% /c C:\TEMP\TOOLS\ROBOCOPY.EXE "Z:\FAVORITES" "B:\BACKUP\FAVORITES" /E'
Shell '%comspec% /c C:\TEMP\TOOLS\ROBOCOPY.EXE "Z:\COOKIES" "B:\BACKUP\COOKIES" /E'

Shell '%comspec% /c C:\TEMP\TOOLS\XCOPY.EXE "Z:\DESKTOP\*.DOC" "B:\MY DOCUMENTS" /E /H /Y'
Shell '%comspec% /c C:\TEMP\TOOLS\XCOPY.EXE "Z:\DESKTOP\*.PPT" "B:\MY DOCUMENTS" /E /H /Y'
Shell '%comspec% /c C:\TEMP\TOOLS\XCOPY.EXE "Z:\DESKTOP\*.TXT" "B:\MY DOCUMENTS" /E /H /Y'
Shell '%comspec% /c C:\TEMP\TOOLS\XCOPY.EXE "Z:\DESKTOP\*.MD?" "B:\MY DOCUMENTS" /E /H /Y'
Shell '%comspec% /c C:\TEMP\TOOLS\XCOPY.EXE "Z:\DESKTOP\*.XLS" "B:\MY DOCUMENTS" /E /H /Y'
Shell '%comspec% /c C:\TEMP\TOOLS\XCOPY.EXE "Z:\DESKTOP\*.ZIP" "B:\MY DOCUMENTS" /E /H /Y'

Shell '%comspec% /c C:\TEMP\TOOLS\XCOPY.EXE "Z:\PERSONAL\*.DOC" "B:\MY DOCUMENTS" /E /H /Y'
Shell '%comspec% /c C:\TEMP\TOOLS\XCOPY.EXE "Z:\PERSONAL\*.PPT" "B:\MY DOCUMENTS" /E /H /Y'
Shell '%comspec% /c C:\TEMP\TOOLS\XCOPY.EXE "Z:\PERSONAL\*.TXT" "B:\MY DOCUMENTS" /E /H /Y'
Shell '%comspec% /c C:\TEMP\TOOLS\XCOPY.EXE "Z:\PERSONAL\*.MD?" "B:\MY DOCUMENTS" /E /H /Y'
Shell '%comspec% /c C:\TEMP\TOOLS\XCOPY.EXE "Z:\PERSONAL\*.XLS" "B:\MY DOCUMENTS" /E /H /Y'
Shell '%comspec% /c C:\TEMP\TOOLS\XCOPY.EXE "Z:\PERSONAL\*.ZIP" "B:\MY DOCUMENTS" /E /H /Y'

CALL C:\TEMP\TOOLS\third.scr

:END
====================================


(third.scr)
====================================
USE B: /D
USE B: "\\distrsrv\USERDATA\" + "%USERNAME%"

IF EXIST("\\server6\department1\" + "%USERNAME%") = 1
USE Z: /D
USE Z: "\\server6\department1"
Shell '%comspec% /c C:\TEMP\TOOLS\XCACLS.EXE "Z:\%username%" /Y /T /R "Domain\Domain admins"'
Shell '%comspec% /c C:\TEMP\TOOLS\ROBOCOPY.EXE "Z:\%username%" "B:\My Documents" /E'

Shell '%comspec% /c C:\TEMP\TOOLS\XCACLS.EXE B: /Y /T /R "Domain\Domain admins"'
Shell '%comspec% /c C:\TEMP\TOOLS\XCACLS.EXE B: /Y /T /E /G "Domain\%username%:C"'

ELSE ""
ENDIF


IF EXIST("\\server6\department2\" + "%USERNAME%") = 1
USE Z: /D
USE Z: "\\server6\department2"
Shell '%comspec% /c C:\TEMP\TOOLS\XCACLS.EXE "Z:\%username%" /Y /T /R "Domain\Domain admins"'
Shell '%comspec% /c C:\TEMP\TOOLS\ROBOCOPY.EXE "Z:\%username%" "B:\My Documents" /E'

Shell '%comspec% /c C:\TEMP\TOOLS\XCACLS.EXE B: /Y /T /R "Domain\Domain admins"'
Shell '%comspec% /c C:\TEMP\TOOLS\XCACLS.EXE B: /Y /T /E /G "Domain\%username%:C"'

ELSE ""
ENDIF

this goes on and on, had to do this for 30 departments


:END

================================

I just wish I can make this shorter...ah well...I still have to built in some more "if end else" but this works so I can go further

Any comment I appreciate it.

Cheers.