1.

Solve : .bat file to create desktop shortcut?

Answer»

Sorry, but it has been a long day, and my brain (apparently) is spent. I have created a file on our server and I want to send a .bat file to my employees that will create a desktop shortcut on their individual machines. Here is what I have tried:

xcopy s:\common\blah.lnk c:\docume~1\alluse~1\desktop\blah.lnk /y

and

xcopy s:\common\blah.lnk c:\docume~1\alluse~1\deskto~1\blah.lnk /y

I have also tried the copy from the s:\ drive using the actual file and copying it as a .lnk and that hasn't worked EITHER.

The file is actually a database, so I don't want to copy the file itself, just the link.

Thanks!!

By the WAY, our OS is XP if that makes a difference.
Maybe this will help:

CODE: [Select]xcopy s:\common\blah.lnk c:\docume~1\%username%\desktop\blah.lnk /y

Just curious, but why XCOPY? Would not COPY work just as well?

Hmm, I tried that and it didn't like it either. I think it has something to do with .lnk files. I've never tried doing this before with just the shortcut file. This database is only going to be used for about a month and I was hoping to get away from having to build installation files.

FYI, the only reason I used XCOPY instead of COPY is because of force of HABIT. Awhile back I had to set up a program to copy files across our WAN to keep a website updated and it wouldn't work with COPY. I switched to XCOPY and it worked and I have kind of been using it exclusively since then.As an FYI, I went the MSI route instead. If anyone does KNOW how to do what I originally asked about, I would be interested in knowing.

Thanks!
Maybe it would work with some " ".
So, try something like:
xcopy s:\common\blah.lnk "c:\docume~1\alluse~1\desktop\blah.lnk" /y
or
xcopy s:\common\blah.lnk "c:\documents and settings\all users\desktop" /y
Hmm, hadn't thought about using " "". Unfortunately, neither of those ways worked either. Thanks for the suggestion though!Oh, well... Maybe you need to tell us something else. Like: s: is a network share mapping? And question no 2: what error message do you receive?



Discussion

No Comment Found