Files
AFM_thumbs/Utilities/Windows/Create_Windows_shortcut.bat
2022-04-08 17:39:57 +02:00

35 lines
1.3 KiB
Batchfile
Executable File

@echo off & setlocal
:: Source: http://www.administrator.de/forum/verkn%C3%BCpfung-auf-desktop-per-batch-anlegen-155061.html
:: Zielpfad
set "zielpfad=%userprofile%\Desktop"
::Name der Verknüpfung (ohne ".lnk")
set "progtitel=AFM_thumbs Starter"
::Speicherort der Programmdatei (wird auch für "Ausführen in:" verwendet)
set "progdir=%cd%"
set "progexe=Windows Batch Starter.bat"
::Kommentar
set "beschreibung=Run AFM_thumbs.py"
::Icon
set "iconpath=%progdir%\AFM_thumbs Icon.ico"
::Bei Bedarf Ordner erstellen:
md "%zielpfad%" 2>nul
md "%progdir%" 2>nul
::temporäres VBScript erzeugen ...
>%temp%\MakeShortCut.vbs echo Set objShell=WScript.CreateObject("Wscript.Shell")
>>%temp%\MakeShortCut.vbs echo Set objShortcut=objShell.CreateShortcut("%zielpfad%\%progtitel%.lnk")
>>%temp%\MakeShortCut.vbs echo objShortcut.TargetPath="%progdir%\%progexe%"
>>%temp%\MakeShortCut.vbs echo objShortcut.Description="%beschreibung%"
>>%temp%\MakeShortCut.vbs echo objShortcut.WorkingDirectory="%progdir%"
>>%temp%\MakeShortCut.vbs echo objShortcut.IconLocation = "C:\Users\Niklas\Documents\Python Scripts\AFM_thumbs_v1.7x_04.10.14\AFM_thumbs Icon.ico"
>>%temp%\MakeShortCut.vbs echo objShortcut.Save
::... ausführen ...
cscript //nologo %temp%\MakeShortCut.vbs
::... und wieder löschen.
del %temp%\MakeShortCut.vbs