Tag: cmd

asynchronous运行Windowsbatch file命令

说,如果我有 foo.exe的 bar.exe baz.exe 我如何从一个batch file中asynchronous运行它们,即不等待之前的程序停止?

捕获输出命令CMD

平台Windows XP 当写一个命令文件(.bat)时,我怎样才能将命令的输出“捕捉”到一个variables中? 我想要做这样的事情 SET CR='dir /tw /-c b.bat | findstr /B "[0-9]"' 但是这不起作用 问候Stefan PS不,我不能下载grep,cygwin或任何其他软件,它必须是CMD DS

批处理:如何在parsing输出时纠正variables覆盖不当行为

在batch file中,我正在检查Baseboard信息,其中包含以下内容: BaseboardCheck.cmd @echo off setlocal enabledelayedexpansion for /f "tokens=1,2* delims==" %%a in ('wmic baseboard get /format:list') DO ( if ["%%a"] EQU ["Product"] ( set PlatformInfo=%%b if defined PlatformInfo ( echo.!PlatformInfo! echo.!PlatformInfo!This overwrites the variable ) ) if ["%%a"] EQU ["Version"] ( set BaseboardVersion=%%b if defined BaseboardVersion ( echo.!BaseboardVersion! echo.!BaseboardVersion!This overwrites the variable ) ) […]

通过外部应用程序调用一个函数,而无需打开一个新的Matlab实例

有没有办法从外部调用Matlab函数,特别是通过Windows cmd (也包括Linuxterminal,LUA脚本等),而不是每次都打开Matlab的新实例? 例如在cmd : matlab -sd myCurrentDirectory -r "function(parameters)" -nodesktop -nosplash -nojvm 打开一个Matlab的新实例相对较快,并执行我的function。 打开和closures这个简化的matlab提示大约需要2秒钟(没有计算) – 因此4000次执行超过2小时。 我想避免这一点,因为被调用的函数总是位于同一个工作区。 总是可以在同一个实例中完成吗? 我已经做了一些研究,发现了MATLAB COM自动化服务器的可能性,但是对我来说似乎相当复杂,而且我没有看到使它适用于我的情况的基本步骤。 任何build议呢? 我不熟悉c/c++/c#但我正在考虑使用python (但在最坏的情况下)。

尝试构buildCordova应用程序(event.js:85)时获取“spawn cmd ENOENT”

当我尝试构build(模拟)Cordova应用程序时,在Windows cmd中获取此错误。 D:\dev\Cordova\toDoList>cordova build android Running command: D:\dev\Cordova\toDoList\platforms\android\cordova\build.bat events.js:85 throw er; // Unhandled 'error' event ^ Error: spawn cmd ENOENT at exports._errnoException (util.js:746:11) at Process.ChildProcess._handle.onexit (child_process.js:1046:32) at child_process.js:1137:20 at process._tickCallback (node.js:355:11) ERROR building one of the platforms: Error: D:\dev\Cordova\toDoList\platforms\android\cordova\build.bat: Command failed with exit code 1 You may not have the required environment or OS to […]

窗口批量设置里面如果不工作

当我运行这个脚本(从一个.bat文件): set var1=true if "%var1%"=="true" ( set var2=myvalue echo %var2% ) 我总是得到: ECHO is on. 这意味着var2variables没有真正设置。 任何人都可以请帮我理解为什么?

在Windows上设置Python不要在cmd中键入python

我如何configuration,以便我不必在Windows上inputpython script.py而只需在CMD中inputpython script.py ? 我将我的python目录添加到包含python.exe的%PATH%中,但仍然无法正确运行脚本。 我试过用django-admin.py运行django-admin.py startproject mysite给我inputType 'django-admin.py help <subcommand>' for help on a specific subcommand. 在它前面使用python正确处理命令。 这里有什么问题?

启动一个Windows服务并启动cmd

我是否需要启用交互式desktp才能正常工作,以及启动EXE或cmd窗口的正确代码是什么? 即使启用它与桌面交互,我仍然无法启动服务。 我会使用一个聊天引擎,所以作为一个Windows服务来pipe理更容易。 我的代码有什么问题? using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceProcess; using System.Diagnostics; using System.ComponentModel; using System.Threading; namespace MyNewService { class Program : ServiceBase { static void Main(string[] args) { } public Program() { this.ServiceName = "Chatter"; } protected override void OnStart(string[] args) { base.OnStart(args); //TODO: place your start code here ThreadStart […]

如何并行运行多个DOS命令?

如何运行多个dos命令? 我有一个for循环,运行检测服务器来检测哪个服务器工作,并且是快速的。 而且因为有更多的服务器,我不希望按顺序运行所有服务器检测,而是并行运行。

多台设备连接时如何使用ADB Shell? 因“错误:多个设备和模拟器”失败

>adb –help … -s <specific device> – directs command to the device or emulator with the given serial number or qualifier. Overrides ANDROID_SERIAL environment variable. … >adb devices List of devices attached emulator-5554 device 7f1c864e device … >adb shell -s 7f1c864e error: more than one device and emulator ?