'Done by STefan Zeugner, 2007 'Checks whether R is installed under Win machine and creates a shortcut 'Useful for machines with different user profiles Option Explicit Dim oShell, sRead Dim sLeaf, sTreeR, sask Dim sDesktopPath, sLinkFile, oLink sLeaf = "InstallPath" sTreeR = "HKLM\SOFTWARE\R-core\R\" Set oShell = CreateObject("WScript.Shell") sDesktopPath = oShell.SpecialFolders("Desktop") On Error Resume Next sRead = oShell.RegRead(sTreeR & sLeaf) If sRead="" Then MsgBox "You don't have R installed" WScript.Quit End If sask=InputBox("You have got R installed." & vbLf & "The path to your R is posted below." & vbLf & "Should I create a shortcut to it on your desktop?" & vbLf & "If yes, then press 'OK', else 'Cancel'", "R finder", sRead & "\bin\Rgui.exe") If sask=sRead & "\bin\Rgui.exe" Then sLinkFile = sDesktopPath & "\Rgui.LNK" Set oLink = oShell.CreateShortcut(sLinkFile) oLink.TargetPath = sRead & "\bin\Rgui.exe" oLink.Save End If WScript.Quit endproc: msgbox "Errpr" WScript.Quit