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

create shortcut in W7 with parameters in startup folder of currentuser

Status
Not open for further replies.

technicy

Technical User
Dec 4, 2011
1
0
0
NL
Hello,

I hope someone can help me. I'm looking for a way to create a shortcut in the startup folder of current user in Windows 7. The shortcut is for virtual application in appv and has the following properties:

target:
C:\Program Files\Microsoft Application Virtualization Client\sfttray.exe (now the tricky part) /launch "Wellnomics WorkPace 4.0.0 4.0.0.8"

Working dir:
C:\PROGRA~1\MIEFD2~1 (or C:\Program Files\Microsoft Application Virtualization Client)

The shortcut must be created if certain file exists.

This is the vbs I created:

Set objShell=CreateObject("Wscript.Shell")
strUserprofile=objShell.ExpandEnvironmentStrings("%USERPROFILE%")

Workpace = strUserprofile & "\AppData\Local\Wellnomics\WorkPace"

Set objNetwork = wscript.CreateObject("wscript.network")
Set objFSO=CreateObject("Scripting.FilesystemObject")



If objFSO.FileExists(Workpace & "\" & objnetwork.UserName & ".usr") Then

Set WshShell = WScript.CreateObject("WScript.Shell" )
strStartup = WshShell.SpecialFolders("AllUsersStartmenu" )
set oShellLink = WshShell.CreateShortcut(strStartup & "\programs\startup\Wellnomics Workpace 4.0.0.lnk" )
oShellLink.TargetPath = "%programfiles%\Microsoft Application Virtualization Client\sfttray.exe" /launch "Wellnomics WorkPace 4.0.0 4.0.0.8"
oShellLink.IconLocation = "%programfiles%\Microsoft Application Virtualization Client\sfttray.exe"
oShellLink.Description = "Workpace"
oShellLink.WorkingDirectory = "C:\PROGRA~1\MICROS~3"
oShellLink.Save

End if


I've trouble getting the /launch "Wellnomics WorkPace 4.0.0 4.0.0.8" part right. Could someone please help me.

Grz,

Is
 
Replace this:
oShellLink.TargetPath = "%programfiles%\Microsoft Application Virtualization Client\sfttray.exe" /launch "Wellnomics WorkPace 4.0.0 4.0.0.8"
with this:
oShellLink.TargetPath = "%programfiles%\Microsoft Application Virtualization Client\sfttray.exe"
oShellLink.Arguments = "/launch ""Wellnomics WorkPace 4.0.0 4.0.0.8"""

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top