Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Desktop shotcut

Status
Not open for further replies.

asm338s

Programmer
Jul 16, 2001
135
US
I created a desktop shotcut by placing the following code in my .exe :
oWsh = CREATEOBJECT("wscript.shell")
cDeskPath = oWsh.SpecialFolders("desktop")
oShort = oWsh.CreateShortcut(cDeskpath+"\PCPrint Plus.LNK")
oShort.TargetPath = "c:\Ianera\ianera.EXE"
oShort.Save

It places the shortcut, but when I run my app using the shorcut it puts foxuser.dbf and foxuser.fpt on my desktop too. ????? How can I get rid of them still have the shorcut.
 
One way to address this is to include a CONFIG.FPW in the EXE's Folder - c:\Ianera\ in this case. The CONFIG.FPW file should either have:
RESOURCE=OFF
if you don't really need the resource (FOXUSER) file, OR
RESOURCE=c:\Ianera\FOXUSER.DBF
if you want to place it in the EXE's directory.

Rick
 
I have 2 solutions for you.

1) If your app doesn't require the FOXUSER table, then create a text file called CONFIG.FPW in your project and include the line "resource = off" in it.

2) If you DO need them, then there is probably a property of oShort for the starting directory (the box labeled "Start in" when you view a shortcut) that you should set to the full path of your app.

Good luck!
 
I found the property you need in the MSDN library. Try adding this before the SAVE line:
Code:
oShort.WorkingDirectory="c:\Ianera\"
 
Thanks for looking that up. It worked by just setting the resource off.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top