Ben
Ben

Reputation: 57318

Run an EXE from a different directory?

After a bit of googling and searching here, couldn't find the answer to this silly question!

For a structure like this...

dirZero
|---dirOne
|---|---myProgram.exe

How do I run "myProgram" if my current directory is dirZero? I.E.,

C:\dirZero> dirOne/myProgram.exe

...which obviously doesn't work.

Upvotes: 69

Views: 109336

Answers (3)

pumamammal
pumamammal

Reputation: 61

probably u should just simple use

cd C:\dirZero\dirOne
C:\dirZero\dirOne> myProgram.exe

Upvotes: -6

Ruel
Ruel

Reputation: 15780

You should use a backslash \, instead of forward slash. /

C:\dirZero> dirOne\myProgram.exe

Or, wrap it with double quotes "

C:\dirZero> "dirOne/myProgram.exe"

Upvotes: 111

Preet Sangha
Preet Sangha

Reputation: 65555

Use a backslash instead

C:\dirZero> dirOne\myProgram.exe

Upvotes: 16

Related Questions