I have a batch script that creates a vbs that creates a shortcut (complicated I know), however the problem is that it launches the program where the shortcut is located. Any way to make it start in C:\users\Public\Settings\ where the exe is? Thanks everyone!
SETLOCAL ENABLEDELAYEDEXPANSION
SET LinkName=ITCMD-Notifier-Settings
SET Esc_LinkDest=C:\Users\%username%\Desktop\!LinkName!.lnk
SET Esc_LinkTarget=C:\users\Public\ITCMD\Settings\ITCMD Notifier Settings.exe
SET cSctVBS=CreateShortcut.vbs
SET LOG=".\%~N0_runtime.log"
((
echo Set oWS = WScript.CreateObject^("WScript.Shell"^)
echo sLinkFile = oWS.ExpandEnvironmentStrings^("!Esc_LinkDest!"^)
echo Set oLink = oWS.CreateShortcut^(sLinkFile^)
echo oLink.TargetPath = oWS.ExpandEnvironmentStrings^("!Esc_LinkTarget!"^)
echo oLink.Save
)1>!cSctVBS!
cscript //nologo .\!cSctVBS!
DEL !cSctVBS! /f /q
)1>>!LOG! 2>>&1
echo oLink.WorkingDirectory = "C:\users\Public\Settings"beforeecho oLink.SaveAlso is best practice enclose both var name and var content within quotes as inSET "Esc_LinkTarget=C:\users\Public\ITCMD\Settings\ITCMD Notifier Settings.exe"