One of my users is wanting to have a program called Assembly Planner added to the App Store.  This particular program does not have an installer.  Instead, you copy the folder in it's entirety to the c drive of the computer.  You then create a shortcut to the executable and place it on the desktop.  I can successfully copy the folder to the C drive by using the batch file below.  However, I haven't quite figured out how to create the shortcut once it's been copied.  I've tried creating the shortcut and placing it in the source folder for the copy and using a second batch file to copy it to the desktop, but the second batch job never seems to kick off.  I've checked out the shortcut wizard, but I don't want the users to have to click on two different installs.  Here is what my setup looks like.  Any help is appreciated.

 

Answer Summary:
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

0

I'm not familiar with using KACE but I see no need to create a second batch file to copy the shortcut, just add a second line to copy the shortcut to the first batch file. Are you sure the second batch file isn't running? I can't see the full text of it but if you're trying to copy something you should start the batch with the command copy not just the file paths.

If that option doesn't work I've always used vbscript to create shortcuts, Example:

set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("AllUsersDesktop")
set oShellLink = WshShell.CreateShortcut(strDesktop & "\programName.lnk")
oShellLink.TargetPath = "path to executable"
oShellLink.WindowStyle = 1
oShellLink.IconLocation = "path to executable,0"
oShellLink.Description = "program name"
oShellLink.WorkingDirectory = "folder executable is in"
oShellLink.Save
 
You could create this vbs (replaceing the text in italic to the proper values), save it to a network drive then call it from your batch. This method has always worked for me. Unfortunately the batch language isn't sophisticated enough to create a shortcut (at least I've never been able to get it to work)
 
Hope this is helpful
Answered 06/08/2014 by: titusr
Senior White Belt

Please log in to comment
0

put the link the the source folder and add xcopy \\source\*.LNK C:\Users\Public\Desktop as a scond line of the first batch file

Answered 06/09/2014 by: SMal.tmcc
Red Belt

Please log in to comment
0

You can create a shortcut by using mklink like this:   mklink "Path to shortcut" "Path to exe file"

This can be useful in cases where you can't use SMal.tmcc's solution.. (when deploying to several users and the target path is located somewhere in the %userprofile% structure)


example:

mklink "%userprofile%\desktop\NewLinkName" "c:\%userprofile%\Appdata\Roaming\Program\Executable.exe"

Answered 06/12/2014 by: roal
White Belt

Please log in to comment
0
Thanks guys.  I was finally able to get it up and running.  I created one batch file that did both jobs and that seems to have corrected my problem.
Answered 06/12/2014 by: nick.hobbs
Senior White Belt

Please log in to comment
Answer this question or Comment on this question for clarity