Create shortcut using batch file??
Results 1 to 8 of 8

Thread: Create shortcut using batch file??

  1. #1
    Join Date
    Jan 2000
    Posts
    51

    Create shortcut using batch file??

    Hey how do you run a batch file that will allow it to create shortcuts in peoples desktops or anywhere on their machines?

  2. #2
    Join Date
    Jan 2000
    Location
    Pittsburgh, PA USA
    Posts
    2,053
    Hey,
    Interesting question...My limited knowledge tells me that a batch file (a DOS utility)can only manipulate files, text, *.exe files and other batch files. I do not believe that they can have any effect on the GUI (Graphic User Interface). Since they are 2 different entities.

    Others will know more.
    Good Luck,
    Dave


    ------------------
    Is V.Dr. a great site, or what??

    Windows Tips *** Help others less fortunate *** Thought For Today
    *** Help others less fortunate.

    JESUS IS LORD !

  3. #3
    Join Date
    Jan 2000
    Posts
    168
    The following is what the contents of a shortcut on the desktop looks like in note pad.
    As you can see there is some machine code followed by text that describes the target.
    This includes the the name of the drive volume (PROMISE) and the path to the program.

    -------
    L  À F_ ÀžØ¥ ¢¿ ˆ(u*¡¿ µ¦ ¢¿   ¼  *OÐ ê:i¢Ø +00 #C:\ ñÍ% 1 Z&³¨ Program Files PROGRA~1 1 [&, Netscape NETSCAPE " 1 ‰(3A Netscape 6 NETSCA~1 & 2  ‰(MF netscp6.exe NETSCP6.EXE f    4  #Ce   ça1 PROMISE C:\Program Files\Netscape\Netscape 6\netscp6.exe
    Netscape 63 ..\..\Program Files\Netscape\Netscape 6\netscp6.exe$ C:\Program Files\Netscape\Netscape 60 C:\Program Files\Netscape\Netscape 6\netscp6.exe
    -------
    shortcuts have an extention *.lnk

    I suppose you could write a batch that would copy a *.lnk to the proper directory on a destination drive, but as you can see the path is specific to my drive (PROMISE).

    mrbreaker
    Getting the job done right the third time scince 1980

  4. #4
    Join Date
    Jul 2000
    Location
    Finland
    Posts
    165
    Hello,

    Here's one tip:

    echo C:\WINDOWS\notepad.exe>C:\WINDOWS\Desktop\startnotepad.bat

    The bad thing in this is that a MS-DOS -windows stays hanging in the backround.

  5. #5
    Join Date
    Jan 2000
    Posts
    51
    Hey here is a link i found about this problem of mine:
    http://www.ntfaq.com/Faq.cfm?FaqID=191

    I just couldn't find the program 'shortcut.exe' cause I dont have a resource kit. If anyone has it, can they email it to me? I'd really appreciate it. thanks! [email protected]

  6. #6
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    Windows 95 Users

    The SHORTCUT.EXE program is available on the Windows 95 CD in the
    • \ADMIN\APPTOOLS\ENVVARS
    directory (folder). To install it into your
    • C:\WINDOWS\COMMAND
    directory, insert your Windows 95 CD into your CD-ROM drive and then type the following command at any DOS prompt. (Note: Make sure you replace the "X:" with the correct drive letter for your CD-ROM drive).
    Code:
    copy X:\admin\apptools\envvars\shortcut.exe c:\windows\command
    Windows 98 Users

    The SHORTCUT.EXE program is not included on the Windows 98 CD. However, it is contained within the self-extracting ENVARS.EXE file which is available for download directly from Microsoft. To install it, click here to download ENVARS.EXE (44,542 bytes) and then save it directly into your
    • C:\WINDOWS\COMMAND
    directory (folder). When the download has finished, (which shouldn't take but a few seconds), get to any DOS prompt and type the following four commands:
    Code:
    c:
    cd\windows\command
    echo y|envars -o shortcut.exe
    del envars.exe
    Windows NT Users

    Your version of SHORTCUT.EXE is different. You should NOT try to use the Windows 9x version.

    Windows 9x Users

    To see the brief help included with SHORTCUT.EXE, type the following command at any DOS prompt:
    Code:
    shortcut /?
    As an example of how to use it, let's say:
    1. You have SOL.EXE (the Windows Solitaire card game) in your

      • C:\WINDOWS

      directory. (You can check by typing
      Code:
      dir c:\windows\sol.exe
      at any DOS prompt).
    2. You want to name the shortcut Solitaire
    The three DOS commands needed would then be:
    Code:
    c:
    cd\windows\desktop
    shortcut -f -t c:\windows\sol.exe -n Solitaire.lnk -d c:\windows
    If you like you can go ahead and check your new shortcut while you're still in DOS with the following command:
    Code:
    start c:\windows\desktop\solitaire.lnk
    That's all there is to it. Type
    Code:
    exit
    to return to Windows.
    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

  7. #7
    Join Date
    Jan 2000
    Posts
    51
    I still couldn't find shortcut.exe on technet CDs I have the Resource kit 4.0 utilities but its not there. I tried doing a search as well as installing the resource kit. Im sure the shortcut.exe is not that big, so is it possible if you guys/gals can send me a copy? Email at [email protected] Thanks alot for your help.

  8. #8
    Join Date
    Feb 2000
    Location
    26.03°N 80.14°W
    Posts
    9,410
    You must have missed the link in my above response. Here it is again in URL form:

    http://download.microsoft.com/downlo...-US/envars.exe
    Vernon Frazee, Microsoft MVP (Windows - Shell/User)

    Defenses Up!
    Tip: When prompted for a password, give an incorrect one first. A phishing site will accept it; a legitimate one won't.


    Inside Spyware: A Guide to Finding, Removing and Preventing Online Pests


    If you don't keep up with security fixes, your computer|network won't be yours for long.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •