Replace an existing shortcut for all users
This feels like it should be so simple. But I think I must be doing something wrong.
I am trying to copy a shortcut from a network path to the public desktop folder on all of our desktops. I have tried the following scripts.
Both scripts are launched with
%WINDIR%\System32\cmd.exe
xcopy \\van.com\root\OUTBOX\*.* C:\Users\Public\Desktop /y
xcopy \\van.com\root\OUTBOX\*.* %userprofile%\Desktop /y
Can someone help me out. I am new to KBOX and don't understand what I am doing wrong.
Thank you!!
I am trying to copy a shortcut from a network path to the public desktop folder on all of our desktops. I have tried the following scripts.
Both scripts are launched with
%WINDIR%\System32\cmd.exe
xcopy \\van.com\root\OUTBOX\*.* C:\Users\Public\Desktop /y
xcopy \\van.com\root\OUTBOX\*.* %userprofile%\Desktop /y
Can someone help me out. I am new to KBOX and don't understand what I am doing wrong.
Thank you!!
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
snissen
13 years ago
Posted by:
tsg
13 years ago
Doesn't look like its that simple : (
I tried running the script with a /H switch. On the test computer the cmd prompt quickly flashes but no Icon is copied to the desktop.
Launch “%WINDIR%\System32\cmd.exe†with params “xcopy \\van.com\root\OUTBOX\*.* %userprofile%\Desktop /Y /Hâ€Â.
I ran this from an administrative cmd prompt on a test computer manually and it successfully copied the shortcut. It fails to copy through KBOX though.
I tried running the script with a /H switch. On the test computer the cmd prompt quickly flashes but no Icon is copied to the desktop.
Launch “%WINDIR%\System32\cmd.exe†with params “xcopy \\van.com\root\OUTBOX\*.* %userprofile%\Desktop /Y /Hâ€Â.
I ran this from an administrative cmd prompt on a test computer manually and it successfully copied the shortcut. It fails to copy through KBOX though.
Posted by:
dchristian
13 years ago
Posted by:
snissen
13 years ago
Any time you use the Launch program step with cmd.exe, your parms should start with /c like this:
cmd.exe /c xcopy ....
That switch means "run this one command line and then exit". If you forget the /c (I do all the time), your script appears to hang.
Or you can Launch program xcopy.exe directly.
Over the years, I have had problems copying shortcut .lnk files too, so I now create and edit them on the fly using the free Shortcut.exe utility from http://www.optimumx.com/downloads.html . (A colleague uses this free utility's shortcut command: http://www.nirsoft.net/utils/nircmd.html .) Sande
cmd.exe /c xcopy ....
That switch means "run this one command line and then exit". If you forget the /c (I do all the time), your script appears to hang.
Or you can Launch program xcopy.exe directly.
Over the years, I have had problems copying shortcut .lnk files too, so I now create and edit them on the fly using the free Shortcut.exe utility from http://www.optimumx.com/downloads.html . (A colleague uses this free utility's shortcut command: http://www.nirsoft.net/utils/nircmd.html .) Sande
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.