how do I set up a shortcut to execute a 'dos command'?

By drumtrucker
Feb 6, 2004
  1. would like to set up a desktop icon to execute a command at the dos prompt:


    Anybody know?
  2. Spike

    Spike TS Evangelist Posts: 2,168

    Fire up notepad, and do this

     @echo off
    %1 %2 %3 %4 %5 %6 %7 %8 %9
    ping <enter domain name here>

    Save the file as ping_yahoo.bat, or your chosen name.

    Double clicking it should ping yahoo.
  3. Nodsu

    Nodsu TS Rookie Posts: 5,837

    Right click on desktop, New->Shortcut
    In the first window put "ping", in the second one put the name you want the shortcut to have.
  4. Spike

    Spike TS Evangelist Posts: 2,168

    That's true, and a lot easier.

    Try that first. If it doesn't hold the window open, try mine.

    Why must I always do things the hard way!?!? lol <it comes from forgetting or not knowing the easyway I think!>
  5. drumtrucker

    drumtrucker TS Rookie Topic Starter Posts: 37

    cool, both work

    I had sort of already figured out a version of spikes, made a batch file in c:\ and made a short cut to point to it.

    But Nodsus method pretty cool, not intuitive, but slick, and lets me assign a icon, because it is still a shortcut.

    BTW, I used to know a way to make the little shortcut arrow not appear on the icon, back in 98 days. can that still be done?

    thanks guys
  6. Spike

    Spike TS Evangelist Posts: 2,168

    yes it can. It's a simple registry tweak I think.

    Try the 98 way and see if it works.
  7. Justin

    Justin TS Rookie Posts: 942

    drumtucker: Download TweakUI for Windows XP. It is part of the PowerToys for XP suite. The option to remove the arrow from shortcuts as well as a million other useful registry tweaks are available to you there easily.

    * Note: substitute for Windows 2000 if you are using such.
  8. RealBlackStuff

    RealBlackStuff TS Rookie Posts: 6,503

  9. Nodsu

    Nodsu TS Rookie Posts: 5,837

    Delete HKCR\Lnkfile\IsShortcut value to remove the arrow on Windows shortcuts. I hope you are aware that doing this is a security risk?
  10. Spike

    Spike TS Evangelist Posts: 2,168

    Removing the shortcut arrow is a security risk? I didn't know that. How come?
  11. Nodsu

    Nodsu TS Rookie Posts: 5,837

    Because I could make a shortcut that is called "My Computer", has the appropriate icon, sits on your desktop and actually points to "format /y c:". Without the arrow you would double click that thing without a second thought.
  12. Spike

    Spike TS Evangelist Posts: 2,168

    lol. I didn't think about that!

    Talk about forgetting the obvious! lol. I haven't had a good attempt at an amateur hack on my pc for ages. Could be the active response I suppose. If they get caught they get completely sut out from that IP for 10 minutes. :) Not to say it won't happen though.
Topic Status:
Not open for further replies.

Similar Topics

Create an account or login to comment

You need to be a member in order to leave a comment
TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...

Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.