Benutzer-Werkzeuge

Webseiten-Werkzeuge


fakturama:dos-link-creator
create-Fakturama-link.cmd
@echo off & setlocal ENABLEDELAYEDEXPANSION
 
REM script written by NoBBi
REM Version 20160425a
REM copy this cmd-file into an existing directory and you get the right name
echo.
echo.create link for Fakturama
echo.=========================
echo.
echo.will create a link to the Desktop for a Fakturama Shop
echo.
echo.creates a shortcut/link to the users desktop for multi-shop use
echo.like: C:\Prg\Fakturama\Fakturama.exe -workspace "C:\data\Fakturama\shop1" -data "C:\data\Fakturama\shop1"
echo or   "C:\Program Files (x86)\Fakturama\Fakturama.exe" -data "C:\data\Fakturama\shop1"
echo.and creates own data and workspace directories for each
echo.
pause
echo.%date% %time% ### Start script %~nx0
echo.--------------------------------------------------------
::set defaults 
set "_language=-nl de"
set "_activedir=%~dp0"
set "_activedir=%_activedir:~0,-1%"
set "_workspace=%_activedir%"
set "_datadir=%_activedir%"
 
for /f "usebackq" %%A in (`cd`) do set "_activedirname=%%~nA"
REM set "_shop=shop4711"
set "_shop=%_activedirname%" 
 
 
::Link Name (without ".lnk" )
set "_apptitel=Fakturama"
 
::Applicationpath (used for "execute in:" )
set "_appexe=Fakturama.exe"
if exist "C:\Program Files\Fakturama\%_appexe%" set "_appdir=C:\Program Files\Fakturama"
if exist "C:\Programme\Fakturama\%_appexe%" set "_appdir=C:\Programme\Fakturama"
if exist "C:\Prg\Fakturama\%_appexe%" set "_appdir=C:\Prg\Fakturama"
if not defined _appdir (
  set "_appdir=C:\Program Files (x86)\Fakturama"
  echo.Fakturama.exe not found in a default Path,
  echo.please install it or input right path
)
 
 
echo.
 
::ask for App
echo.define Application now
echo.----------------------
set /p _appdir=Path [%_appdir%] :
set /p _appexe=App.exe [%_appexe%] :
set /p _apptitel=Titel [%_apptitel%] :
 
if not exist "%_appdir%\%_appexe%" (
  echo.
  echo.File "%_appdir%\%_appexe%" do not exist
  echo.please install first
  echo."%_apptitel%" to "%_appdir%"
  pause
  exit 1
)
 
::ask for shopname
set /p _shop=Shopname [%_shop%] :
::merge apptitel with shopname
set "_apptitel=%_apptitel% %_shop%"
 
:choice_attributes
  set _attributes=
  set _a=3
  echo.
  echo.start application with
  echo. 0 = no attributes
  echo. 1 = -data
  echo. 2 = -workspace
  echo. 3 = -data and -workspace (do not work correctly in 1.6.3)
  set /p _a=Answer [%_a%] :
 
 
  if "%_shop%"=="%_activedirname%" (
    set "_shopdir=%_activedir%"
    set "_workspacedir=%_workspace%"
  ) else ( 
    set "_shopdir=%_datadir%\%_shop%"
    set "_workspacedir=%_workspace%\%_shop%"
  )
 
  ::ask for datadir
  for %%A in ("1" "3" ) do if "%_a%"==%%A (
 
    set "_datadir=%_shopdir%"
    set /p _datadir= -datadir [!_datadir!] : 
    if not exist "!_datadir!" md "!_datadir!"
    set _attributes=TRUE
    if "%_a%"=="1" set _workspace=
  )
 
  ::ask for workspace
  for %%A in ("2" "3" ) do if "%_a%"==%%A (
    set "_workspace=%_workspacedir%"
    set /p _workspace= -workspace [!_workspace!] : 
    if not exist "!_workspace!" md "!_workspace!"
    set _attributes=TRUE
    if "%_a%"=="2" set _datadir=
  )
 
  if "%_a%"=="0" (
    echo.create with no
                    
                                    
fakturama/dos-link-creator.txt · Zuletzt geändert: 2017/01/10 15:57 von Admin