简体   繁体   English

从.BAT文件中的另一个目录中打开.BAT文件

[英]Open a .BAT file in another directory from within a .BAT file

I have a .BAT file on my desktop that calls another .BAT file in the same location named MySQL: 我的桌面上有一个.BAT文件,该文件在名为MySQL的相同位置调用另一个.BAT文件:

start MySQL

pretty complicated right? 很复杂吧? How could I access this same file if it was in c:\\ProgramFiles? 如果该文件位于c:\\ ProgramFiles中,该如何访问? I know I need to first go up one directory, but I cannot for the life of me make it work. 我知道我需要首先进入一个目录,但是我无法一辈子都可以使用它。 I'm using windows 10 by the way. 我正在使用Windows 10。

You should do like this example : 您应该喜欢以下示例:

@echo off
CD /D "%Programfiles%\Mozilla FireFox\" 
Start "" Firefox.exe

and in your case it should be like this : 在您的情况下,应该是这样的:

@echo off
CD /D "%Programfiles%\Sqlfolder\" 
Start "" Mysql.exe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM