Create Desktop Shortcuts Via Batch Script In Windows

Some application installers in Windows do not create a desktop icon.  I used this script to create one for all users.  Just modify the highlighted lines per your environment.

@echo off

set SCRIPT="%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.vbs"

echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
echo sLinkFile = "%PUBLIC%\Desktop\ShortcutName.lnk" >> %SCRIPT%
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
echo oLink.TargetPath = "%SYSTEMDRIVE%\Program Files\MyApp.exe" >> %SCRIPT%
echo oLink.WorkingDirectory ="%SYSTEMDRIVE%\Program Files" >> %SCRIPT%
echo oLink.Save >> %SCRIPT%

cscript /nologo %SCRIPT%

del %SCRIPT%

 

OS X: Triggering Automation Scripts Using launchd

Desktop management software, such as Casper, has the feature of running scripts when a computer meets a certain criteria.  You can create a similar effect using launchd by creating a Launch Daemon or Launch Agent.  These run in the background and you can use them to trigger a script to run.  Basically, if you know how to script something, you can get it to run automatically via launchd . Continue reading “OS X: Triggering Automation Scripts Using launchd”