To get the path to the Quick Launch folder we create an instance of the WScript.Shell object and then use this line of code to retrieve a collection of environment variables: Set colEnvironmentVariables = objShell.Environment(“Volatile”)Īs it turns out, there’s an environment variable named AppData that pinpoints the location of the Application Data folder. That’s because it relies on Windows Script Host to actually create the shortcut without yet another set of workarounds WSH can’t be used against remote computers). (We should point out that this script must be run on the local computer. First, it determines the location of the Quick Launch folder for the logged-in user. This script actually accomplishes two tasks. Set objShortCut = objShell.CreateShortcut(strFolder & _ “\Microsoft\Internet Explorer\Quick Launch” StrFolder = colEnvironmentVariables.Item(“APPDATA”) & _ Set colEnvironmentVariables = objShell.Environment(“Volatile”) This script, for example, adds Notepad.exe to the Quick Launch tray: Set objShell = CreateObject(“WScript.Shell”) But if you search for Quick Launch and SendKeys you should be able to find a sample without any problem.Īssuming that the Quick Launch tray is already enabled, however, it’s pretty easy to add a new shortcut. There are some workarounds floating around the Internet that use the SendKeys commands, but SendKeys is a bit … flaky … (to say the least) so we don’t really recommend it. Here’s the answer: no, unfortunately there’s really no way to enable and disable the Quick Launch tray using a script. And here’s the answer: Frank “Home Run” Baker, who led the major league in homers four times, even though he never hit more than a dozen home runs in a single season. Before we answer this question we need to first answer a different question. Hey, Scripting Guy! How can I add a shortcut to the Quick Launch tray?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |