简体   繁体   English

如何从bat文件读取cmd中的float?

[英]How to read float in cmd from bat file?

So all I need is just to read float from cmd input and run .exe file with this value 因此,我只需要从cmd输入读取float并使用此值运行.exe文件

This is bat file: 这是蝙蝠文件:

Set  /P /A  f =Input f: 
Project.exe %f%

But this doesnt work fot int values neither. 但这对int值都不起作用。 What should I change? 我应该改变什么?

You cannot use both options /A and /P with set command. 不能同时使用/A/P选项和set命令。 So, you need to modify your code, so it will look likt the following: 因此,您需要修改您的代码,因此看起来如下所示:

Set /P f=Input f: 
Project.exe %f%

Space between set and /P option and f and = was removed as it was not needed. set/P选项与f=之间的空间已删除,因为它不需要。

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

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