Couple of addendums on batch file

This version deals with XP systems which have no idea what UAC is


 Code:
@ECHO OFF

ver | findstr /i "5\.1\."
IF %ERRORLEVEL% EQU 0 GOTO XP

IF EXIST %SystemDrive%\KIX\KIX32Current.txt GOTO LOCAL
GOTO REMOTE

:LOCAL
%0\..\elevate -c %SystemDrive%\KIX\Kix32 %0\..\RLCMAIN.KIX -f
GOTO END

:REMOTE
%0\..\elevate -c %0\..\Kix32 %0\..\RLCMAIN.KIX -f
GOTO END

:XP
%0\..\Kix32 RLCMAIN.KIX -f 
GOTO END

:END
EXIT


I also found some issues with Terminal server, which can be avoided by checking the computer name first in the batch file and avoiding using elevate. There may be a better work around for these issues too, but I did not spend much time on it.

Finally, if you call sub-scripts from within your scripts make sure you give an absolute path during the call so:

 Code:
CALL $DriveMappingFile


Would fail to find the script.

 Code:
CALL "@SCRIPTDIR/$DriveMappingFile"


Would work fine.

There is a 32-bit and a 64-bit version of elevate, but I found the 32-bit version seems to work fine in all situations.


Edited by IanDubbelboer (2016-10-13 12:56 AM)