Re: Copy shortcut to desktop in a batch file
- From: "Terry R." <F1Com@xxxxxxxxxxxxxxx>
- Date: Mon, 21 Jul 2008 20:30:21 -0700
The date and time was 7/21/2008 11:40 AM, and on a whim, Pegasus (MVP) pounded out on the keyboard:
Instead of writing
copy XXX.lnk "%allusersprofile\desktop", try this:
copy /y XXX.lnk "%allusersprofile%\desktop"
You'll notice the missing "%". The "/y" switch will ensure
that there will be no prompt in case the file already exists.
Furthermore, to make your batch file robust, add the full path
to your source file, e.g. like so:
xcopy /y /d "U:\Some Folder\XXX.lnk" "%allusersprofile%\desktop"
Using xcopy.exe with the /d switch will prevent mindless
copying of the same file each time the use command is
invoked.
"Diane Walker" <ett9300@xxxxxxxxx> wrote in message news:%23djR3r16IHA.4292@xxxxxxxxxxxxxxxxxxxxxxxThank you very much all for your prompt response.
The batch file is
copy XXX.lnk "%allusersprofile\desktop"
The error message said "file not found". I interpret that the batch file cannot find "XXX.lnk" file even though the shortcut "XXX.lnk" does exist. Please let me know if you need additional information. Thanks.
"Pegasus (MVP)" <I.can@xxxxxxxxxx> wrote in message news:%23%23XQke16IHA.1460@xxxxxxxxxxxxxxxxxxxxxxx"Diane Walker" <ett9300@xxxxxxxxx> wrote in message news:OLwC$w06IHA.1196@xxxxxxxxxxxxxxxxxxxxxxxI use Installshield software to setup the executable file to install the software. In that executable file, I setup a batch file to copy a shortcut to the desktop. The executable file ran successfully. However, the shortcut was not copied to the desktop. I got the error message "File not found" for the shortcut command. Do you have any suggestions? Thanks.Let's have a look at your batch file!
Sorry Pegasus, I didn't see that you also suggested adding the path to the source when I replied to Diane.
--
Terry R.
***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
.
- References:
- Copy shortcut to desktop in a batch file
- From: Diane Walker
- Re: Copy shortcut to desktop in a batch file
- From: Pegasus \(MVP\)
- Re: Copy shortcut to desktop in a batch file
- From: Diane Walker
- Re: Copy shortcut to desktop in a batch file
- From: Pegasus \(MVP\)
- Copy shortcut to desktop in a batch file
- Prev by Date: Re: Copy shortcut to desktop in a batch file
- Next by Date: Re: How to be prompted for SATA drivers during installation?
- Previous by thread: Re: Copy shortcut to desktop in a batch file
- Next by thread: How do you restore if your hard drive crashes?
- Index(es):
Relevant Pages
|