Discussion Locked

Create a shorcut from the line command

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
how to create a shorcut in the desktop from the line command ?

7 replies

by tmaclennan

You can copy a desktop shortcut onto a person's Win9x desktop like this:

copy example.lnk c:\windows\desktop

Remember that if you are using long filenames for the link, you must use the short filename equivalent for DOS.

by j.momier

I don't want to copy a shortcut (that doesn't work, it points to the .exe where I create the link ...), I want to CREATE a shortcut !

by tmaclennan

Well, as far as I know, you can't create a shortcut from the desktop. However, you can create a shortcut that points to a local batch file, and copy that .LNK file to the user's desktop, while creating a .BAT file from the command line. Creating a .BAT file from the command line can be done by typing this:
COPY CON TEST.BAT
Dir *.* (or whatever)
^Z
After typing a Control-Z, the batch file will be closed with a "1 file copied." message.
If you are creating the batch file using a batch file, you can just echo your lines into a .BAT:
echo dir *.* >TEST.bat
echo pause >>TEST.bat

This discussion is closed to new replies.