简体   繁体   English

批处理文件中的命令行?

[英]Command Line in Batch file?

I am making a batch file to automate mysql installation silently. 我正在制作一个批处理文件以静默地自动进行mysql安装。 When I type the following line in the command prompt everything works fine. 当我在命令提示符下键入以下行时,一切正常。

"C:\\Program Files\\MySQL\\MySQL Server 5.1\\bin\\mysqlinstanceconfig.exe" -i -q ServiceName="mydb" RootPassword="pos" ServerType=DEVELOPMENT DatabaseType=INNODB Port=3306 “ C:\\ Program Files \\ MySQL \\ MySQL Server 5.1 \\ bin \\ mysqlinstanceconfig.exe” -i -q ServiceName =“ mydb” RootPassword =“ pos” ServerType = DEVELOPMENT DatabaseType = INNODB端口= 3306

My question is: can I somehow add this to a batch file so it will run it as if I entered it in the command line? 我的问题是:我可以以某种方式将其添加到批处理文件中,以便它像在命令行中输入它一样运行吗?

Thanks, Matt 谢谢,马特

yes, its easy. 是的,很容易。 As Santa commented, just put your command inside some text file, change the extension of that file to .bat. 正如圣诞老人所说,只需将您的命令放在某个文本文件中,然后将该文件的扩展名更改为.bat。 Thats all !! 就这样 !!

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

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