$insfolder = (Get-ItemProperty "HKLM:\SOFTWARE\CHARON\Installation").CHARONLocation $svcmgrexe = "ServiceManager.exe" $shortname = "CHARON Virtual Machine Manager" $WshShell = New-Object -comObject WScript.Shell $Shortcut = $WshShell.CreateShortcut("${env:ProgramData}\Microsoft\Windows\Start Menu\Programs\StartUp\${shortname}.lnk") $Shortcut.TargetPath = "${insfolder}\Virtual Machine Manager\${svcmgrexe}" $Shortcut.Arguments = "--hidden" $Shortcut.WindowStyle = 4 $Shortcut.WorkingDirectory = "${insfolder}\Virtual Machine Manager" $exedesc = (Get-ItemProperty -Path $Shortcut.TargetPath).VersionInfo.FileDescription $exevers = (Get-ItemProperty -Path $Shortcut.TargetPath).VersionInfo.FileVersion $Shortcut.Description = "${exedesc} ${exevers} for running CHARON as Virtual Machine (service)" $Shortcut.Save()