8

For example, i want to run cygwin.bat which is located in the c:/cygwin/ directory...

I tried the following but got an error:

cd c:/cygwin ./cygwin.bat

2
  • thank you, i m aware that it can be done in two lines seperately, i was just wondering if and how it can be run on a single line ... I am starting to learn powershell btw so thats the shell im using. Commented Sep 17, 2013 at 19:48
  • See my answer, I expanded it from my comment with an example for the behavior you're interested in. Commented Sep 17, 2013 at 19:49

3 Answers 3

13

cd c:/cygwin and ./cygwin.bat are two different statements. You can execute them from the interactive console like so:

PS C:\>       cd c:/cygwin 
PS C:\cygwin> ./cygwin.bat

Or, if you really want to do it on the same line, then use a ; between them to indicate separate statements.

cd c:/cygwin ; ./cygwin.bat
Sign up to request clarification or add additional context in comments.

Comments

4

best way is the way its always been

c:\cygwin\cygwin.bat

it's all you need to type

1 Comment

How the **** didn't i think of that...haha. probably cause i thought i could only run a file by typing " ./ " in front of it..Thank you
0

Try iex

$command = "cd c:/cywin"
iex $command

1 Comment

thanks for the answer , but i actually want to run cygwin.bat in the cygwin folder... your command only seems to redirect me from my home path to the cygwin path just like using : cd c:/cygwin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.