I think you need more error checking and you do not need to use Rmtshare.exe anymore.
I have added some lines to give you an idea. I also fixed the $Info[+9] to $Info[9]. code:
Break On Cls
;Directory and Source Variables
$SourceDir="D:\Sys\Users\" ; Local source path of user directories
$MappedDrive="E:\" ; Drive mapped to user share at other location
$SourceServer="\\CONGRESS-SVR1\" ; Server where original user dir is held
$DestServer="\\SVRCONGRESS\" ; Server where new user dir is to be copied
$DestSharePath="D:\Users\" ; directory on destination server to the path of the user directory
$PDC="SVRSTOKE" ; Primary Domain Controller
$HomeDirDrive="U:\" ; Home drive
$UserDirServer="CONGRESS-SVR1" ; Server holding the user directories
$Win32Admin = CreateObject("Win32Admin")
; Add proper error checking.
; You will find a script failure eventually and have no idea why.
if vartypename($Win32Admin) <> "Object"
? "@serror"
exit 1
endif
;Start Move
$UserDirList="G:\MoveDirs\Dirs.txt"
Open(1,$UserDirList,2)
$Dir=Readline(1)
While $Dir<>""
$SourceShare=$SourceServer + $Dir ; Share on source server to be removed
$DestShare=$DestServer + $Dir ; Share on destination server to be created
$SourceUserDir=$SourceDir + $Dir ; Path of the user dir on source server
$DestUserDir=$DestSharePath + $Dir ; Path of the user dir on destination server
$RmtUserDir=$MappedDrive + $Dir ; Location on the source server of the destination path
$Info = $Win32Admin.NetShareGetInfo ($UserDirServer, $Dir)
If $Info[9] = 0
;Shell "RmtShare $SourceShare /DELETE"
if $Win32Admin.NetShareDel ("CONGRESS-SVR1", $Dir)
? "Share deletion successful."
else
? "Error @serror"
endif
Shell "Robocopy $SourceUserDir $RmtUserDir /E /SEC /MOVE /XF paradox.cfg /LOG+:MoveUserDir.txt"
Shell "Robocopy $SourceUserDir $RmtUserDir paradox.cfg /SEC /LOG+:MoveUserDir.txt"
;Shell "RmtShare $DestShare=$DestUserDir"
if $Win32Admin.NetShareAdd ("SVRCONGRESS", "myShare", "STYPE_DISKTREE", "User Home Share", -1, "D:\Users\$UserID")
? "Share successfully created"
else
? "Error @serror"
endif
Shell "NTUser -s $PDC change $Dir -home_dir $DestServer$Dir -home_dir_drive $HomeDirDrive"
EndIf
$Dir=Readline(1)
Loop
Close(1)
Return