@Echo off
 rem -----------------------------------------------------------------------------------------
 rem erstellt das PLMJobManager Application Toolbar mit allen erforderlichen verkuepfungen
 rem #New: 04.04.2007  J.Fes
 rem #LUp: 18.10.2019  J.Fes Update Internet Links

 rem Optionsparameter:
 rem P1 Quiet Modus

 cls

 set Quiet=false
 if /I "%1"=="/Quiet" set Quiet=true

 call :ColorSet IsIdel

 rem Root Variablen
 set MyApplProd_N=PLMJobManagerV3

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

 rem Server Dirs ermitteln
 call :PathCutLastDir MyAppl_Root_DP %~dp0

 rem #22.02.2016/J.Fes parse Parse MyApplBase_TP from MyAppl_Root_DP
 call :PathRootDirTP MyApplBase_TP "%MyAppl_Root_DP%"

 rem #New:01.05.2018/J.Fes define to create links for
 set JobMgrLinksCreate=DefaultSystem
 If /I "%MyAppl_Root_DP:~-2%" equ "_T" set JobMgrLinksCreate=TestSystem
 If /I "%MyAppl_Root_DP:~-2%" equ "_P" set JobMgrLinksCreate=ProdSystem


 set BinServer_DP=%MyAppl_Root_DP%\01-BinServer
 set BinPublicClientServer=%MyAppl_Root_DP%\03-BinPublic.ClientServer
 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 InstallComponents_DP=%MyAppl_Root_DP%\99-Install\Components
 rem #New:02.05.2017/J.Fes
 set InstallTemplates_DP=%MyAppl_Root_DP%\99-Install\Templates
 set InstallInternetLinks_DP=%MyAppl_Root_DP%\99-Install\Internet-Links
 set DocApplInternetLinks_DP=%MyAppl_Root_DP%\10-Documentation.Application\99-Internet-Links

 rem #New:02.05.2017/J.Fes
 set DocCustom_DP=%MyAppl_Root_DP%\11-Documentation.Custom
 if not exist "%DocCustom_DP%" md "%DocCustom_DP%"
 set DocCustom_01-Admin_DP=%DocCustom_DP%\01-Admin
 if not exist "%DocCustom_01-Admin_DP%" md "%DocCustom_01-Admin_DP%"


 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

 rem
 set StartMenu_DP=%MyAppl_Root_DP%\_%MyApplBase_TP%

 set MyTitle=Create Update %MyApplProd_N% Toolbar
 set MyScriptVersion=01.11.2016/J.Fes #LUp:Add Password Org via KeePassMobil
 set MyScriptVersion=02.05.2017/J.Fes #LUp:Org .\11-Documentation.Custom\01-Admin
 set MyScriptVersion=09.08.2017/J.Fes #LUp:Org view: StartMenu_DP
 set MyScriptVersion=08.02.2018/J.Fes #LUp:Org .\11-Documentation.Custom
 set MyScriptVersion=01.05.2018/J.Fes #LUp:Org Remove 95-Sysinternals Filemon add FreeFileSync optimice
 set MyScriptVersion=13.11.2018/J.Fes #LUp:Org JobClient.Starter.CUI.exe replaced by JobClient.exe

 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
 rem added 29.08.2019 S.Gueth
 set StartMenu_81-InternetLinks=%StartMenu_DP%\81-InternetLinks
 set StartMenu_90-Tools_DP=%StartMenu_DP%\90-Tools
 rem 05.07.2014
 set StartMenu_95-ToolsCustom_DP=%StartMenu_DP%\95-ToolsCustom


:Menu
 rem define default Action
 set Action=S
 Echo.
 Echo --------------------------------------------------------------------------------
 Echo Info............................: %MyTitle%
 Echo Version.........................: %MyScriptVersion%
 Echo JobMgr Root.....................: %MyAppl_Root_DP%
 Echo Start Menu Root.................: %StartMenu_DP%
 Echo Create JobMgr Links for.........: %JobMgrLinksCreate%
 Title %MyTitle%
 Echo.
 if /i "%Quiet%" equ "true" goto :AskAction_JumbOver

 Echo  S  = create PLMJobManager Toolbar default
 Echo  J  = create PLMJobManager Toolbar with JobPlaner
 Echo.
 Echo  Q  = Quit action (do nothing)
 Echo.
 set /P Action="select Action (Default=S) "
 Echo.

 Call :ColorSet IsExecuting

:AskAction_JumbOver
 if /I "%Action%" equ "J" (
   set JobPlanerLinkDoCreate=Yes
   goto :StartCreateToolbar
 )

 if /I "%Action%" equ "S" (
   set JobPlanerLinkDoCreate=No
   goto :StartCreateToolbar
 )

 if /I "%Action%" equ "Q" (
   Echo --------------------------------------------------------------------------------
   Echo Quit select
   Echo  nothing will be done / changed
   Echo --------------------------------------------------------------------------------
   Pause
   exit /b
 )

goto :Menu

:StartCreateToolbar
 call :ColorSet Standard
 Echo --------------------------------------------------------------------------------
 Echo Start...........................: Create JobManager Toolbar
 Echo Version.........................: %MyScriptVersion%
 Echo --------------------------------------------------------------------------------
 Echo.


 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_81-InternetLinks%"  md "%StartMenu_81-InternetLinks%"

 if not exist "%StartMenu_90-Tools_DP%"       md "%StartMenu_90-Tools_DP%"
 if not exist "%StartMenu_95-ToolsCustom_DP%" md "%StartMenu_95-ToolsCustom_DP%"

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=%DocCustom_DP%
 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 remove LNK
 CALL :DelIfExist "%StartMenu_DP%\90-PLMJobManagerV3_ProjectDoc_Customer.lnk"
 CALL :ArchivIfExist  "%MyAppl_Root_DP%\11-Documentation.Custom\90-PLMJobManager_ProjectDoc_Customer.pptx"  "%MyAppl_Root_DP%\11-Documentation.Custom\zzArchiv"  "90-PLMJobManagerV3_ProjectDoc_Customer_Archiv.pptx"

:Next
 set PLMJobManager_Setup_Customer_DPNE=%DocCustom_01-Admin_DP%\91-PLMJobManager_Setup_Customer.pptx
 set PLMJobManager_Setup_template_DPNE=%InstallTemplates_DP%\91-PLMJobManager_Setup_Customer.pptx
 rem #Doc: 02.05.2017/J.Fes move existing
 if not exist "%PLMJobManager_Setup_Customer_DPNE%" if exist "%PLMJobManager_Setup_template_DPNE%" (
  Echo Create PLMJobManager Setup Custom: %PLMJobManager_Setup_Customer_DPNE%
  copy "%PLMJobManager_Setup_template_DPNE%" "%PLMJobManager_Setup_Customer_DPNE%"
 )

:test-2018-01-31
 :Next
 rem #New 25.01.2018/J.Fes Org Prj
 set PLMJobManager_ProjectDocumentsTemplate_DP=%InstallTemplates_DP%\zz-ProjectDocumentsTemplate
 set PLMJobManager_ProjectDocumentsTemplate_Customer_DP=%DocCustom_DP%\zz-DocumentsTemplateBeforUsePleaseCopy
 if not exist "%PLMJobManager_ProjectDocumentsTemplate_DP%" goto :Next
 Echo Copy PLMJobManager Project Documents Templates into customer
 Echo from DocTemplates...............: %PLMJobManager_ProjectDocumentsTemplate_Customer_DP%
 Echo to DocCustom....................: %PLMJobManager_ProjectDocumentsTemplate_DP%
 robocopy "%PLMJobManager_ProjectDocumentsTemplate_DP%"  "%PLMJobManager_ProjectDocumentsTemplate_Customer_DP%" /xf *.tmp ~*.* *.bak /NP /TBD /TEE /R:4 /W:1 /MIR >nul

REM :Next
REM  rem -- link auf 92-PLMJobManagerV3_PLMDataCheck_Customer.pptx oder .ppt
REM  REM #Change 05.07.2014 13:30/J.Fes .pptx or .ppt
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\11-Documentation.Custom\92-PLMJobManagerV3_PLMDataCheck_Customer.pptx
REM  if not exist "%LinkDest_DPNE%" set LinkDest_DPNE=%MyAppl_Root_DP%\11-Documentation.Custom\92-PLMJobManagerV3_PLMDataCheck_Customer.pptx
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%StartMenu_DP%\92-PLMJobManagerV3_PLMDataCheck_Customer.lnk"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /WorkDir="%InstallComponents_DP%"
REM  if not exist "%LinkDest_DPNE%" goto :Next
REM  %toRun%

REM :Next
REM  rem -- link auf 92-PLMJobManagerV3_PLMDataCheck_Customer.pptx oder .ppt
REM  REM #New 26.08.2015 11:24/J.Fes
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\11-Documentation.Custom\93-PLMJobManagerV3_ProjectReport_Customer.pptx
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%StartMenu_DP%\93-PLMJobManagerV3_ProjectReport_Customer.lnk"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /WorkDir="%InstallComponents_DP%"
REM  if not exist "%LinkDest_DPNE%" goto :Next
REM  %toRun%

REM :Next
REM  rem -- link auf 95-PLMJobManagerV3_ToDoListe_Customer.xls
REM  REM #Change 05.07.2014 13:30/J.Fes .xlsx or .xls
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\11-Documentation.Custom\95-PLMJobManagerV3_ToDoListe_Customer.xlsx
REM  if not exist "%LinkDest_DPNE%" set LinkDest_DPNE=%MyAppl_Root_DP%\11-Documentation.Custom\95-PLMJobManagerV3_ToDoListe_Customer.xls
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%StartMenu_DP%\95-PLMJobManagerV3_ToDoListe_Customer.lnk"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /WorkDir="%InstallComponents_DP%"
REM  if not exist "%LinkDest_DPNE%" goto :Next
REM  %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
REM :Next
REM  rem -- Siemens-PLMJobManager_NXRefile-Customer-Guide_V11
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\Siemens-PLMJobManager_NXRefile-Customer-Guide_V11.pdf
REM  set LinkFile_DPNE=%StartMenu_00-Doku_DP%\90 Siemens PLMJobManager NXRefile Customer Guide.lnk
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  if not exist "%LinkDest_DPNE%" goto :Next
REM  %toRun%
REM
REM
REM :Next
REM  rem -- PLMJobManager_NXRefile_ProduktPraesentation_Siemens_PLM_DE
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\PLMJobManager_NXRefile_ProduktPraesentation_Siemens_PLM_DE.pdf
REM  set LinkFile_DPNE=%StartMenu_00-Doku_DP%\91 JobManagerV3 Praesentation Deutsch.lnk
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  if not exist "%LinkDest_DPNE%" goto :Next
REM  %toRun%
REM
REM :Next
REM  rem -- PLMJobManager_NXRefile_ProduktPraesentation_Siemens_PLM_ENG
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\PLMJobManager_NXRefile_ProduktPraesentation_Siemens_PLM_ENG.pdf
REM  set LinkFile_DPNE=%StartMenu_00-Doku_DP%\92 JobManagerV3 Praesentation English.lnk
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  if not exist "%LinkDest_DPNE%" goto :Next
REM  %toRun%

rem ################ DOKU Links ##################
:00-DOCU-LINKS-CREATE-START
:Next
 if not exist "%InstallInternetLinks_DP%" goto :Next
 rem
rem removed 29.08.2019 S.Gueth
REM  if not exist "%DocApplInternetLinks_DP%" (
REM    md "%DocApplInternetLinks_DP%"
REM   ) else (
REM    del /Q "%DocApplInternetLinks_DP%\*.*"  >nul 2>nul
REM   )
REM  copy "%InstallInternetLinks_DP%\*.*" "%DocApplInternetLinks_DP%\*.*" >nul 2>nul


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=%BinPublicClientServer%\JobManager_WhatsNew.txt
 set LinkFile_DPNE=%StartMenu_01-Install_DP%\10 -------- (JobManagerV3 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\JobManagerV3_Docu_Install_Overview_JFES_FG.pdf
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManagerV3_Docu_Install_Overview_JFES.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\11 JobManagerV3 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 -- JobManagerV3 Docu Install
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManagerV3_Docu_Install_PLMJobManager_DE.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\12 JobManagerV3 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 JobManagerV3 Docu Install SQLServer
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManagerV3_Docu_Install_SQLServer_DE.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\13 JobManagerV3 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\JobManagerV3_Docu_Setup_DE.pdf

 set LinkFile_DPNE=%StartMenu_01-Install_DP%\14 JobManagerV3 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.cmd
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\15 JobManagerV3 Version Info.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\Application-VersionInfo.ico"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%

:Next
 rem -- User Dokumentation
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManagerV3_Docu_DE.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\16 JobManagerV3 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\JobManagerV3_Docu_DE.lnk"
 if exist "%LinkFile_DPNE%" copy "%LinkFile_DPNE%" "%MyAppl_Root_DP%\10-Documentation.Application\JobManagerV3 User Documentation.lnk">nul
REM  if exist "%LinkFile_DPNE%" copy "%LinkFile_DPNE%" "%StartMenu_DP%\90-PLMJobManagerV3_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=%BinPublicClientServer%\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 05.10.2016 S.Gueth
 rem --- JobMgr DataQuality CBSettings Start
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic.ClientServer\JobManagerCmdTools_DataQuality\JobManagerStart.cmd
 set LinkFile_DPNE=%StartMenu_01-Install_DP%\25 DataQuality (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_DataQuality"
 set toRun=%toRun% /Arguments="/JobMgrCmdTools_DQSettingsMgr"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic.ClientServer\JobManagerCmdTools_DataQuality\JobMgrCmdTools_DQSettingsMgr.exe"
 set toRun=%toRun% /Description="JobMgr TC DataQuality Settings %JobMgrSystem% (%MyAppl_Root_DP%\03-BinPublic.ClientServer\JobManagerCmdTools_DataQuality\JobMgrCmdTools_DQSettingsMgr.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=%BinPublicClientServer%\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%

 rem #New: 28.03.2017 10:25
 set LinkDest_DPNE=%MyAppl_Root_DP%\99-Install\SQLCmd_Setup\SQLCmd_Setup_PleaseRunAsAdmin.cmd
 set LinkFile_DPNE=%StartMenu_01-Install_DP%\26 SQLCMD Setup PleaseRunAsAdmin.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /Description="Setup- Install SQLCMD tool"
REM  set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\99-Install\SQLCmd_Setup\SQLCmd_Setup_PleaseRunAsAdmin.ico"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\99-Install\Icons\setup.ico"
 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%\99-Install\Icons\Application-Startmenu-Create-or-Update.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\JobManagerV3 WhatsNew.lnk"
 rem -- WhatsNew Dokumentation  Link in JobManagerV3\10-Documentation.Application legen
 set LinkDest_DPNE=%BinPublicClientServer%\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 ..\_JobManagerV3\10-Documentation.Application ein Ordner link ist!!
 set LinkFile_DPNE=%StartMenu_02-WhatsNew_DP%\01 JobManagerV3 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  rem New 17.07.2014 11:08
REM  set LinkDest_DPNE=http://download.plmjobmanager.com/JobManagerV3/V3-0001-LatestVersion/00-JobManagerV3_WhatsNew.txt
REM  set LinkFile_DPNE=%StartMenu_02-WhatsNew_DP%\10 JobManagerV3 WhatsNew - from Web.txt.lnk
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
REM  %toRun%

 rem set LinkDest_DPNE=%InstallInternetLinks_DP%\11 JobManagerV3 WhatsNew - from Web.txt.url
 set LinkDest_DPNE=%InstallInternetLinks_DP%\1*.url
 if exist "%LinkDest_DPNE%" (
    del "%StartMenu_02-WhatsNew_DP%\*.url" >nul
    copy "%LinkDest_DPNE%" "%StartMenu_02-WhatsNew_DP%\*.*" >nul 2>nul
 )

: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 ..\_JobManagerV3\10-Documentation.Application ein Ordner link ist!!
 rem Update 15.03.2017 / S.Gueth, changed whats new .xls file to .xlsx file
 call :DelIfExist "%StartMenu_02-WhatsNew_DP%\02 JobManagerV3 WhatsNew.xls.lnk"
 call :DelIfExist "%MyAppl_Root_DP%\10-Documentation.Application\JobManagerV3 WhatsNew.xlsx.lnk"
 set LinkFile_DPNE=%StartMenu_02-WhatsNew_DP%\02 JobManagerV3 WhatsNew.xlsx.lnk
 set LinkDest_DPNE=%BinServer_DP%\Resources\Documents\JobManager_WhatsNew.xlsx
 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\JobManagerV3 WhatsNew.pdf.lnk"
 set LinkFile_DPNE=%StartMenu_02-WhatsNew_DP%\03 JobManagerV3 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 #New: 18.07.2019/J.Fes JobManagerCmdTools_Help.txt
 set LinkDest_DPNE=%BinPublicClientServer%\JobManagerCmdTools_Help.txt
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_02-WhatsNew_DP%\12 JobManagerCmdTools_Help.txt.lnk"
 set toRun=%toRun% /LinkDest=%LinkDest_DPNE%
 set toRun=%toRun% /WorkDir="%BinPublicClientServer%"
 rem set toRun=%toRun% /Arguments=
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\99-Install\Icons\ClientSetup_DefaultOptions.ico"
 set toRun=%toRun% /Description="Open JobManagerCmdTools_Help.txt"
 set toRun=%toRun% /DisplayMode="Normal"
 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 -- #New: 07.11.2019/J.Fes Link to 02-BinClient.Custom.Custom folder
 set LinkDest_DPNE=%MyAppl_Root_DP%\02-BinClient.Custom
 if not exist "%LinkDest_DPNE%" md "%LinkDest_DPNE%"
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_80-OpenFolder_DP%\02-BinClient.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
 rem -- Link to 91-DATA.TempTransfer folder
 rem -- #New: 05.07.2014
 set LinkDest_DPNE=%MyAppl_Root_DP%\91-DATA.TempTransfer
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_80-OpenFolder_DP%\91-DATA.TempTransfer.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 91-DATA.TempTransfer folder [%LinkDest_DPNE%]"
 if not exist "%LinkDest_DPNE%" md "%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%

:Next
 rem -- Link to 92-Update folder
 rem -- #New: 05.07.2014
 set LinkDest_DPNE=%MyAppl_Root_DP%\92-Update
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_80-OpenFolder_DP%\92-Update (Dir to Manage JobMgr Updates).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 92-Update folder"
 if not exist "%LinkDest_DPNE%" md "%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%


:Next
 rem -- #New: 14.06.2016 10:11
 set LinkDest_DPNE=%AppData%\Microsoft\Internet Explorer\Quick Launch
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_80-OpenFolder_DP%\95-Windows Quick Launch.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%LinkDest_DPNE%"
 set toRun=%toRun% /Description="open's Users Quick Launch folder"
 if not exist "%LinkDest_DPNE%" md "%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%

:Next
 rem -- #New: 14.06.2016
 set LinkDest_DPNE=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_80-OpenFolder_DP%\96-Windows Autostart - Startup.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%LinkDest_DPNE%"
 set toRun=%toRun% /Description="open's Users Autostart - StartUp folder"
 if not exist "%LinkDest_DPNE%" md "%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%

:Next
 rem -- #New: 14.06.2016
 set LinkDest_DPNE=%APPDATA%\Microsoft\Windows\Start Menu\Programs
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_80-OpenFolder_DP%\97-Windows Start Menu (User).lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%LinkDest_DPNE%"
 set toRun=%toRun% /Description="open's Users Start Menu folder"
 if not exist "%LinkDest_DPNE%" md "%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%

:Next
 rem -- #New: 14.06.2016
 set LinkDest_DPNE=%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_80-OpenFolder_DP%\98-Windows Start Menu (All Users).lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%LinkDest_DPNE%"
 set toRun=%toRun% /Description="open's Users Start Menu folder"
 if not exist "%LinkDest_DPNE%" md "%LinkDest_DPNE%"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%



rem ----------------------------------------------------------------------------

: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 New: 29.08.2019 S.Gueth    
:Next   
rem ############## 81-InternetLinks #####################

 rem #New:18.10.2019/J.Fes cleaup old links
 call :CleanDirIfExist "%StartMenu_81-InternetLinks%"

 rem -- 81-InternetLinks Dokumentation
 Echo - Create Link's.................: 81-InternetLinks


 set LinkDest_URL=http://download.plmjobmanager.com/JobManagerV3/V3-0001-LatestVersion/00-JobManagerV3_WhatsNew.txt
 set LinkFile_DPNE=%StartMenu_81-InternetLinks%\11 JobManagerV3 WhatsNew.txt - [from Web].url
 call :LinkCreate_URL "%LinkFile_DPNE%" "%LinkDest_URL%"

:Next
 set LinkDest_DPNE=%InstallTemplates_DP%\94-PLMJobManager_CreateNewIssueMailTemplate.oft
 set LinkFile_DPNE=%StartMenu_81-InternetLinks%\12 PLMJobManager CreateNewIssue MailTemplate.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  set LinkDest_DPNE=C:\Windows\System32\cmd.exe
 set LinkDest_DPNE=%ComSpec%
 set LinkFile_DPNE=%StartMenu_81-InternetLinks%\20 - - - - - - - - - - - - - - - - - - - -.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
 set LinkDest_URL=http://www.addplm.com/
 set LinkFile_DPNE=%StartMenu_81-InternetLinks%\21 PLMJobManager Homepage at addPLM.url
 call :LinkCreate_URL "%LinkFile_DPNE%" "%LinkDest_URL%" 
 
:Next
 set LinkDest_URL=http://download.plmjobmanager.com/JobManagerV3/V3-0001-LatestVersion/
 set LinkFile_DPNE=%StartMenu_81-InternetLinks%\22 PLMJobManager Patch Download area - [LatestVersion].url
 call :LinkCreate_URL "%LinkFile_DPNE%" "%LinkDest_URL%" 
 
:Next
 set LinkDest_URL=http://download.plmjobmanager.com/JobManagerV3/V3-0003-TestVersion/
 set LinkFile_DPNE=%StartMenu_81-InternetLinks%\23 PLMJobManager Patch Download area - [TestVersion].url
 call :LinkCreate_URL "%LinkFile_DPNE%" "%LinkDest_URL%" 
 
:Next
 set LinkDest_URL=http://download.plmjobmanager.com/JobManagerV3/V3-0002-AppResources/90-DATA/CustomerNameShort_SettingsGlobal/10-JobScripts/
 set LinkFile_DPNE=%StartMenu_81-InternetLinks%\25 PLMJobManager Templates Download area - [10-JobScripts].url
 call :LinkCreate_URL "%LinkFile_DPNE%" "%LinkDest_URL%" 
 
:Next
 set LinkDest_DPNE=%ComSpec%
 set LinkFile_DPNE=%StartMenu_81-InternetLinks%\30 - - - - - - - - - - - - - - - - - - - -.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 rem set toRun=%toRun% /IconFile="%ComSpec%"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%
 
:Next
 REM 18.10.2019/J.Fes update Link
 set LinkDest_URL=http://support.ugs.com/global/de/
 set LinkDest_URL=https://www.plm.automation.siemens.com/en_us/support/gtac/
 set LinkFile_DPNE=%StartMenu_81-InternetLinks%\31 Siemens GTAG Produktsupport (.en).url
 call :LinkCreate_URL "%LinkFile_DPNE%" "%LinkDest_URL%" 
 
:Next
 REM 18.10.2019/J.Fes update Link
 set LinkDest_URL=http://support.ugs.com/global/de/
 set LinkDest_URL=https://www.plm.automation.siemens.com/de/support/gtac/
 set LinkFile_DPNE=%StartMenu_81-InternetLinks%\32 Siemens GTAG Produktsupport (.de).url
 call :LinkCreate_URL "%LinkFile_DPNE%" "%LinkDest_URL%"


:Next
REM  set LinkDest_URL=http://uganswer.ugs.com/
 set LinkDest_URL=https://solutions.industrysoftware.automation.siemens.com/
 set LinkFile_DPNE=%StartMenu_81-InternetLinks%\33 Siemens GTAG Solution Center (uganswer) (WebKey Login req.).url
 call :LinkCreate_URL "%LinkFile_DPNE%" "%LinkDest_URL%"

:Next
 set LinkDest_URL=https://www.plm.automation.siemens.com/global/en/support/docs.html
 set LinkFile_DPNE=%StartMenu_81-InternetLinks%\34 Siemens Documentation Center (.en).url
 call :LinkCreate_URL "%LinkFile_DPNE%" "%LinkDest_URL%"

:Next
 set LinkDest_URL=https://community.plm.automation.siemens.com/
 set LinkFile_DPNE=%StartMenu_81-InternetLinks%\35 Siemens Community (Find Answers).url
 call :LinkCreate_URL "%LinkFile_DPNE%" "%LinkDest_URL%"
 
REM :Next
REM  set LinkDest_URL=http://support.industrysoftware.automation.siemens.com/certification/Integrations_Matrix.xlsm
REM  set LinkFile_DPNE=%StartMenu_81-InternetLinks%\35 TC Integrations_Matrix (Excel File) From GTAG Site.url
REM  call :LinkCreate_URL "%LinkFile_DPNE%" "%LinkDest_URL%"



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

 rem alten link löschen!! 3.8.09
 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
REM  copy "%LinkFile_DPNE%" "%QuickLaunch_DP%\*.*" >nul
 rem #LUp:01.05.2018/J.Fes copy to StartMenu_DP
 copy "%LinkFile_DPNE%" "%StartMenu_DP%\*.*" >nul


:Next
 rem new in 11.03.2010 J.Fes
 rem update 05.09.2013 J.Fes
 rem -- ScreenShot Link Create --------------------------------
 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 copy Link in QuickLaunch
REM  copy "%LinkFile_DPNE%" "%QuickLaunch_DP%\*.*" >nul
 rem #LUp:01.05.2018/J.Fes copy to StartMenu_DP
 copy "%LinkFile_DPNE%" "%StartMenu_DP%\*.*" >nul

: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"
 set toRun=%toRun% /Description="7-Zip File Manager"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%

:Next
 REM #New: 25.11.2015/J.Fes
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\RDCMgr\RDCMan.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 if not exist "%LinkDest_DPNE%" goto :Next

 rem #Doc: 02.05.2017/J.Fes Prepare copy 93-JobManagerRemoteConnections.rdg template
 set JobManagerRemoteConnectionsV1_Custom_DPNE=%DocCustom_01-Admin_DP%\93-JobManagerRemoteConnections.rdg
 set JobManagerRemoteConnections_Custom_DPNE=%DocCustom_01-Admin_DP%\93-PLMJobManager_RemoteConnections_Customer.rdg
 set JobManagerRemoteConnections_template_DPNE=%InstallTemplates_DP%\93-PLMJobManager_RemoteConnections_Customer.rdg
 rem #Doc: 02.05.2017/J.Fes move existing
 if exist "%JobManagerRemoteConnectionsV1_Custom_DPNE%" (
  Echo move existing...................: 93-JobManagerRemoteConnections.rdg
  Echo from............................: %JobManagerRemoteConnectionsV1_Custom_DPNE%
  Echo to..............................: %JobManagerRemoteConnections_Custom_DPNE%
  move "%JobManagerRemoteConnectionsV1_Custom_DPNE%" "%JobManagerRemoteConnections_Custom_DPNE%"
 )
 if not exist "%JobManagerRemoteConnections_Custom_DPNE%" if exist "%JobManagerRemoteConnections_template_DPNE%" (
  Echo Copy Custom RDP template........: %JobManagerRemoteConnections_Custom_DPNE%
  copy "%JobManagerRemoteConnections_template_DPNE%" "%JobManagerRemoteConnections_Custom_DPNE%"
 )

 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\14-RDC (Remote Desktop Connection Manager).lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir=""
 set toRun=%toRun% /Description="Remote Desktop Connection Manager"
 if exist %JobManagerRemoteConnections_Custom_DPNE% (
   set toRun=%toRun% /Arguments=""%JobManagerRemoteConnections_Custom_DPNE%""
 )
 %toRun%

:Next
REM  rem -- 03-BinPublic\UltraVnc Link Create --------------------------------------
 rem Cleanup 03.01.2013 J.Fes removed
 call :DelIfExist "%StartMenu_90-Tools_DP%\13-WinVNC Server start (remote contol).lnk"
 call :DelIfExist "%StartMenu_90-Tools_DP%\14-WinVNC Server start (remote contol).lnk"

:Next
 rem Cleanup 03.01.2013 J.Fes removed
 call :DelIfExist "%StartMenu_90-Tools_DP%\14-WinVNC Client viewer (remote contol).lnk"
 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
 rem 21.01.2016 22:02 / J.Fes /TV11 is using the idch63gua5
 rem 25.05.2016 11:45 / J.Fes /TC11 with new addPLM_RemoteSupport_via_TeamViewer.exe no need to use -idch63gua5.exe anymore
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\addPLM_RemoteSupport_via_TeamViewer.exe
 if not exist "%LinkDest_DPNE%" set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\addPLM_RemoteSupport_via_TeamViewer-idch63gua5.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 01.05.2018/J.Fes
 rem -- 03-BinPublic\PdfReader\FoxitReader.exe Pdf Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\FreeFileSync_Portable\FreeFileSync.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\18-FreeFileSync.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\FreeFileSync_Portable"
 set toRun=%toRun% /Arguments=
 set toRun=%toRun% /Description="File sync with FreeFileSync"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%

:Next

:Next
 rem new 03.11.2011 13:35
 rem -- 03-BinPublic\JFProcessTimeLogger.exe Performance TimeLogger Messungen Create --
 rem 01.05.2018/J.Fes removed

REM  set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\JFProcessTimeLogger.exe
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\18-JFProcessTimeLogger.lnk"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /Arguments=
REM  set toRun=%toRun% /Description="Tool to log process CPU and Memory usage"
REM  if not exist "%LinkDest_DPNE%" goto :Next
REM  %toRun%
 CALL :DelIfExist "%StartMenu_90-Tools_DP%\18-JFProcessTimeLogger.lnk"


:Next
 rem 01.05.2018/J.Fes removed
 CALL :DelIfExist "%StartMenu_90-Tools_DP%\92-Directory Treesize.lnk"



:Next
 rem new 19.06.2014 12:30
 rem -- 03-BinPublic\JobManagerServiceTools_Start.cmd Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\99-Install\JobManagerServiceTools_Start.cmd
 set LinkFile_DPNE=%StartMenu_90-Tools_DP%\90-JobManager Service Tools.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%\99-Install"
 set toRun=%toRun% /Arguments=
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\99-Install\Icons\JobManagerServiceTools_Start.ico"
 set toRun=%toRun% /Description="Menu to delete files in %temp% directory"
 call :DelIfExist "%StartMenu_90-Tools_DP%\90-PLMJobManager Service Tools.cmd.lnk"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%
 copy "%LinkFile_DPNE%" "%StartMenu_01-Install_DP%\24 JobManager Service Tools.lnk" >nul

:Next
 rem -- 22.02.2016 91-JobComputer Setup Defaults.lnk moved to here --
 set LinkDest_DPNE=%MyAppl_Root_DP%\99-Install\ClientSettings\ClientSetup_DefaultOptions.cmd
 set LinkFile_DPNE=%StartMenu_90-Tools_DP%\91-JobComputer Setup Defaults.lnk
 set toRun=jfShellLinkCreate.exe  /Quiet
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /WorkDir=""
 set toRun=%toRun% /Arguments="/ViewResult"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\99-Install\Icons\ClientSetup_DefaultOptions.ico"
 set toRun=%toRun% /Description="Setup JobClients Default settings"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%


:Next
 rem -- 03-BinPublic\Sysinternals\Filemon.exe Link Create --
 rem -- remove 01.05.2018 / J.Fes
 call :DelIfExist "%StartMenu_90-Tools_DP%\95-Sysinternals Filemon.lnk"
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\Sysinternals\Filemon.exe
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\95-Sysinternals Filemon.lnk"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\Sysinternals"
REM  set toRun=%toRun% /Arguments=
REM  set toRun=%toRun% /Description="Sysinternals Filemon"
REM  if not exist "%LinkDest_DPNE%" goto :Next
REM  %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%


:Next
 rem -- 03-BinPublic\caffeine.exe Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\caffeine.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\21-Caffeine.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic"
 set toRun=%toRun% /Arguments=
 set toRun=%toRun% /Description="keep host awake"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%

:Next
 rem -- 03-BinPublic\DotNetFrameWorkVersionChecker.exe Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\DotNetFrameWorkVersionChecker.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\22-DotNetFrameWork Version Checker.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic"
 set toRun=%toRun% /Arguments=
 set toRun=%toRun% /Description="checks installed"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%

:Next
 rem #New
 rem -- 03-BinPublic\DesktopRefresh.exe Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\DesktopRefresh.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\23-Desktop Refresh.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\99-Install\Icons\DesktopRefresh.ico"
 set toRun=%toRun% /Arguments=
 set toRun=%toRun% /Description="refresh your desktop"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%

:Next
 rem #New: 01.11.2016 10:31
 rem -- 03-BinPublic\KeePassMobil\KeePass.exe Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\KeePass\KeePass.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\24-PLMJobManager Password Org via KeePass (admin).lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 REM  set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\99-Install\Icons\DesktopRefresh.ico"
 set PLMJobManager_Passwords_template_DPNE=%InstallTemplates_DP%\92-PLMJobManager_Passwords_Customer.kdbx
 set PLMJobManager_Passwords_Customer_DPNE=%DocCustom_01-Admin_DP%\92-PLMJobManager_Passwords_Customer.kdbx

 rem #Doc: 02.05.2017/J.Fes move existing
 if exist "%PLMJobManager_Passwords_template_DPNE%" if not exist "%PLMJobManager_Passwords_Customer_DPNE%"  (
  Echo Copy Custom Password template %PLMJobManager_Passwords_Customer_DPNE%
  copy "%PLMJobManager_Passwords_template_DPNE%" "%PLMJobManager_Passwords_Customer_DPNE%"
 )
 if exist "%PLMJobManager_Passwords_Customer_DPNE%" set toRun=%toRun% /WorkDir="%DocCustom_01-Admin_DP%"
 if exist "%PLMJobManager_Passwords_Customer_DPNE%" set toRun=%toRun% /Arguments=""%PLMJobManager_Passwords_Customer_DPNE%""
 set toRun=%toRun% /Description="Manage JobMgr user and pw"
 if not exist "%LinkDest_DPNE%" goto :Next
 if not exist "%PLMJobManager_Passwords_Customer_DPNE%" goto :Next
 Call :DelIfExist "%StartMenu_90-Tools_DP%\24-Passwords Org (92-PLMJobManager_Passwords_Custome.kdbx).lnk"
 %toRun%



:Next
 REM -- #New: 12.02.2019/J.Fes
 rem -- 03-BinPublic\ClipX\clipx.exe Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\ClipX\clipx.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\25-ClipX ClipBord Monitor.lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic"
 set toRun=%toRun% /Arguments=
 set toRun=%toRun% /Description="ClipBord Monitor"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%

rem ################ Install ###################################################
:Next
 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="%InstallComponents_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
 Call :JobManagerCreateStartLinks 91-JobMgrStart "%JobMgrLinksCreate%" %JobPlanerLinkDoCreate%
 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%"
 rem 01.05.2018/J.Fes Remove 91-TestSystem .. 92-ProdSystem Link Dirs

 call :DelIfExist    "%JobMgrProgsStartMenu_DP%\*-Job*.lnk"
 call :DelDirIfExist "%StartMenu_DP%\91-TestSystem"
 call :DelDirIfExist "%StartMenu_DP%\92-ProdSystem"

: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%"
 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.exe"
 set toRun=%toRun% /Description="JobClient %JobMgrSystem%"
 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.exe"
 set toRun=%toRun% /Description="JobClient %JobMgrSystem%"
 set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :Next
 rem - heraugenommen 26.10.2010 07:46 J.Fes
 %toRun%

:Next
 Echo Copy JobMgr Start Links to......: %JobMgrProgsStartMenu_DP%
 copy "%JobMgrProgsStartMenu_DP%\*.lnk" "%StartMenu_DP%\*.*" >nul

: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
REM  set LinkDirSpecialMode_DP=%JobMgrProgsStartMenu_DP%
REM  if not exist "%LinkDirSpecialMode_DP%" md "%LinkDirSpecialMode_DP%"
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\02-BinClient\JobManagerStart.cmd
REM  set LinkFile_DPNE=%LinkDirSpecialMode_DP%\02-JobClient (%JobMgrSystem%) [StartMode 3-PauseMode].lnk
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /Arguments="/Client /ServerSettingsXML %JobMgrSystem% /JobClientStartMode Pause"
REM  set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.exe"
REM  set toRun=%toRun% /Description="JobClient %JobMgrSystem%"
REM  set toRun=%toRun% /DisplayMode="Min"
REM  if not exist "%LinkDest_DPNE%" goto :Next
 rem - heraugenommen 26.10.2010 07:46 J.Fes
 rem %toRun%
 call :DelIfExist "%LinkDirSpecialMode_DP%\02-JobClient (%JobMgrSystem%) [StartMode 3-PauseMode].lnk"


: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%"
 set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :Next
 %toRun%
 REM #LUp: 01.05.2018/J.Fes reor start links for Update
 call :DelIfExist "%StartMenu_01-Install_DP%\*JobServer*Setup.lnk"
 REM #DOC: copy 21 JobServer (%JobMgrSystem%) Setup.lnk into 01-Install menu
 copy  "%LinkFile_DPNE%" "%StartMenu_01-Install_DP%\21 JobServer (%JobMgrSystem%) Setup.lnk"

:Next
 call :DelIfExist "%JobMgrProgsStartMenu_DP%\91-JobComputer Setup Defaults.lnk"



:Next

endlocal
goto :eof


:StartMenuCreateDone
 Call :DesktopRefresh
 if /I "%Quiet%"=="true"  goto :eof
 Call :ColorSet OK
 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 --------------------- ######


:LinkCreate_URL           
rem Usage
rem call :LinkCreate_URL "%DestFile_DPNE%" "%URL%" "%Icon%" 

 set DestFile_DPNE=%1
 set URL=%2
 set Icon=%3
 
 echo [InternetShortcut] >%DestFile_DPNE%
 echo URL=%URL% >>%DestFile_DPNE%
 echo IconFile=%Icon% >>%DestFile_DPNE%
 echo IconIndex=0 >>%DestFile_DPNE%     
 goto :eof

: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 ============================================================================
:PathRootDirTP
 REM  #New 22.02.2016/J.Fes
 rem parses from DIR last path section and sets value to:%1
 set %1=%~n2
goto :eof

rem ============================================================================
:DelIfExist
 if not exist "%~1" goto :DelIfExistEnd
 Echo - Delete files..................: %~1
 del "%~1"
 goto :DelIfExistEnd
:DelIfExistEnd
 goto :eof

:DelDirIfExist
 if not exist "%~1" goto :DelDirIfExistEnd
 Echo - Delete dir....................: %~1
 rd /s /q "%~1"
 goto :DelDirIfExistEnd
:DelDirIfExistEnd
 goto :eof

:CleanDirIfExist
 REM #New: 18.10.2019/J.Fes
 if not exist "%~1" goto :CleanDirIfExistEnd
 Echo - CleanUp dir...................: %~1\*.*
 del /s /q "%~1\*.*" >nul
 goto :CleanDirIfExistEnd
:CleanDirIfExistEnd
 goto :eof

:ArchivIfExist
 rem usage CALL :ArchivIfExist  "%Source_DPNE%"  "%Dest_DP%"  "%Dest_NE%"
 if not exist "%~1" goto :ArchivIfExistEnd

 set Source_DPNE=%~1
 set Dest_DP=%~2
 set Dest_NE=%~3
 set Dest_DPNE=%Dest_DP%\%Dest_NE%
 Echo -----^> Archiv File: ["%~1"]
 Echo  from............................: %Source_DPNE%
 Echo  to..............................: %Dest_DPNE%
 if not exist "%Dest_DP%" md "%Dest_DP%"
 move "%Source_DPNE%" "%Dest_DPNE%"

 goto :ArchivIfExistEnd
:ArchivIfExistEnd
 goto :eof

rem ============================================================================
:DesktopRefresh
 rem #New:22.02.2016/J.Fes
 Rem #Doc:refeshes the desktop
 Call "%BinPublic_DP%\DesktopRefresh.exe"
goto :eof
rem ============================================================================
:ColorSet
Rem Stand 25.06.2011
Rem Examples:
 REM call :ColorSet Standard
 REM call :ColorSet IsExecuting
 REM call :ColorSet IsIdel
 REM call :ColorSet End
 REM call :ColorSet Ende
 REM call :ColorSet Ok
 REM call :ColorSet Err

 rem -- cmd Color Farbinfo:
 REM    0 = Schwarz        8 = Dunkelgrau
 REM    1 = Dunkelblau     9 = Blau
 REM    2 = Dunkelgrün     A = Grün
 REM    3 = Blaugrün       B = Zyan
 REM    4 = Dunkelrot      C = Rot
 REM    5 = Lila           D = Magenta
 REM    6 = Ocker          E = Gelb
 REM    7 = Hellgrau       F = Weiß
 rem -- Farben nach Status setzen
 rem Gelb Schwarz
 if /I "%~1" equ "Standard"    set JobColorLast=E0
 rem 25.06.2011 07:00 Standard eingef. IsExecuting Neu
 if /I "%~1" equ "IsExecuting" set JobColorLast=D0
 rem Blaugrün Schwarz 15.11.2010 07:45 Hellgrau Schwarz
 if /I "%~1" equ "IsIdel"      set JobColorLast=70
 rem Hellgrau Schwarz
 if /I "%~1" equ "End"         set JobColorLast=70
 if /I "%~1" equ "Ende"        set JobColorLast=70
 rem Gruen Schwarz
 if /I "%~1" equ "Ok"          set JobColorLast=A0
 rem Rot Schwarz
 if /I "%~1" equ "Err"         set JobColorLast=C0

 rem jetzt die Farbe setzen
 if not "%JobColorLast%"=="" color %JobColorLast%
 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
