hroft_clone3: (Default)
[personal profile] hroft_clone3
Создавать ярлыки, использующие переменные окружения, из интерфейса 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

ЗЫ После создания ярлыка скриптом, его нельзя править через интерфейс. Переменные окружения подставятся сами
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

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 10:16 am
Powered by Dreamwidth Studios