0

I want to start a batch file in a certain location. I tried start /d C:\Windows C:\Windows\branding\readWin..bat The batch file which launches this in on my desktop. Any way to do this?

Thanks.

2
  • Where is excatly the location of your batch file ? Commented May 30, 2017 at 23:40
  • It is on C:\Windows\branding\readWin..bat. Commented Jun 5, 2017 at 18:33

2 Answers 2

1

I'm not sure exactly what you mean. You shouldn't need to change the current/start-in directory before invoking a script. If that script needs to define its working directory it should do so within.

If that's the case then just enter the full or relative batch file name:

"C:\Windows\branding\readWin..bat" 

If the batch file you're wanting to invoke does not define its own current directory and you feel it's necessary then you could be sure by defining it yourself first:

CD /D "C:\Windows" 

Or:

PushD "C:\Windows" 

After that just run your batch file using its full or relative path as previously mentioned.

Sign up to request clarification or add additional context in comments.

Comments

0

Are you running this from command prompt?

start /d "path" file.bat 

The quotes around the file path are important, and just the file name follows the path.

2 Comments

I should point out that start considers the first set of quotes that it encounters to be what it thinks you want to set the command prompt window to, regardless of where the quotes are actually located. Stick another set of quotes in there to get around that, like this: start "" /d "path" file.bat
When I try that, I get a new cmd window with no title, and it says "file.bat" is not an executable program, etc.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.