ProgrammingUsing Command Prompt to make a pathway.
Posted:

ProgrammingUsing Command Prompt to make a pathway.Posted:

Yolo
  • Christmas!
Status: Offline
Joined: Jan 13, 201311Year Member
Posts: 541
Reputation Power: 28
Status: Offline
Joined: Jan 13, 201311Year Member
Posts: 541
Reputation Power: 28
Alright so say I have a folder on my D: drive instead of my C: drive. For an example well say the folder is called junk. When I go Into command prompt I want to stay in my C drive but be able to have access to the junk folder when I type the command "cd junk" into the command prompt. As is now If I search for junk in the cmd prompt will say the system cannot find the path specified. any help would be much appreciated
#2. Posted:
Imp
  • Shoutbox Hero
Status: Offline
Joined: Jan 01, 201113Year Member
Posts: 1,957
Reputation Power: 401
Status: Offline
Joined: Jan 01, 201113Year Member
Posts: 1,957
Reputation Power: 401
It really depends on what you want to do with the files in the "junk" folder....

If you have executables in that folder, then you could add the "junk" folder to the Environment Variables "Path" entry...

So if you have an EXE like D:\junk\junk.exe

If you add "d:\junk" into the PATH Environment Variable, you can run junk.exe by just typing it in the command prompt, while you are in C:

Could you give examples of what you have in the folder and what you need to do with them?
#3. Posted:
Yolo
  • Christmas!
Status: Offline
Joined: Jan 13, 201311Year Member
Posts: 541
Reputation Power: 28
Status: Offline
Joined: Jan 13, 201311Year Member
Posts: 541
Reputation Power: 28
Imp wrote It really depends on what you want to do with the files in the "junk" folder....

If you have executables in that folder, then you could add the "junk" folder to the Environment Variables "Path" entry...

So if you have an EXE like D:\junk\junk.exe

If you add "d:\junk" into the PATH Environment Variable, you can run junk.exe by just typing it in the command prompt, while you are in C:

Could you give examples of what you have in the folder and what you need to do with them?
Alright so in my computer science class we have gcc.exe in a different drive than our file that we are working on that we want to compile. So our teacher when we search gcc nothing comes up because the computer doenst know the search path. i need to know how to set a address like you said with the D:junk/junk.exe . all i remember from class was at the end of the command it had %PATH% but after he put in the path his was able to type gcc and it would get the compiler.
#4. Posted:
Imp
  • Retired Staff
Status: Offline
Joined: Jan 01, 201113Year Member
Posts: 1,957
Reputation Power: 401
Status: Offline
Joined: Jan 01, 201113Year Member
Posts: 1,957
Reputation Power: 401
Just browsing around, there is are specific Environment Variables that can affect GCC

https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html

If you need to just type GCC from anywhere, then you can use the below to set the PATH variable

Windows 10 and Windows 8

In Search, search for and then select: System (Control Panel)

  • Click the Advanced system settings link.
  • Click Environment Variables. In the section System Variables, find the PATH environment variable and select it.
  • Click Edit. If the PATH environment variable does not exist, click New.
  • In the Edit System Variable (or New System Variable) window, Enter the path of the GCC.exe.
  • Click OK. Close all remaining windows by clicking OK.
  • Reopen Command prompt window, and run GCC.


Windows 7

From the desktop, right click the Computer icon.

  • Choose Properties from the context menu.
  • Click the Advanced system settings link.
  • Click Environment Variables. In the section System Variables, find the PATH environment variable and select it.
  • Click Edit. If the PATH environment variable does not exist, click New.
  • In the Edit System Variable (or New System Variable) window, Enter the path of the GCC.exe
  • Click OK. Close all remaining windows by clicking OK.
  • Reopen Command prompt window, and run GCC.


This should do the trick for you.
#5. Posted:
CriticaI
  • Summer 2023
Status: Offline
Joined: Nov 05, 201311Year Member
Posts: 2,753
Reputation Power: 452
Status: Offline
Joined: Nov 05, 201311Year Member
Posts: 2,753
Reputation Power: 452
This is a late reply but couldn't you create a shortcut on the C drive then change directories into the shortcut?
Users browsing this topic: None
Jump to:


RECENT POSTS

HOT TOPICS