Oct. 6th, 2022

hroft_clone3: (Default)
Создавать ярлыки, использующие переменные окружения, из интерфейса Windows не рекомендуется, будут сохранены значения переменных на момент создания.
Правильнее создавать с помощью скрипта PowerShell

$target = "C:\Users\Все пользователи\Рабочий стол\_LeaderTask_.lnk"
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut($target)
$Shortcut.TargetPath = "C:\LeaderTask\%username%\LeaderTask\LeaderTask.exe"
$Shortcut.WorkingDirectory = "C:\LeaderTask\%username%\"
$Shortcut.Description = "Leader Task"
$Shortcut.IconLocation = "C:\LeaderTask\%username%\LeaderTask\LeaderTask.exe, 0"
$Shortcut.Save()

Все параметры этой операции
# Set WshShell = CreateObject("WScript.Shell")
# Set WshShortcut = WshShell.CreateShortcut("C:\Notepad.lnk")
# WshShortcut.Arguments = "C:\autoexec.bat"
# WshShortcut.Description = "Пробный ярлык"
# WshShortcut.HotKey = "CTRL+ALT+F"
# WshShortcut.IconLocation = "shell32.dll, 5"
# WshShortcut.TargetPath = "notepad.exe"
# WshShortcut.WindowStyle = 1
# WshShortcut.WorkingDirectory = "C:\"
# MsgBox WshShortcut.FullName
# WshShortcut.Save

ЗЫ После создания ярлыка скриптом, его нельзя править через интерфейс. Переменные окружения подставятся сами
hroft_clone3: (Default)
Ну не всраиваются шорты в ЖЖ, что поделать

https://www.youtube.com/shorts/jrP94c0ewVY

Profile

hroft_clone3: (Default)
hroft_clone3

March 2026

S M T W T F S
1234567
8910111213 14
15161718192021
22232425262728
293031    

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 2nd, 2026 04:50 am
Powered by Dreamwidth Studios