@Echo off
 setlocal EnableDelayedExpansion EnableExtensions
 rem -----------------------------------------------------------------------------------------
 rem erstellt das Application Startmenü mit allen erforderlichen verkuepfungen
 rem
 rem Stand 04.04.2007  J.fes

 rem Optionsparameter:
 rem P1 Quiet Modus
 set Quiet=false
 if /I "%1"=="/Quiet" set Quiet=true


 rem Root Variablen
 set MyApplBase_TP=JobManagerV2
 set MyApplProd_N=PLMJobManagerV2

 set MyAppl_Root_DP=%~dp0
 set MyAppl_Root_DP=%MyAppl_Root_DP:~0,-1%

 rem Server Dirs ermitteln
 call :PathCutLastDir MyAppl_Root_DP %~dp0
 set BinServer_DP=%MyAppl_Root_DP%\01-BinServer
 set BinClient_DP=%MyAppl_Root_DP%\02-BinClient
 set BinPublic_DP=%MyAppl_Root_DP%\03-BinPublic
 set IconsDir_DP=%MyAppl_Root_DP%\99-Install\Icons
 set ComponentsDir_DP=%MyAppl_Root_DP%\99-Install\Components

 rem set Quick Launch_DP=C:\Dokumente und Einstellungen\user\Anwendungsdaten\Microsoft\Internet Explorer\Quick Launch
 set QuickLaunch_DP=%APPDATA%\Microsoft\Internet Explorer\Quick Launch

 set StartMenu_DP=%MyAppl_Root_DP%\_%MyApplBase_TP%
 rem wieder ausbauen !!
 rem Echo wieder ausbauen
 rem call :DelDirIfExist "%StartMenu_DP%"
 rem if exist "%StartMenu_DP%" rd /S /Q "%StartMenu_DP%"
 rem 13.08.2013/J.Fes 01-Install ersetzt durch 01-Install_and_Setup
 call :DelDirIfExist "%StartMenu_DP%\01-Install"
 rem 13.08.2013/J.Fes 02-Setup aufgeloest
 call :DelDirIfExist "%StartMenu_DP%\02-Setup"
 rem 13.08.2013 Clean Up WhatsNew
 call :DelDirIfExist "%MyAppl_Root_DP%\10-Documentation.Application\01-Install"
 call :DelDirIfExist "%MyAppl_Root_DP%\10-Documentation.Application\02-Setup"
 call :DelDirIfExist "%MyAppl_Root_DP%\10-Documentation.Application\03-WhatsNew"


 set StartMenu_00-Doku_DP=%StartMenu_DP%\10-Documentation.Application
 rem 13.08.2013 01-Install umbenannt nach 01-Install_and_Setup
 set StartMenu_01-Install_DP=%StartMenu_DP%\01-Install_and_Setup
 set StartMenu_01-InstallDocu_DP=%StartMenu_01-Install_DP%
  REM  13.08.2013 02-WhatsNew eingefügt
 set StartMenu_02-WhatsNew_DP=%StartMenu_DP%\02-WhatsNew
 set StartMenu_80-OpenFolder_DP=%StartMenu_DP%\80-OpenFolder
 set StartMenu_90-Tools_DP=%StartMenu_DP%\90-Tools


 set MyTitle=Create Application Startmenue (%MyAppl_Root_DP%...)
 Echo.
 Echo --------------------------------------------------------------------------
 Echo %MyTitle%
 Title %MyTitle%
 Echo.

 if /i "%Quiet%"=="true" goto :JobPlanerLinkDoCreate_JumbOver
 Echo Create JobPlaner Start Link?
 rem new 08.10.2010 damit beim erzeugen der Links via ..\07-InstallCreate\PLMJobManagerV2-Install-SoftwareComponent.ahk keine rueckfrage auf den JobPlaner kommt
 set /P JobPlanerLinkDoCreate="Type 'Y' to Create JobPlaner Link (Default=No) "
 :JobPlanerLinkDoCreate_JumbOver


 if /I "%JobPlanerLinkDoCreate%" equ "Y" (
   set JobPlanerLinkDoCreate=Yes
 ) else (
   set JobPlanerLinkDoCreate=No
 )

 rem set Path=%03-BinPublic_DP%;%02-BinClient_DP%;%01-BinServer_DP%;%Path%
 set Path=%MyAppl_Root_DP%\03-BinPublic;%Path%
 if not exist "%StartMenu_DP%"                md "%StartMenu_DP%"
 if not exist "%StartMenu_01-Install_DP%"     md "%StartMenu_01-Install_DP%"
 if not exist "%StartMenu_01-InstallDocu_DP%" md "%StartMenu_01-InstallDocu_DP%"
 if not exist "%StartMenu_02-WhatsNew_DP%"    md "%StartMenu_02-WhatsNew_DP%"

 if not exist "%StartMenu_80-OpenFolder_DP%"  md "%StartMenu_80-OpenFolder_DP%"
 if not exist "%StartMenu_90-Tools_DP%"       md "%StartMenu_90-Tools_DP%"



REM Echo ##Debug 19.04.2011 14:26
REM goto :TestCurr

rem ############## Main Progs #####################
:Next
 set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application
 set toRun=jfShellLinkCreate.exe /Quiet /FolderLink
 set toRun=%toRun% /LinkFile="%StartMenu_DP%\10-Documentation.Application"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 set LinkDest_DPNE=%MyAppl_Root_DP%\11-Documentation.Custom
 set toRun=jfShellLinkCreate.exe /Quiet /FolderLink
 set toRun=%toRun% /LinkFile="%StartMenu_DP%\11-Documentation.Custom"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- link auf 91-PLMJobManagerV2_Setup_Customer.ppt
 set LinkDest_DPNE=%MyAppl_Root_DP%\11-Documentation.Custom\91-PLMJobManagerV2_Setup_Customer.ppt
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_DP%\91-PLMJobManagerV2_Setup_Customer.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%ComponentsDir_DP%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- link auf 92-PLMJobManagerV2_PLMDataCheck_Customer.ppt
 set LinkDest_DPNE=%MyAppl_Root_DP%\11-Documentation.Custom\92-PLMJobManagerV2_PLMDataCheck_Customer.ppt
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_DP%\92-PLMJobManagerV2_PLMDataCheck_Customer.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%ComponentsDir_DP%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


:Next
 rem -- link auf 95-PLMJobManagerV2_ToDoListe_Customer.xls
 set LinkDest_DPNE=%MyAppl_Root_DP%\11-Documentation.Custom\95-PLMJobManagerV2_ToDoListe_Customer.xls
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_DP%\95-PLMJobManagerV2_ToDoListe_Customer.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%ComponentsDir_DP%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%



rem #################### 00-DOCU  #########################
rem siehe hier immer auch Link Create bei Install und Setup
 rem Echo - Create Link's: 00-Documentation (info deaktiviert 17.11.2008)
 goto :00-DOCU-LINKS-CREATE-START
:Next
 rem -- Siemens-PLMJobManager_NXRefile-Customer-Guide_V11
 set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\Siemens-PLMJobManager_NXRefile-Customer-Guide_V11.pdf
 set LinkFile_DPNE=%StartMenu_00-Doku_DP%\90 Siemens PLMJobManager NXRefile Customer Guide.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


:Next
 rem -- PLMJobManager_NXRefile_ProduktPraesentation_Siemens_PLM_DE
 set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\PLMJobManager_NXRefile_ProduktPraesentation_Siemens_PLM_DE.pdf
 set LinkFile_DPNE=%StartMenu_00-Doku_DP%\91 JobManagerV2 Praesentation Deutsch.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- PLMJobManager_NXRefile_ProduktPraesentation_Siemens_PLM_ENG
 set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\PLMJobManager_NXRefile_ProduktPraesentation_Siemens_PLM_ENG.pdf
 set LinkFile_DPNE=%StartMenu_00-Doku_DP%\92 JobManagerV2 Praesentation English.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

rem ################ DOKU Links ##################
:00-DOCU-LINKS-CREATE-START



rem ############## SETUP #####################

 rem -- Install and Setup Dokumentation
 Echo - Create Link's: 01-Install and Setup

:Next
 rem 22.03.2013 14:28 J.Fes
 rem --- JobMgr CMDtool CBSettings Start neu 21.03.2013 J.Fes
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManager_WhatsNew.txt
 set LinkFile_DPNE=%StartMenu_01-Install_DP%\10 -------- (JobManagerV2 Docu) ---------.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\99-Install\Icons\setup.ico"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


:Next
 rem -- Install Overview
 REM angepasst 13.08.2013/J.Fes set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\01-Install\JobManagerV2_Docu_Install_Overview_JFES_FG.pdf
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManagerV2_Docu_Install_Overview_JFES.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\11 JobManagerV2 Docu Install Overview.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- JobManagerV2 Docu Install
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManagerV2_Docu_Install_PLMJobManager_DE.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\12 JobManagerV2 Docu Install PLMJobManager.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


:Next
 rem -- 13 JobManagerV2 Docu Install SQLServer
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManagerV2_Docu_Install_SQLServer_DE.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\13 JobManagerV2 Docu Install SQLServer.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- JS Setup Dokumentation
 rem -- 13.08.2013 angepasst
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManagerV2_Docu_Setup_DE.pdf

 set LinkFile_DPNE=%StartMenu_01-Install_DP%\14 JobManagerV2 Docu Setup.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- Version Info
 set LinkDest_DPNE=%MyAppl_Root_DP%\01-BinServer\ApplicationInfo.txt
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\15 JobManagerV2 Version Info.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- User Dokumentation
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManagerV2_Docu_DE.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\16 JobManagerV2 User Documentation.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%
 rem Link auch im 10-Documentation.Application Ordner kopieren
 call :DelIfExist "%MyAppl_Root_DP%\10-Documentation.Application\JobManagerV2_Docu_DE.lnk"
 if exist "%LinkFile_DPNE%" copy "%LinkFile_DPNE%" "%MyAppl_Root_DP%\10-Documentation.Application\JobManagerV2 User Documentation.lnk">nul
REM  if exist "%LinkFile_DPNE%" copy "%LinkFile_DPNE%" "%StartMenu_DP%\90-PLMJobManagerV2_Docu.*">nul




rem ######################################################
:Next
 rem 22.03.2013 14:28 J.Fes
 rem --- JobMgr CMDtool CBSettings Start neu 21.03.2013 J.Fes
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManager_WhatsNew.txt
 set LinkFile_DPNE=%StartMenu_01-Install_DP%\20 -------- (Setup Tools) ---------.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\99-Install\Icons\setup.ico"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


:Next
 rem 22.03.2013 14:28 J.Fes
 rem --- JobMgr CMDtool CBSettings Start neu 21.03.2013 J.Fes
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic.ClientServer\JobManagerCmdTools_SettingsManager\JobManagerStart.cmd
 set LinkFile_DPNE=%StartMenu_01-Install_DP%\23 CheckBox (Settings Manager) Setup.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic.ClientServer\JobManagerCmdTools_SettingsManager"
 set toRun=%toRun% /Arguments="/JobMgrCmdTools_CBSettingsMgr -ApplMode Setup"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic.ClientServer\JobManagerCmdTools_SettingsManager\JobMgrCmdTools_CBSettingsMgr.exe"
 set toRun=%toRun% /Description="JobMgr CMDtool CBSettings %JobMgrSystem% (%MyAppl_Root_DP%\03-BinPublic.ClientServer\JobManagerCmdTools_SettingsManager\JobMgrCmdTools_CBSettingsMgr.exe)"
 set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem 22.03.2013 14:28 J.Fes
 rem --- JobMgr CMDtool CBSettings Start neu 21.03.2013 J.Fes
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManager_WhatsNew.txt
 set LinkFile_DPNE=%StartMenu_01-Install_DP%\30 -------- (Update Tools) ---------.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\92-Update\JobManagerUpdate.exe"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem 22.03.2013 14:28 J.Fes
 rem --- JobMgr CBSettings Manager Start neu 21.03.2013 J.Fes
 set LinkDest_DPNE=%MyAppl_Root_DP%\92-Update\JobManagerUpdate.exe
 set LinkFile_DPNE=%StartMenu_01-Install_DP%\31 JobManager Software Update.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /Description="Start: JobMgr Software Update Tool"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

 set LinkDest_DPNE=%MyAppl_Root_DP%\92-Update
 set LinkFile_DPNE=%StartMenu_01-Install_DP%\32 JobManager Software Update open Folder.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /Description="Open: JobMgr Software Update Folder"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


:Next
 rem -- Verknüpfung auf diese Startmenu Create Update Routine selber
 set LinkDest_DPNE=%~0
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_01-Install_DP%\33 JobManager Startmenu Create or Update.lnk"
 set toRun=%toRun% /LinkDest=%LinkDest_DPNE%
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\01-BinServer"
 rem set toRun=%toRun% /Arguments=
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\01-BinServer\MyApplIconSet.ico"
 set toRun=%toRun% /Description="Creates or Updates the application Startmenue"
 set toRun=%toRun% /DisplayMode="Normal"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


:Next
rem ############## WHATS NEW #####################
 Echo - Create Link's: 02-WhatsNew

 call :DelIfExist "%MyAppl_Root_DP%\10-Documentation.Application\JobManagerV2 WhatsNew.lnk"
 rem -- WhatsNew Dokumentation  Link in JobManagerV2\10-Documentation.Application legen
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManager_WhatsNew.txt
 rem -- !! Achtung Info vom 20.07.09/J.Fes Link in den das %MyAppl_Root_DP%\10-Documentation.Application Verzeichniss legen da ..\_JobManagerV2\10-Documentation.Application ein Ordner link ist!!
 set LinkFile_DPNE=%StartMenu_02-WhatsNew_DP%\01 JobManagerV2 WhatsNew.txt.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem Update 01.02.2013 15:22 / J.Fes S.Gueth
 rem -- !! Achtung Info vom 20.07.09/J.Fes Link in den das %MyAppl_Root_DP%\10-Documentation.Application Verzeichniss legen da ..\_JobManagerV2\10-Documentation.Application ein Ordner link ist!!
 call :DelIfExist "%MyAppl_Root_DP%\10-Documentation.Application\JobManagerV2 WhatsNew.xls.lnk"
 set LinkFile_DPNE=%StartMenu_02-WhatsNew_DP%\02 JobManagerV2 WhatsNew.xls.lnk
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManager_WhatsNew.xls
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem Update #New 18.02.2013 11:30 / J.Fes S.Gueth
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManager_WhatsNew.pdf
 call :DelIfExist "%MyAppl_Root_DP%\10-Documentation.Application\JobManagerV2 WhatsNew.pdf.lnk"
 set LinkFile_DPNE=%StartMenu_02-WhatsNew_DP%\03 JobManagerV2 WhatsNew.pdf.lnk
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManager_WhatsNew.pdf

 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


 rem ############################# 80-OpenFolder ###################
:Next
 Echo - Create Link's: 80-OpenFolder
 call :DelIfExist "%StartMenu_80-OpenFolder_DP%\01-%MyApplBase_TP% Application root folder.lnk"
 set LinkDest_DPNE=%MyAppl_Root_DP%
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_80-OpenFolder_DP%\00-%MyApplBase_TP% Application root folder.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%LinkDest_DPNE%"
 rem set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.ico"
 set toRun=%toRun% /Description="open's ServerRoot folder [%MyAppl_Root_DP%] via Explorer"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%



:Next
 set LinkDest_DPNE=%MyAppl_Root_DP%\11-Documentation.Custom
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_80-OpenFolder_DP%\11-Documentation.Custom folder.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%LinkDest_DPNE%"
 set toRun=%toRun% /Description="open's the Custom Documentation folder"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- Link to 03-BinPublic.Custom folder
 set LinkDest_DPNE=%MyAppl_Root_DP%\01-BinServer.Custom
 if not exist "%LinkDest_DPNE%" md "%LinkDest_DPNE%"
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_80-OpenFolder_DP%\01-BinServer.Custom.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%LinkDest_DPNE%"
 set toRun=%toRun% /Description="open's the 01-BinServer.Custom [%LinkDest_DPNE%]"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- Link to 03-BinPublic.Custom folder
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic.Custom
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_80-OpenFolder_DP%\03-BinPublic.Custom.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%LinkDest_DPNE%"
 rem set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.ico"
 set toRun=%toRun% /Description="open's the 03-BinPublic.Custom [%LinkDest_DPNE%]"
 if not exist "%LinkDest_DPNE%" md "%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- Link to Data folder
 set LinkDest_DPNE=%MyAppl_Root_DP%\90-DATA
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_80-OpenFolder_DP%\90-DATA folder.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%LinkDest_DPNE%"
 rem set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.ico"
 set toRun=%toRun% /Description="open's the Custom Data folder [%LinkDest_DPNE%]"
 if not exist "%LinkDest_DPNE%" md "%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 set LinkDest_DPNE=%MyAppl_Root_DP%\01-BinServer\JobManagerStart.cmd
 set LinkFile_DPNE=%StartMenu_80-OpenFolder_DP%\91-JobManager Program local.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\01-BinServer"
 set toRun=%toRun% /Arguments=/JobMgrLocalRoot_Open
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\99-Install\Icons\folderOpen.ico"
 set toRun=%toRun% /Description="open's LocalRoot folder via Explorer"
 set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


rem ############## 90-Tools #####################
:Next
 Echo - Create Link's: 90-Tools
 rem -- Context Link Create --------------------------------

 rem alten link löschen!! 3.8.09
 call :DelIfExist "%StartMenu_90-Tools_DP%\11-ConTEXT (Texteditor).lnk"
 set LinkFile_DPNE=%StartMenu_90-Tools_DP%\11-PSPad (Texteditor).lnk
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\PSPad editor\PSPad.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\PSPad editor"
 set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.ico"
 set toRun=%toRun% /Description="PSPad Texteditor"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%
 rem copy Link in QuickLaunch
 copy "%LinkFile_DPNE%" "%QuickLaunch_DP%\*.*" >nul


:Next
 rem -- MWSnap Link Create --------------------------------
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\MWSnap\MWSnap.exe
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\12-MWSnap (screen capture).lnk"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\MWSnap"
REM  set toRun=%toRun% /Arguments=
REM  rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.ico"
REM  set toRun=%toRun% /Description="Screenshot software"
REM  if not exist "%LinkDest_DPNE%" goto :next
REM  %toRun%
 REM  entnommen 11.03.2010 und ersetzt durch PicPick
 REM  hier hinzugefuegt am 26.03.2010 da PicPick nicht immer funktoniert!
 rem wieder entnommen 11.03.2011 14:32
 if exist "%StartMenu_90-Tools_DP%\12-MWSnap (screen capture).lnk" del "%StartMenu_90-Tools_DP%\12-MWSnap (screen capture).lnk"


 :Next
 rem new in 11.03.2010 J.Fes
 rem update 05.09.2013 J.Fes
 rem -- ScreenShot Link Create --------------------------------

REM  set ScreenShotDir=%MyAppl_Root_DP%\11-Documentation.Custom\ScreenShots
REM  if not exist "%ScreenShotDir%" Echo I: Create ScreenShotDir:"%ScreenShotDir%" & md "%ScreenShotDir%"


 call :DelIfExist "%StartMenu_90-Tools_DP%\12-PicPick (screen capture).lnk"
 call :DelIfExist "%StartMenu_90-Tools_DP%\12-PicPick Restart (screen capture).lnk"
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\Greenshot\Greenshot.exe

 set LinkDest_DPNE=%MyAppl_Root_DP%\02-BinClient\JobManagerStart.cmd
 set LinkFile_DPNE=%StartMenu_90-Tools_DP%\12-ScreenShot (Use Print Key to Capture ScreenShots).lnk

 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir=
 set toRun=%toRun% /Arguments=/Screenshot
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\Greenshot\Greenshot.exe"
 set toRun=%toRun% /Description="Start Screenshot software"
 set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


REM  rem call :DelIfExist "%LinkFile_DPNE%"
REM  set LinkFile_DPNE="%StartMenu_90-Tools_DP%\12-PicPick (screen capture).lnk"
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\PicPick\PicPick.exe
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\PicPick"
REM rem 12.08.2011 10:01 entnommen
REM REM  set toRun=%toRun% /Arguments=/cr
REM  set toRun=%toRun% /Description="Screenshot software"

REM  if not exist "%LinkDest_DPNE%" goto :next
REM  %toRun%
 rem copy Link in QuickLaunch
 copy "%LinkFile_DPNE%" "%QuickLaunch_DP%\*.*" >nul

REM  :Next
REM  rem new in 08.10.2010 J.Fes
REM  rem -- PicPick Link Create --------------------------------
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\PicPick\PicPickRestart.cmd
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\12-PicPick Restart (screen capture).lnk"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\PicPick\PicPickRestart.ico"
REM  set toRun=%toRun% /Description="Screenshot software restart"
REM  set toRun=%toRun% /DisplayMode="Min"
REM  if not exist "%LinkDest_DPNE%" goto :next
REM  %toRun%

:Next
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\7-Zip\7zFM.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\13-7-Zip (Zip File Manager).lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic"
REM  set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.ico"
 set toRun=%toRun% /Description="7-Zip File Manager"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


:Next
REM  rem -- 03-BinPublic\UltraVnc Link Create --------------------------------------
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\UltraVnc\winvnc.exe
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\14-WinVNC Server start (remote contol).lnk"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\UltraVnc"
REM  set toRun=%toRun% /Arguments=
REM  rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.ico"
REM  set toRun=%toRun% /Description="WinVNC Server software start"
REM  if not exist "%LinkDest_DPNE%" goto :next
REM  %toRun%
 rem Cleanup
 call :DelIfExist "%StartMenu_90-Tools_DP%\13-WinVNC Server start (remote contol).lnk"
rem 03.01.2013 J.Fes removed
 call :DelIfExist "%StartMenu_90-Tools_DP%\14-WinVNC Server start (remote contol).lnk"

:Next
REM  rem -- 03-BinPublic\UltraVnc Link Create --------------------------------------
REM  rem set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\UltraVnc\vncviewer.exe
REM  rem 5.2.09 angepasst auf CMD..
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\RemoteControlConnectClient_Via_UltraVNC.cmd
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\15-WinVNC Client viewer (remote contol).lnk"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  rem set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic"
REM  set toRun=%toRun% /Arguments=
REM  set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\UltraVnc\vncviewer.exe"
REM  set toRun=%toRun% /Description="start WinVNC Remote Viewer Client"
REM  set toRun=%toRun% /DisplayMode="Min"
REM  if not exist "%LinkDest_DPNE%" goto :next
REM  %toRun%
 rem Cleanup
 call :DelIfExist "%StartMenu_90-Tools_DP%\14-WinVNC Client viewer (remote contol).lnk"
rem 03.01.2013 J.Fes removed
 call :DelIfExist "%StartMenu_90-Tools_DP%\15-WinVNC Client viewer (remote contol).lnk"

:Next
 rem Cleanup
 call :DelIfExist "%StartMenu_90-Tools_DP%\15-RemoteSupport mit J.Feuerstein Via TeamViewer.lnk"
 call :DelIfExist "%StartMenu_90-Tools_DP%\16-RemoteSupport mit J.Feuerstein Via TeamViewer.lnk"

 rem -- 03-BinPublic\RemoteSupport mit JFeuerstein Via TeamViewer Link Create --
 rem 27.08.2012 18:29 / J.Fes / angepasst auf aktuelle Version
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\addPLM_RemoteSupport_via_TeamViewer.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\16-Remote Support Via TeamViewer.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic"
 set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.ico"
 set toRun=%toRun% /Description="TeamViewer Remote Support"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem new 19.04.2011 14:37
 rem -- 03-BinPublic\PdfReader\FoxitReader.exe Pdf Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\PdfReader\Foxit Reader.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\17-PdfReader Start.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\PdfReader"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\PdfReader\pdf.ico"
 set toRun=%toRun% /Arguments=
 set toRun=%toRun% /Description="PDF Reader start"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem new 03.11.2011 13:35
 rem -- 03-BinPublic\JFProcessTimeLogger.exe Performance TimeLogger Messungen Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\JFProcessTimeLogger.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\18-JFProcessTimeLogger.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\PdfReader"
REM  set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\PdfReader\pdf.ico"
 set toRun=%toRun% /Arguments=
 set toRun=%toRun% /Description="Tool to Log Process CPU Times and Memory Times"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


:Next
 rem -- 03-BinPublic\Sysinternals\Procmon.exe Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\PdmSystemMemConsume\PdmSystemMemConsumeGet.cmd
REM  Echo debug## %LinkDest_DPNE%
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\20-PdmSystemMemConsumeGet.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 rem set toRun=%toRun% /WorkDir=
 rem set toRun=%toRun% /Arguments=
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\PdmSystemMemConsume\PdmSystemMemConsumeGet.ico"
 set toRun=%toRun% /Description="GetPdmMem (%LinkDest_DPNE%)"
 call :DelIfExist "%StartMenu_90-Tools_DP%\20-PdmSystemMemConsumeGet.lnk"
REM  %toRun%
 if not exist "%LinkDest_DPNE%" goto :next


:Next
 rem -- 03-BinPublic\TempDel.cmd Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\TempDel.cmd
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\91-TempDir CleanUp Menu.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic"
 set toRun=%toRun% /Arguments=
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\TempDel_cmd.Ico"
 set toRun=%toRun% /Description="Menu to delete files in %temp% directory"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- 03-BinPublic\TempDel.cmd Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\Treesize.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\92-Directory Treesize.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic"
 set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\TempDel_cmd.Ico"
 set toRun=%toRun% /Description="Software to view directory treesize"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


:Next
  rem new 19.04.2011 14:37
 rem -- 03-BinPublic\PlmJobmanagerCleanUpDirs.cmd Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\PlmJobmanagerCleanUpDirs.cmd
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\92-PlmJobmanagerCleanUpDirs CleanUp Menu.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic"
 set toRun=%toRun% /Arguments=
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\TempDel_cmd.Ico"
 set toRun=%toRun% /Description="Menu to delete files in %temp% directory"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


:Next
 rem -- 03-BinPublic\Sysinternals\Filemon.exe Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\Sysinternals\Filemon.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\95-Sysinternals Filemon.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\Sysinternals"
 set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\TempDel_cmd.Ico"
 set toRun=%toRun% /Description="Sysinternals Filemon"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- 03-BinPublic\Sysinternals\procexp.exe Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\Sysinternals\procexp.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\96-Sysinternals ProcessExplorer.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\Sysinternals"
 set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\TempDel_cmd.Ico"
 set toRun=%toRun% /Description="Sysinternals ProcessExplorer"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- 03-BinPublic\Sysinternals\autoruns.exe Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\Sysinternals\autoruns.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\97-Sysinternals AutoRuns.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\Sysinternals"
 set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\TempDel_cmd.Ico"
 set toRun=%toRun% /Description="Sysinternals AutoRuns"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- 03-BinPublic\Sysinternals\Tcpview.exe Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\Sysinternals\Tcpview.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\98-Sysinternals Tcpview.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\Sysinternals"
 set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\TempDel_cmd.Ico"
 set toRun=%toRun% /Description="Sysinternals Tcpview"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem -- 03-BinPublic\Sysinternals\Procmon.exe Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\Sysinternals\Procmon.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\99-Sysinternals ProcMon.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\Sysinternals"
 set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\TempDel_cmd.Ico"
 set toRun=%toRun% /Description="Sysinternals Procmon"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%




rem ################ Install ###################################################
:Next
 rem --   dotnetfx.exe
 rem 13.08.2013/J.Fes entnommen call delIfExist "%StartMenu_01-Install_DP%\20 Install MS.Net2.0 runtime (only required on Computers running JobServer).lnk"
 goto :Next
 Echo - Create Link's: 99-Install
 set LinkDest_DPNE=%MyAppl_Root_DP%\99-Install\Components\dotnetfx.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_01-Install_DP%\20 Install MS.Net2.0 runtime (only required on Computers running JobServer).lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%ComponentsDir_DP%"
 rem set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%IconsDir_DP%\setup.ico"
 set toRun=%toRun% /Description="Installation of Microsoft .net runtime library"
 if not exist "%LinkDest_DPNE%" goto :next
REM  %toRun%


:Next
 rem -- OracleXEClient
 set LinkDest_DPNE=%MyAppl_Root_DP%\99-Install\Components\OracleXEClient.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_01-Install_DP%\21 Install OracleXE Client (Optional required for Oracle Db access).lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%ComponentsDir_DP%"
 rem set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%IconsDir_DP%\setup.ico"
 set toRun=%toRun% /Description="Installation of OracleXE Client package"
 if not exist "%LinkDest_DPNE%" goto :next
REM  %toRun%


:Next
 rem Cleanup ConText Install Link 03.08.2009 22:53 J.Fes
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\PSPad editor\PSPadShell_reg.bat
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_01-Install_DP%\99 Register PSPad Text Editor (Optional).lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%ComponentsDir_DP%"
 rem set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%IconsDir_DP%\setup.ico"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\PSPad editor\PSPad.exe"
 rem set toRun=%toRun% /Description=""
REM  if not exist "%LinkDest_DPNE%" goto :next
REM  %toRun%
 rem 22.05.2012 20:14 entnommen
 Call :DelIfExist "%StartMenu_01-Install_DP%\99 Register PSPad Text Editor (Optional).lnk"

:Next
rem copiert das RemoteContol Script in das 03-BinPublic.Custom Verzeichniss
rem Deaktiviert!
REM  set RemoteControlSoftwareStart-customer-template_DPNE=%MyAppl_Root_DP%\03-BinPublic\RemoteControlSoftwareStart-customer-template.cmd
REM  set RemoteControlSoftwareStart-customer_DPNE=%MyAppl_Root_DP%\03-BinPublic.Custom\_for_use_edit_me_and_rename_me_to_RemoteControlSoftwareStart-customer.cmd
REM  if not exist "%RemoteControlSoftwareStart-customer-template_DPNE%" goto :Next
REM  copy "%RemoteControlSoftwareStart-customer-template_DPNE%" "%RemoteControlSoftwareStart-customer_DPNE%">nul


 Call :JobManagerCreateStartLinks 91-TestSystem TestSystem %JobPlanerLinkDoCreate%
 Call :JobManagerCreateStartLinks 92-ProdSystem ProdSystem %JobPlanerLinkDoCreate%
 rem Example: Create JobMgr Start Links in Start Menu Root Dir
 rem Call :JobManagerCreateStartLinks . ProdSystem True
 goto :StartMenuCreateDone

rem ################ StartLinks ################################################
:JobManagerCreateStartLinks
 rem Create's JobManager Programm Link's
setlocal

 rem P1=Teilpath des Link Root Dir's neu 07.07.2010 J.Fes
 set JobMgrProgsStartMenu_DP=%StartMenu_DP%\%1
 if "%1" equ "." set JobMgrProgsStartMenu_DP=%StartMenu_DP%
 rem P2=JobMgrSystem 07.07.2010 J.Fes
 set JobMgrSystem=%2
 rem übergabe ob der JobPlaner Link erzeugt werden soll
 set JobPlanerLinkDoCreate=%3
 Echo - Create Link's:%JobMgrSystem% for JobServer...JobClient...JobPlaner:(%JobPlanerLinkDoCreate%)..Setup
 if not exist "%JobMgrProgsStartMenu_DP%" md "%JobMgrProgsStartMenu_DP%"

:Next
 rem --- JobManager Start neu 07.07.2010
 set LinkDest_DPNE=%MyAppl_Root_DP%\01-BinServer\JobManagerStart.cmd
 set LinkFile_DPNE=%JobMgrProgsStartMenu_DP%\01-JobServer (%JobMgrSystem%).lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /Arguments="/Server /ServerSettingsXML %JobMgrSystem%"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\01-BinServer\JobServer.exe"
 set toRun=%toRun% /Description="JobServer %JobMgrSystem% (%MyAppl_Root_DP%\01-BinServer\JobServer.exe)"
 set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

:Next
 rem --- JobClient im AutoStart Mode neu 07.07.2010
 rem angepasst 07.07.2010 J.Fes
 set LinkDest_DPNE=%MyAppl_Root_DP%\02-BinClient\JobManagerStart.cmd
 set LinkFile_DPNE=%JobMgrProgsStartMenu_DP%\02-JobClient (%JobMgrSystem%).lnk
 rem Namen angepasst 26.10.2010 J.Fes
 call :DelIfExist "%JobMgrProgsStartMenu_DP%\02-JobClient (%JobMgrSystem%) [StartMode 1-AutoStartMode].lnk"
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /Arguments="/Client /ServerSettingsXML %JobMgrSystem% /JobClientStartMode Automatic"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.Starter.CUI.exe"
 set toRun=%toRun% /Description="JobClient %JobMgrSystem% (%MyAppl_Root_DP%\01-BinClient\JobClient.Starter.CUI.exe)"
 set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


:Next
 rem --- JobClient im Test Mode neu 07.07.2010
 set LinkDirSpecialMode_DP=%JobMgrProgsStartMenu_DP%
 if not exist "%LinkDirSpecialMode_DP%" md "%LinkDirSpecialMode_DP%"
 set LinkDest_DPNE=%MyAppl_Root_DP%\02-BinClient\JobManagerStart.cmd
 set LinkFile_DPNE=%JobMgrProgsStartMenu_DP%\03-JobClient (%JobMgrSystem%) Start in TestMode.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /Arguments="/Client /ServerSettingsXML %JobMgrSystem% /JobClientStartMode TestMode"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.Starter.CUI.exe"
 set toRun=%toRun% /Description="JobClient %JobMgrSystem% (%MyAppl_Root_DP%\01-BinClient\JobClient.Starter.CUI.exe)"
 set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :next
 rem - heraugenommen 26.10.2010 07:46 J.Fes
 %toRun%


:Next
 rem --- JobClient im Pause Mode neu 07.07.2010
 rem angepasst 07.07.2010 J.Fes
 rem set LinkDirSpecialMode_DP=%JobMgrProgsStartMenu_DP%\02-JobClient-StartSpecial
 set LinkDirSpecialMode_DP=%JobMgrProgsStartMenu_DP%
 if not exist "%LinkDirSpecialMode_DP%" md "%LinkDirSpecialMode_DP%"
 set LinkDest_DPNE=%MyAppl_Root_DP%\02-BinClient\JobManagerStart.cmd
 set LinkFile_DPNE=%LinkDirSpecialMode_DP%\02-JobClient (%JobMgrSystem%) [StartMode 3-PauseMode].lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /Arguments="/Client /ServerSettingsXML %JobMgrSystem% /JobClientStartMode Pause"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.Starter.CUI.exe"
 set toRun=%toRun% /Description="JobClient %JobMgrSystem% (%MyAppl_Root_DP%\01-BinClient\JobClient.Starter.CUI.exe)"
 set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :next
 rem - heraugenommen 26.10.2010 07:46 J.Fes
 rem %toRun%
 call :DelIfExist "%LinkFile_DPNE%"



:Next
 rem --- JobPlaner Start neu 07.07.2010
 if /I "%JobPlanerLinkDoCreate%" neq "YES" goto :Next

 set LinkDest_DPNE=%MyAppl_Root_DP%\01-BinServer\JobManagerStart.cmd
 set LinkFile_DPNE=%JobMgrProgsStartMenu_DP%\05-JobPlaner (%JobMgrSystem%).lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\01-BinServer"
 set toRun=%toRun% /Arguments="/JobPlaner /ServerSettingsXML %JobMgrSystem%"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\01-BinServer\JobManager.OnDemand.exe"
 set toRun=%toRun% /Description="JobPlaner %JobMgrSystem% (%MyAppl_Root_DP%\01-BinServer\JobManager.OnDemand.exe)"
 set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :next
 rem JobPlaner Link nur erzeugen wenn erforderlich!
REM  Echo ##Debug: JobPlanerLinkDoCreate:%JobPlanerLinkDoCreate%
REM  Echo %toRun%
REM  pause

 call :DelIfExist "%JobMgrProgsStartMenu_DP%\03-JobPlaner (%JobMgrSystem%).lnk"
 call :DelIfExist "%JobMgrProgsStartMenu_DP%\04-JobPlaner (%JobMgrSystem%).lnk"
 %toRun%

:Next
 rem --- JobManager SETUP neu 07.07.2010
 set LinkDest_DPNE=%MyAppl_Root_DP%\01-BinServer\JobManagerStart.cmd
 set LinkFile_DPNE=%JobMgrProgsStartMenu_DP%\90-JobServer (%JobMgrSystem%) Setup.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /Arguments="/Server /Setup /ServerSettingsXML %JobMgrSystem%"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\01-BinServer\JobServer.exe"
 set toRun=%toRun% /Description="JobServer %JobMgrSystem% (%MyAppl_Root_DP%\01-BinServer\JobServer.exe)"
 set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :next
REM  call :DelIfExist "%JobMgrProgsStartMenu_DP%\90-Setup (%JobMgrSystem%).lnk"
 if "%JobMgrSystem%" equ "TestSystem" (
   copy  "%LinkFile_DPNE%" "%StartMenu_01-Install_DP%\21 JobServer (%JobMgrSystem%) Setup.lnk"
 ) else (
   copy  "%LinkFile_DPNE%" "%StartMenu_01-Install_DP%\22 JobServer (%JobMgrSystem%) Setup.lnk"
 )

 %toRun%

:next
endlocal
goto :eof


:StartMenuCreateDone
 if /I "%Quiet%"=="true"  goto :eof
 Echo.
 Echo --------------------------------------------------------------------------
 Echo Result created startmenu:
 Echo  "%StartMenu_DP%"
 Echo.
 Echo Info:
 Echo Explorer will start with the created startmenu
 Pause
 start "" explorer.exe /e,%StartMenu_DP%

 goto :eof


rem Doku:
 jfShellLinkCreate /LinkFile="c:\path\to\linkfile.lnk"
                  /LinkDest="c:\path\to\destfile.ext"
                 [/Arguments="/Option1 /Option2"]
                 [/WorkDir="c:\path\to\"]
                 [/IconFile="c:\path\to\iconfile.ext"]
                 [/DisplayMode="Normal|Max|Min"]
                 [/Description="Kommentar"]
                 [/Quiet] (keine Konsolenausgaben)


:ErrExit
 call :Echo --------------------------------------------------------------------------
 call :Echo Error up in:
 call :Echo %0
 call :Echo please check your Logfile
 call :Echo %Log_DPNE%
 Pause
 goto :eof


rem ##### ------------ Standard Subroutines --------------------- ######
:PathCutLastDir
 rem schneidet das letzte Verzeichniss Uebergeben path ab
 rem P1 = Name der Variablen
 rem P2 = der Übergebene Path
 rem Example : call :PathCutLastDir EntwRoot_LP %~dp0
 rem Example : call :PathCutLastDir MyVar %~dp0

 set PathCutLastDir$temp=%2
 set PathCutLastDir$tempLastChar=%PathCutLastDir$temp:~-1%
 set PathCutLastDir$tempNoBacks=%PathCutLastDir$temp:~0,-1%

 if "%PathCutLastDir$tempLastChar%"=="\" (
   rem "\" abschneiden wenn vorhanden
   call :PathCutLastDirDo PathCutLastDir$tempRes %PathCutLastDir$tempNoBacks%
 ) else (
   rem
   call :PathCutLastDirDo PathCutLastDir$tempRes %PathCutLastDir$temp%
 )
 set PathCutLastDir$tempRes=%PathCutLastDir$tempRes:~0,-1%
 set %1=%PathCutLastDir$tempRes%
 set PathCutLastDir$temp=
 set PathCutLastDirDo$temp1=
 set PathCutLastDir$tempNoBacks=
 set PathCutLastDir$tempNoLastChar=
 set PathCutLastDir$tempLastChar=
 set PathCutLastDir$tempRes=
 goto :eof

:PathCutLastDirDo
 rem hiermit schneiden wir den Path ab
 rem echo.
 rem Echo P1=%1 P2=%2
 set PathCutLastDirDo$temp=%~dp2
 rem "\" abschneiden
 set PathCutLastDirDo$temp1=%PathCutLastDir$temp:~0,-1%
 set %1=%PathCutLastDirDo$temp%
 set PathCutLastDirDo$temp=
 set PathCutLastDirDo$temp1=
 goto :eof

rem ============================================================================
:DelIfExist
 if not exist "%~1" goto :DelIfExistEnd
 Echo -----^> CleanUp File: ["%~1"]
 del "%~1"
 goto :DelIfExistEnd
:DelIfExistEnd
 goto :eof

:DelDirIfExist
 if not exist "%~1" goto :DelDirEnd
 Echo -----^> CleanUp Dir.: ["%~1"]
 rd /s /q "%~1"
 goto :DelDirEnd
:DelDirEnd
 goto :eof


rem ============================================================================
:DateTimeNowGet
 rem call :DateTimeNowGet
 rem Set File_LPNE=%DatRoot_LP%\MyName-%DateTimeNowFileExt%.txt


 if     "%time:~0,1%"==" " set time-h=0%time:~1,1%
 if not "%time:~0,1%"==" " set time-h=%time:~0,2%

 if     "%time:~3,1%"==" " set time-m=0%time:~4,1%
 if not "%time:~3,1%"==" " set time-m=%time:~3,2%

 set Date-Y=%Date:~6,4%
 set Date-M=%Date:~3,2%
 set Date-D=%Date:~0,2%
 set DateTimeNowFileExt=%Date-Y%-%Date-M%-%Date-D%-%time-h%-%time-m%
 goto :eof


:Ende
