@echo off

set program_files_path=%ProgramW6432%

if not exist "%program_files_path%" (
    set program_files_path=%ProgramFiles%
)

if not exist "%program_files_path%" (
    echo Error, program files path directory.
    pause
    exit
)

set install_dir=%program_files_path%\grandmall\
set file_target=%install_dir%\grandmall_printer.exe

if exist "%file_target%" (
    "%file_target%" stop
    "%file_target%" uninstall
    rmdir "%install_dir%" /S /Q
    echo:
    echo Uninstall success
) else (
    echo Print service file not found: grandmall_printer.exe
)

echo:
pause
