The problem is this when I create a desktop shortcut with a complex command line below it does not work. Seems the shortcut is changed some how. The echo of the command line is correct, But the shortcut is not????
A less complex command line works just fine..
Anyone have any ideas????
1.) Original Desktop Short Cut Works fine
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" \\MyServer\Projects\RecallRoster_User\Application\Recallroster.mde /wrkgrp "\\MyServer\Projects\RecallRoster_User\Application\SecureRecall.mdw" /x "command-line"
2.) VBSCRIPT Created Shortcut does not work, it drops first backslash on path and flips backslash on X just before “command-line”
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" \MyServer\Projects\RecallRoster_User\Application\Recallroster.mde \wrkgrp "\MyServer\Projects\RecallRoster_User\Application\SecureRecall.mdw" \x "command-line"
3.) Strange thing is the wscript.echo command echo’s the correct information. (wscript.echo longname)
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" \\MyServer\Projects\RecallRoster_User\Application\Recallroster.mde /wrkgrp "\\MyServer\Projects\RecallRoster_User\Application\SecureRecall.mdw" /x "command-line"
4.) Source code
Call to Subroutine
If MemberOf(ObjGroupDict, "EW.script"
Then
'If MemberOf(ObjGroupDict, "EW.RECALLROSTER USER"
Then
' call addshortcuttodesktop("Short Cut Name", "Application Target Path", "start in folder"
longname = (chr(34) & "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" & chr(34) & " " & "\\MyServer\Projects\RecallRoster_User\Application\Recallroster.mde" & " " & chr(47) & "wrkgrp" & " " & chr(34) & "\\MyServer\Projects\RecallRoster_User\Application\SecureRecall.mdw" & chr(34) & " " & chr(47) & "x" & " " & chr(34) & "command-line" & chr(34))
wscript.echo longname
Call addshortcuttodesktop("Recall Roster 2004", longname, "\\MyServer\Projects\RecallRoster_User\Application"
If testmode Then
wscript.echo "Member of EW.APP USER"
End If
End If
Subroutine
'************************************************************************************************************************
' call addshortcuttodesktop("Short Cut Name", "Application Target Path", "start in folder"
' call addshortcuttodesktop("APP", "\\MyServer\netapps\Program Files\APP\TAA\TAMAIN.EXE", "\\MyServer\netapps\Program Files\APP\TAA"
'
Sub addshortcuttodesktop(tname,tpath,tdir)
If testmode Then
wscript.echo "************ Subroutine addshortcuttodesktop *****************************************************************"
wscript.echo "Adding Short Cut : " & tname & ".lnk To users desktop"
wscript.echo "Target Path : " & tpath
wscript.echo "Working Directory : " & tdir
End If
Set WshShell = WScript.CreateObject("WScript.Shell"
strDesktop = WshShell.SpecialFolders("Desktop"
Set oShellLink = WshShell.CreateShortcut(strDesktop & "\" & tname & ".lnk"
oShellLink.TargetPath = tpath
oShellLink.WindowStyle = 1
oShellLink.Description = tname & " Shortcut"
oShellLink.WorkingDirectory = tdir
oShellLink.Save
End Sub
A less complex command line works just fine..
Anyone have any ideas????
1.) Original Desktop Short Cut Works fine
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" \\MyServer\Projects\RecallRoster_User\Application\Recallroster.mde /wrkgrp "\\MyServer\Projects\RecallRoster_User\Application\SecureRecall.mdw" /x "command-line"
2.) VBSCRIPT Created Shortcut does not work, it drops first backslash on path and flips backslash on X just before “command-line”
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" \MyServer\Projects\RecallRoster_User\Application\Recallroster.mde \wrkgrp "\MyServer\Projects\RecallRoster_User\Application\SecureRecall.mdw" \x "command-line"
3.) Strange thing is the wscript.echo command echo’s the correct information. (wscript.echo longname)
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" \\MyServer\Projects\RecallRoster_User\Application\Recallroster.mde /wrkgrp "\\MyServer\Projects\RecallRoster_User\Application\SecureRecall.mdw" /x "command-line"
4.) Source code
Call to Subroutine
If MemberOf(ObjGroupDict, "EW.script"
'If MemberOf(ObjGroupDict, "EW.RECALLROSTER USER"
' call addshortcuttodesktop("Short Cut Name", "Application Target Path", "start in folder"
longname = (chr(34) & "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" & chr(34) & " " & "\\MyServer\Projects\RecallRoster_User\Application\Recallroster.mde" & " " & chr(47) & "wrkgrp" & " " & chr(34) & "\\MyServer\Projects\RecallRoster_User\Application\SecureRecall.mdw" & chr(34) & " " & chr(47) & "x" & " " & chr(34) & "command-line" & chr(34))
wscript.echo longname
Call addshortcuttodesktop("Recall Roster 2004", longname, "\\MyServer\Projects\RecallRoster_User\Application"
If testmode Then
wscript.echo "Member of EW.APP USER"
End If
End If
Subroutine
'************************************************************************************************************************
' call addshortcuttodesktop("Short Cut Name", "Application Target Path", "start in folder"
' call addshortcuttodesktop("APP", "\\MyServer\netapps\Program Files\APP\TAA\TAMAIN.EXE", "\\MyServer\netapps\Program Files\APP\TAA"
'
Sub addshortcuttodesktop(tname,tpath,tdir)
If testmode Then
wscript.echo "************ Subroutine addshortcuttodesktop *****************************************************************"
wscript.echo "Adding Short Cut : " & tname & ".lnk To users desktop"
wscript.echo "Target Path : " & tpath
wscript.echo "Working Directory : " & tdir
End If
Set WshShell = WScript.CreateObject("WScript.Shell"
strDesktop = WshShell.SpecialFolders("Desktop"
Set oShellLink = WshShell.CreateShortcut(strDesktop & "\" & tname & ".lnk"
oShellLink.TargetPath = tpath
oShellLink.WindowStyle = 1
oShellLink.Description = tname & " Shortcut"
oShellLink.WorkingDirectory = tdir
oShellLink.Save
End Sub