Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ShortCuts creation, WSH, quotes
Message
De
02/04/2001 12:07:56
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
ShortCuts creation, WSH, quotes
Divers
Thread ID:
00490961
Message ID:
00490961
Vues:
51
Hi UTers,

I am using the Windows Scripting Host (WSH) to automate the creation of a Desktop Shortcut. I have a problem with the quotes that are added to my targetpath by either windows or the WSH. I don't want them because windows swawks about my path when I include switches in my command line. This is the code:

loshell = createobj("WScript.Shell")
strDeskTop = loShell.SpecialFolders("DeskTop")
oShellLink = loShell.CreateShortCut(strDeskTop + "\Practice Administration.lnk")

** I need to have -t -cc:\protemps\ti.fpw on the command line
** if you look at the properties of the shortcut
** after this program is run, you will see that
** the targetpath (the command and the included -t-c: switches)
** are sourounded in quotes.
strCommandline = "c:\gmg_win\wingmg.exe -t -cc:\protemps\ti.fpw"

oShellLink.TargetPath= strCommandLine
oShellLink.WorkingDirectory="c:\gmgwin"
oShellLink.WindowStyle=1
oShellLink.Description="Practice Administration"
oShellLink.save

oShellLink = null
release oShellLink
loShell = null
release loShell

If you run my code you will get a shortcut created but windows will tell you that your target path is invalid if you attempt to look at the properties of the shortcut and attempt to exit the properties dialog. If you remove the quotes around the targetpath or just limit them to the actual file ie: c:\gmg_win\wingmg.exe windows has no problem.

Any suggestions on how to make a shortcut with command line switches?

Dr. G. (Neil)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform