![]() |
|
|
| Subject:
VBScript Windows programming: creating a shortcut in the Fonts folder
Category: Computers > Programming Asked by: terry70-ga List Price: $5.05 |
Posted:
24 Jun 2006 13:30 PDT
Expires: 29 Jun 2006 18:10 PDT Question ID: 740793 |
I'm stuck with the script I'm building.
The script is called from the context menu when right-clicking on a
.ttf file. That part is already done and works. I can grab the filepath
correctly.
Using the provided path, I want to create a *shortcut* to that file in
the Fonts folder, so as to install the font *without* copying the
physical .ttf font file. This is what I currently do manually since I
don't like having duplicate files on my HD. I keep my fonts in
c:\stuff\myfonts\.
I've seen numerous techniques for *copying* the .ttf file but that's
not what I need.
I also tried creating a shortcut in the 'Fonts' folder with the
.CreateShortcut method, but it didn't create anything.
Question is: how do I succesfully create a shortcut in the Windows
Font folder to that TTF file?
Existing code:
Set objArguments = WScript.Arguments
strFontFile = objArguments(0)
Set objShell = WScript.CreateObject("WScript.Shell")
strFontsFolder = objShell.SpecialFolders("Fonts")
Set objShortcut = objShell.CreateShortcut(strFontsFolder & "\test.lnk")
objShortcut.TargetPath = strFontFile
objShortcut.Save |
|
| There is no answer at this time. |
|
| Subject:
Re: VBScript Windows programming: creating a shortcut in the Fonts folder
From: scimitar_x-ga on 29 Jun 2006 12:56 PDT |
Could you not just create the shortcut in the same location as the ttf file, and then using the FileSystemObject, move the shortcut into the Fonts folder? |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
| Search Google Answers for |
| Google Home - Answers FAQ - Terms of Service - Privacy Policy |