0

If we open a Command Prompt it will come like

"C:\Users\......> "

Then I am doing cd "D:\Proj\sfk\net\"

To go "D:\Proj\sfk\net\"> Then from there i am executing commands say commands.

If i have batch file , On click of that it should open automatically with that path then it will be easier..

I tried

START cmd /K "D:\Proj\sfk\net\"

START cmd.exe -- "cd D:\Proj\sfk\net\"

It's not working..

How to Achieve that ?

2

1 Answer 1

2

Put this at the top of the batch file :

cd /d %~dp0

It will change to the directory where the batch file resides.

If you must do it without touching the batch file, then start it like this :

cmd /k "cd /d d:\temp & mybat.bat"
Sign up to request clarification or add additional context in comments.

Comments

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.