Would changing your BAT file to this get rid of the popup error?
 Code:
@Echo Off
REM net use P: \\server\App$

REM If va-ctx is in computername then runs
if /i "%computername:~0,6%"=="va-ctx" (XD4ClientName.exe)

REM Runs the kix script
kix32.exe kixtart.kix

And then just keep this in your kix script...
 Code:
$ComputerPrt = IIf(%XDClientName%,%XDCLientName%,@WKSTA)
$ComputerPrt = Left($ComputerPrt, 6)