/build/static/layout/Breadcrumb_cap_w.png

SCRIPT TO COPY A SHORTCUT

hello all i have this script to copy a shortcut to a desktop for some reason this script refuse to work right. that script work on one workstation when i try to push out i am not getting any results

'===========
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set objProcess = objShell.Environment("Process")
strDesktop = objProcess.Item("UserProfile") & "\Desktop\"
boolOverwrite = False
objFSO.CopyFile "\\server\share\shortcut.lnk", strDesktop, boolOverwrite
'==========

 

 

 


0 Comments   [ + ] Show comments

Answers (4)

Posted by: jknox 12 years ago
Red Belt
1

The easiest way I have found to get shortcuts deployed is to use a K1000 script.

  1. Create the shortcut and zip it up.
  2. Upload it to the script as a dependency.
  3. Have the script unzip it into place. (e.g. C:\Users\Public\Desktop\ for Win7)
Posted by: ms01ak 12 years ago
10th Degree Black Belt
0

Try running it as online script, and set the logged as option of the script as run As User logged in to console (aka run as the user who's logged into the desktop).

otherwise if you don't have those set it will run as the local system.


Another option would be to set up a file synchronization that unzips a the shortcuts to the all users folder desktop (or in Windows 7 public's desktop)



Comments:
Posted by: Arminius 12 years ago
Second Degree Green Belt
0

If you're pushing via SCCM, unless you've set it to run in the user space, it's copying the shortcut to the system space.  so somehow system's desktop is getting that shortcut.  A good test of any script that will be pushed out is to launch it via PsExec and see what happens.

Posted by: StockTrader 12 years ago
Red Belt
0

Hello,

 

try to dump the strDesktop variable to a file so you can see if gets valorized correctly.

Maybe the scrips works as a real logged in user but does not work fine as localsystem so dumpig the variable you will be able to debug further.

 Regards,

StockTrader

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ