Jump to content

Recommended Posts

Posted

In Linux, we can open a terminal and run a command by simply typing in the command's name. So, if I wanted to run DosBox, I'd just type: dosbox

The $PATH environment variable is set to /bin,/sbin,/usr/bin,/usr/local/bin,/usr/local/games. And Linux looks in all of those directories for the executable.

However, in Windows, one must type the full path of the executable. So, typing: C:\Program Files (x86)\DOSBox-0.74\DOSBox.exe

would run DosBox. Is there an easy way to run programs from Command Prompt without having to type all of this?


Posted

In Linux, we can open a terminal and run a command by simply typing in the command's name. So, if I wanted to run DosBox, I'd just type: dosbox

The $PATH environment variable is set to /bin,/sbin,/usr/bin,/usr/local/bin,/usr/local/games. And Linux looks in all of those directories for the executable.

However, in Windows, one must type the full path of the executable. So, typing: C:\Program Files (x86)\DOSBox-0.74\DOSBox.exe

would run DosBox. Is there an easy way to run programs from Command Prompt without having to type all of this?

In Windows (and DOS) we have a variable called PATH:

http://en.wikipedia.org/wiki/PATH_(variable)

http://www.robvanderwoude.com/path.php

jaclaz

Posted

OK, so the PATH environment variable does exist in DOS/Windows. That's great. This is a bit off-topic, but what's the easiest way to create a symlink in Windows?

Posted (edited)

A symlink or a hardlink?

I presume you want to make a hardlink to the dosbox.exe inside one of the paths already inside the PATH variable?

But this would be possible (as well as symbolic links) only on a NTFS volume.

See:

http://schinagl.priv.at/nt/ln/ln.html

But you can use a "normal" .lnk file on *any* filesystem, if I recall correctly.

jaclaz

Edited by jaclaz
Posted (edited)

No, I wasn't going to use it for that, but actually, that might be a good idea -- making a C:\bin folder, adding it to PATH, and placing symlinks in it for programs I need a lot.

Anyway, what I meant by symlink was a soft symbolic link. (http://en.wikipedia.org/wiki/Symbolic_link) The *nix equivalent is ln -s. Oh, well I guess I found the answer myself. The mklink command does what I want.

.lnk files are Windows specific desktop shortcut files, but yes, they can be used on any filesystem.

Edited by CamTron

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...