Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a desktop shortcut
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Creating a desktop shortcut
Miscellaneous
Thread ID:
01149668
Message ID:
01149668
Views:
77
Hi, I am trying to create a shortcut.
SET STEP ON 
cTargetPath   = '"C:\Program Files\Newbie\Newbie.exe"'
cParameters   = CHR(32) + cHR(47) + "login admin" +CHR(32) +CHR(47) +"password asdfasdf"
cParameters   = (cParameters)
cTarg = cTargetPath + cParameters
WshShell = CreateObject("WScript.Shell") 
   strDesktop = WshShell.SpecialFolders("Desktop") 
   oShellLink = WshShell.CreateShortcut(strDesktop + "\Newbie Shortcut.lnk") 
   oShellLink.TargetPath = cTarg
  	mtarg =  oShellLink.TargetPath
   oShellLink.WindowStyle = 1 
   oShellLink.IconLocation = "newbie.exe, 0" 
   oShellLink.Description = "new bie Shortcut" 
   oShellLink.WorkingDirectory = "C:\Program Files\Newbie\" 
   mloc = oShellLink.WorkingDirectory 
   oShellLink.Save 
All goes well until I pass cTarg to
oShellLink.TargetPath = cTarg.  I know there is a problem because in the 
next line
mtarg =  oShellLink.TargetPath
in the debugger, I can see that all of the symbols / have been turned into symbol
\. But Newbie.exe will not recognize the username and password unless
I use the "\". Can anyone help?
Thanks
Steve
Next
Reply
Map
View

Click here to load this message in the networking platform