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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble creating desktop icon with vbscript 1

Status
Not open for further replies.

gdmorton

Technical User
Mar 19, 2004
3
US
I am trying write code in vbscript to create an icon on the Windows desktop for an Access database file that points to a workgroup file that is on a server. When I create the icon the target path changes from "/WRKGRP" to "\WRKGRP". I must be missing somthing in my code because I can't figure out what is causing it to change.
I am using the WshShell.CreateShotcut method and have created some variables and combined the them in the .TargetPath = line
The code look like this when the varibles are combined:
"c:\program files\microsoft office\office10\msaccess.exe" "c:\documents and settings\folder\mydb.mdb" /WRKGRP "x:\folder\secured.mdw" where x\folder is the server path of the workgroup file.
When the icon is created the /WRKGRP changes to \WRKGRP and the icon will not work.
Any ideas?
 
The shortcut object don't allow command line parameters in the TargetPath property but in the Arguments property, like this:
.TargetPath="c:\program files\microsoft office\office10\msaccess.exe"
.Arguments="""c:\documents and settings\folder\mydb.mdb"" /WRKGRP x:\folder\secured.mdw"

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top