@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
@ECHO -------------------------------------
@ECHO Windows version:
ver
@ECHO -------------------------------------
REM Test for current directory short name
SET ROOT_DIR=%~dp0
SET TMP_DIR=""
for /d %%I in ("%ROOT_DIR%") do (
  if %TMP_DIR% == "" (
    SET TMP_DIR=%%~sI
  )
)
SET TILD_FOUND=false
@ECHO %TMP_DIR% | find /i "~" > nul && if %errorlevel%==0 set TILD_FOUND=true
@ECHO:

if !TILD_FOUND! == true GOTO NAMEOK
GOTO NAMEKO

:NAMEOK
@ECHO ~ found in directory short name. Alright :-)
@ECHO:
@ECHO Your application should work normally.
GOTO END

:NAMEKO
@ECHO ~ not found in directory short name. Oh No :-(
@ECHO:
@ECHO The resolved directory short name is "%TMP_DIR%"
@ECHO  * If this does'nt look like an effective short name,
@ECHO    then it means your Windows disables the use of short names.
@ECHO     - If so, rename this folder to use a short name,
@ECHO       and ensure all its potential parent folders also use a short name.
@ECHO     - If any parent folder does'nt have a short name,
@ECHO       don't hesitate to move your application folder to another location
@ECHO       (don't rename parent folders).
@ECHO  * However, if it looks like a short name, everything is ok.
GOTO END

:END
@ECHO:
PAUSE