-3

What is the windows equivalent to "./filename"

So for example I would usually compile by doing something like:

gcc -c homework1.c gcc -o homework1 homework1.o

This would give me the executable names homework1 And for me to run the program, I would type: ( ./homework1 ) <-- ignore the parenthesis.

Usually I was write all my code in my schools Unix Shell thingy and I also compile it and run it there, but recently I think I took up all the disc space (because it says "disc quota exceeded").

Zeroguy
  • 1
  • 1
  • 1
  • Your other problem is going to be that gcc is not part of the windows distribution. So you will probably need to install a gcc toolchain on windows if it hasn't already been done for you. There are several options. See this previous question for details: http://stackoverflow.com/questions/6394755/how-to-install-gcc-on-windows-7-machine – Chris Becke Apr 23 '16 at 12:09

2 Answers2

1

Run cmd.exe

Go to where the program is example : cd C:\foder1\

Then type the program name with extension, for example : test1.exe or "test1.exe"

Sнаđошƒаӽ
  • 16,753
  • 12
  • 73
  • 90
Saef Myth
  • 143
  • 1
  • 2
  • 11
0

In windows (as in Linux) you can either run a program though a GUI interface or from a shell environment.

The GUI option is a program called Explorer, you navigate through the file system and double click executable files to run then. Executable typically have the extension '.exe' or '.bat', but there are others.

The shell environment in windows is called the 'command prompt', you can run it by going to the start menu and selecting 'run' or simply press the windows key and 'r' simultaneously. A box will popup, type 'cmd' (without the quotes) and hit enter - the command prompt should open. From there you can navigate the file system using commands like 'cd'. To run your executable type the name of the file (it should work with or without the '.exe'). A nice shortcut to open the command prompt already at a particular path, is to browse to the folder in Explorer, hold shift and then right-click the folder - the resulting context menu that pops up should have an option like 'open in command prompt'.

grae22
  • 104
  • 11