Hello, I'm a newbye in here and I would like to know how to run a command, when in a cmd.exe window in vista, without to go first in the directory where that command is located.

In other words, when I run cmd.exe it opens up in a default directory and some command cannot be run from there; only if I go to the directory where that command is located the command can run.

How that command may be run from any directory? I mean what have to be edit to get that please?


Cypherinfo.

Recommended Answers

All 4 Replies

If you are trying to run program1.exe (example) located in d:\programdir you have to add d:\programdir to the path variable. You can do this by rightclicking on computer then properties -> advanced system settings -> advanced -> environment variables. Make sure that you separate it by the entry in front of it by a semicolon. Now you should be able to type program1 in cmd.

I'm not fully sure what you're looking for.

If you browse in Windows Explorer to the folder where the program you want to run is located, shift+right-click and choose Open Command Window Here. You then are in a command window at that folder.

If you want to be able to open a command window directly, and be somewhere other than your home folder ( Users\your_user_name), you can create a shortcut to cmd.exe and change the Start In folder location.

Or even more simply you can just click

Start->run->cmd (click enter). Then the command window will open. From there lets say you are in the directory C:\Users\Kyle. Typing "cd .\Documents" will take you to the C:\Users\Kyle\Documents directory.

Short answer: use the "cd" command to change directory.

Or even more simply you can just click

Start->run->cmd (click enter). Then the command window will open. From there lets say you are in the directory C:\Users\Kyle. Typing "cd .\Documents" will take you to the C:\Users\Kyle\Documents directory.

Short answer: use the "cd" command to change directory.

Thank you all. Great community here! :-) To tell the truth the solution to make global the command folder is the best one for me. The point is: how ever that folder: c:\windows\system32 was not in the path variable after the vista installation?

I mean, after an installation, by default it has to be there or not?


Cypherinfo.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.