@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 if exist "%StartMenu_DP%" rd /S "%StartMenu_DP%"

 set StartMenu_00-Doku_DP=%StartMenu_DP%\10-Documentation.Application
 set StartMenu_01-Install_DP=%StartMenu_DP%\01-Install
 set StartMenu_01-InstallDocu_DP=%StartMenu_01-Install_DP%
 set StartMenu_02-Setup_DP=%StartMenu_DP%\02-Setup
 set StartMenu_80-OpenFolder_DP=%StartMenu_DP%\80-OpenFolder
 set StartMenu_90-Tools_DP=%StartMenu_DP%\90-Tools
REM  set StartMenu_91-TestSys_DP=%StartMenu_DP%\91-TestSystem
REM  set StartMenu_92-ProdSys_DP=%StartMenu_DP%\92-ProdSystem

 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-Setup_DP%"       md "%StartMenu_02-Setup_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%"
 rem set toRun=%toRun% /WorkDir="%LinkDest_DPNE%"
 rem set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.ico"
 rem set toRun=%toRun% /Description="open's the Application Documentation folder"
 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%"
 rem set toRun=%toRun% /WorkDir="%ComponentsDir_DP%"
 rem set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%IconsDir_DP%\setup-optional.ico"
 rem set toRun=%toRun% /Description="Install's windows installer"
 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%"
 rem set toRun=%toRun% /WorkDir="%ComponentsDir_DP%"
 rem set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%IconsDir_DP%\setup-optional.ico"
 rem set toRun=%toRun% /Description="Install's windows installer"
 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%"
 rem set toRun=%toRun% /WorkDir="%ComponentsDir_DP%"
 rem set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%IconsDir_DP%\setup-optional.ico"
 rem set toRun=%toRun% /Description="Install's windows installer"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%

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


:Next
 rem -- WhatsNew Dokumentation  Link in JobManagerV2\10-Documentation.Application legen
 set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\01-Install\JobManagerV2_WhatsNew.pdf
 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=%MyAppl_Root_DP%\10-Documentation.Application\JobManagerV2 WhatsNew.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%


rem ################ Internet Links ##################

:Next
 rem if not exist "%MyAppl_Root_DP%\99-Install\Internet-Links" goto :Next
 rem copy "%MyAppl_Root_DP%\99-Install\Internet-Links\*.*" "%StartMenu_00-Doku_DP%\*.*">nul


 rem ############ 01-Install ###################
:Next
 rem -- Install and Setup Dokumentation
 Echo - Create Link's: 01-Install
 set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\01-Install\JobManagerV2_Docu_Install_Overview_JFES_FG.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\10 JobManagerV2 Docu Install Overview.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 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-optional.ico"
 rem set toRun=%toRun% /Description="Install's windows installer"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%
 rem Link auch in den Doku Ordner erstellen
 rem copy "%LinkFile_DPNE%" "%StartMenu_00-Doku_DP%">nul


:Next
 rem -- Install and Setup Dokumentation
 set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\01-Install\JobManagerV2_Docu_Install_SQLServer_JFES_FG.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\11 JobManagerV2 Docu Install SQLServer.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 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-optional.ico"
 rem set toRun=%toRun% /Description="Install's windows installer"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%
 rem Link auch in den Doku Ordner erstellen
 rem if exist "%LinkFile_DPNE%" copy "%LinkFile_DPNE%" "%StartMenu_00-Doku_DP%">nul


:Next
 rem -- Install and Setup Dokumentation
 set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\01-Install\JobManagerV2_Docu_Install_SoftwareComponents_JFES_FG.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\12 JobManagerV2 Docu Install SoftwareComponents.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 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-optional.ico"
 rem set toRun=%toRun% /Description="Install's windows installer"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%
 rem Link auch in den Doku Ordner erstellen
 rem if exist "%LinkFile_DPNE%" copy "%LinkFile_DPNE%" "%StartMenu_00-Doku_DP%">nul

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

:Next
 rem -- Install and Setup Dokumentation
 set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\01-Install\JobManagerV2_Docu_Install_Overview_JFES_FG.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\10 JobManagerV2 Docu Install Overview.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%ComponentsDir_DP%"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%
 rem Link auch in den Doku Ordner erstellen
 rem copy "%LinkFile_DPNE%" "%StartMenu_00-Doku_DP%">nul


:Next
 rem -- Install and Setup Dokumentation
 set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\01-Install\JobManagerV2_Docu_Install_SQLServer_JFES_FG.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\11 JobManagerV2 Docu Install SQLServer.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 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-optional.ico"
 rem set toRun=%toRun% /Description="Install's windows installer"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%
 rem Link auch in den Doku Ordner erstellen
 rem if exist "%LinkFile_DPNE%" copy "%LinkFile_DPNE%" "%StartMenu_00-Doku_DP%">nul


:Next
 rem -- Install and Setup Dokumentation
 set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\01-Install\JobManagerV2_Docu_Install_SoftwareComponents_JFES_FG.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\12 JobManagerV2 Docu Install SoftwareComponents.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 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-optional.ico"
 rem set toRun=%toRun% /Description="Install's windows installer"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%
 rem Link auch in den Doku Ordner erstellen
 rem if exist "%LinkFile_DPNE%" copy "%LinkFile_DPNE%" "%StartMenu_00-Doku_DP%">nul

:Next
 rem -- User Dokumentation
 set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\JobManagerV2_Docu_User_JFES_FG.pdf
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\13 JobManagerV2 User Documentation.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 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-optional.ico"
 rem set toRun=%toRun% /Description="Install's windows installer"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%
 rem Link auch in den Doku Ordner erstellen
 rem if exist "%LinkFile_DPNE%" copy "%LinkFile_DPNE%" "%StartMenu_00-Doku_DP%">nul

:Next
 rem -- User Dokumentation
 set LinkDest_DPNE=%MyAppl_Root_DP%\01-BinServer\ApplicationInfo.txt
 set LinkFile_DPNE=%StartMenu_01-InstallDocu_DP%\14 JobManagerV2 Version Info.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 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-optional.ico"
 rem set toRun=%toRun% /Description="Install's windows installer"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%


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

:Next
 rem -- Setup Dokumentation
 Echo - Create Link's: 02-Setup
 set LinkDest_DPNE=%MyAppl_Root_DP%\10-Documentation.Application\02-Setup\JobManagerV2_Docu_Setup_JFES_FG.pdf
 set LinkFile_DPNE=%StartMenu_02-Setup_DP%\01 JobManagerV2 Docu Setup.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 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-optional.ico"
 rem set toRun=%toRun% /Description="Install's windows installer"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%
 rem Link auch in den Doku Ordner erstellen
 rem copy "%LinkFile_DPNE%" "%StartMenu_00-Doku_DP%">nul



:Next
 rem -- JobServer Setup Link Create --------------------------------
 set LinkDest_DPNE=%MyAppl_Root_DP%\01-BinServer\JobManagerStart.cmd
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_02-Setup_DP%\01-JobServer (Setup).lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\01-BinServer"
 set toRun=%toRun% /Arguments="/JobServer /Setup"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\01-BinServer\MyApplIconSet.ico"
 set toRun=%toRun% /Description="Starts the JobManager Server in Setup mode"
 set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :next
REM  %toRun%
 rem Cleanup
 call :DelIfExist "%StartMenu_02-Setup_DP%\01-JobServer (Setup).lnk"



: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_02-Setup_DP%\99 Startmenu Create-Update Links.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%

 if exist "%StartMenu_02-Setup_DP%\90 Startmenu Create-Update Links.lnk" del "%StartMenu_02-Setup_DP%\90 Startmenu Create-Update Links.lnk"
:Next
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\MWSnap\MwSnapDefault-Settings.reg
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%StartMenu_02-Setup_DP%\91-MwSnapDefault-Settings (Registry Import).lnk"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\MWSnap"
REM  rem set toRun=%toRun% /Arguments="/Server /Setup"
REM  rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\01-BinServer\MyApplIconSet.ico"
REM  set toRun=%toRun% /Description="import the standard settings for software MwSnap in the users registry"
REM  rem set toRun=%toRun% /DisplayMode="Min"
REM  if not exist "%LinkDest_DPNE%" goto :next
 rem %toRun%
 rem aufraumen 08.02.2010 10:11
 if exist "%StartMenu_02-Setup_DP%\91-MwSnapDefault-Settings (Registry Import).lnk" del "%StartMenu_02-Setup_DP%\91-MwSnapDefault-Settings (Registry Import).lnk"

:Next
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\Setup\Setup-03-BinPublic.cmd
 set LinkFile_DPNE=%StartMenu_02-Setup_DP%\91-Setup User Defaults for all Tools.lnk
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%LinkFile_DPNE%"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 rem set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\MWSnap"
 rem set toRun=%toRun% /Arguments="/Server /Setup"
 set toRun=%toRun% /IconFile="%IconsDir_DP%\setup.ico"
 set toRun=%toRun% /Description="Set User defaults for all tools"
 rem set toRun=%toRun% /DisplayMode="Min"
 REM  if not exist "%LinkDest_DPNE%" goto :next
 rem 12.09.2011 21:55 J.Fes Entnommen
REM  %toRun%
 rem ausfuehren von Setup-03-BinPublic.cmd
REM  call "%LinkDest_DPNE%" /Quiet
 call :DelIfExist "%LinkFile_DPNE%"



:Next
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\Explorer-XP-set-EasySearch.reg
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_02-Setup_DP%\92-WinExplorer-Set-EasySearch (Registry Import).lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\MWSnap"
 rem set toRun=%toRun% /Arguments="/Server /Setup"
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\01-BinServer\MyApplIconSet.ico"
 set toRun=%toRun% /Description="sets in WinXp the easy search for the windows explorer"
 rem set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :next
REM  %toRun%
 rem Cleanup
 call :DelIfExist "%StartMenu_02-Setup_DP%\92-WinExplorer-Set-EasySearch (Registry Import).lnk"

 rem ############################# 80-OpenFolder ###################
:Next
 Echo - Create Link's: 80-OpenFolder

 set DelOldLink_DPNE=%StartMenu_80-OpenFolder_DP%\01-%MyApplBase_TP% Application root folder.lnk
 if exist "%DelOldLink_DPNE%" del "%DelOldLink_DPNE%" 1>nul 2>nul
 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%



REM :Next
REM  set LinkDest_DPNE=%MyAppl_Root_DP%\11-Documentation.Custom
REM  set toRun=jfShellLinkCreate.exe /Quiet
REM  set toRun=%toRun% /LinkFile="%StartMenu_80-OpenFolder_DP%\11-Documentation.Custom folder.lnk"
REM  set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
REM  set toRun=%toRun% /WorkDir="%LinkDest_DPNE%"
REM  rem set toRun=%toRun% /Arguments=
REM  rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.ico"
REM  set toRun=%toRun% /Description="open's the Custom Documentation folder"
REM  if not exist "%LinkDest_DPNE%" goto :next
REM  %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 -- PicPick Link Create --------------------------------
 set LinkFile_DPNE=%StartMenu_90-Tools_DP%\12-PicPick (screen capture).lnk
 rem call :DelIfExist "%LinkFile_DPNE%"
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\PicPick\PicPick.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\PicPick"
 set ScreenShotDir="%MyAppl_Root_DP%\11-Documentation.Custom\ScreenShots"
 if not exist "%ScreenShotDir%" Echo I: Create ScreenShotDir:"%ScreenShotDir%" & md "%ScreenShotDir%"
rem 12.08.2011 10:01 entnommen
REM  set toRun=%toRun% /Arguments=/cr
 set toRun=%toRun% /Description="Screenshot software"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%
 rem copy Link in QuickLaunch
 copy "%LinkFile_DPNE%" "%QuickLaunch_DP%\*.*" >nul

 :Next
 rem new in 08.10.2010 J.Fes
 rem -- PicPick Link Create --------------------------------
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\PicPick\PicPickRestart.cmd
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\12-PicPick Restart (screen capture).lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\03-BinPublic\PicPick\PicPickRestart.ico"
 set toRun=%toRun% /Description="Screenshot software restart"
 set toRun=%toRun% /DisplayMode="Min"
 if not exist "%LinkDest_DPNE%" goto :next
 %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 -- 03-BinPublic\UltraVnc Link Create --------------------------------------
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\UltraVnc\winvnc.exe
 set toRun=jfShellLinkCreate.exe /Quiet
 set toRun=%toRun% /LinkFile="%StartMenu_90-Tools_DP%\14-WinVNC Server start (remote contol).lnk"
 set toRun=%toRun% /LinkDest="%LinkDest_DPNE%"
 set toRun=%toRun% /WorkDir="%MyAppl_Root_DP%\03-BinPublic\UltraVnc"
 set toRun=%toRun% /Arguments=
 rem set toRun=%toRun% /IconFile="%MyAppl_Root_DP%\02-BinClient\JobClient.ico"
 set toRun=%toRun% /Description="WinVNC Server software start"
 if not exist "%LinkDest_DPNE%" goto :next
 %toRun%
 rem Cleanup
 call :DelIfExist "%StartMenu_90-Tools_DP%\13-WinVNC Server start (remote contol).lnk"

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


:Next
 rem -- 03-BinPublic\RemoteSupport mit JFeuerstein Via TeamViewer Link Create --
 set LinkDest_DPNE=%MyAppl_Root_DP%\03-BinPublic\RemoteSupport_mit_JFeuerstein_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%
 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"

: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
 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
 %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
 %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 - heraugenommen 26.10.2010 07:46 J.Fes
 rem --- JobClient im Test 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 2-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
 rem %toRun%
 call :DelIfExist "%LinkFile_DPNE%"


: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
 set LinkDest_DPNE=%MyAppl_Root_DP%\01-BinServer\JobManagerStart.cmd
 set LinkFile_DPNE=%JobMgrProgsStartMenu_DP%\03-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
 if /I "%JobPlanerLinkDoCreate%" equ "YES" %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-Setup (%JobMgrSystem%).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
 %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 : ["%~1"]
 del "%~1"
 goto :DelIfExistEnd
:DelIfExistEnd
 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
