command-prompt

Stop MSBuild processing immediately on compilation errors

半城伤御伤魂 提交于 2020-01-01 08:57:26
问题 I have written a batch file, which when executed builds a visual studio solution. The solution comprises of few C# projects. I am using MSBuild utility for this. How can i stop the build from proceeding further when there are compilation errors in any of the projects? Further how can i get the error messages and display them on command prompt? 回答1: There's no support for stop on first failure when building a visual studio solution. You can workaround this by taking the following steps: Set

How do I get colour with Windows command prompt using RSpec in Ruby?

时间秒杀一切 提交于 2020-01-01 08:27:11
问题 In other o/s RSpec returns nicely coloured results (red, green etc). However in the windows (Vista) command prompt my text output is just plain old boring white. How can I bring colour to my RSpec test results? Thanks Evolve 回答1: UPDATE: Win32Console no longer works with rspec. ANSICON recommended. https://github.com/rspec/rspec-rails/issues/487#issuecomment-3556806 回答2: I had to install ansicon, and now everything is fine. (Even in my Aptana terminal). Install ansicon description: http:/

Qt - Wait for Qprocess to finish

别等时光非礼了梦想. 提交于 2020-01-01 03:14:23
问题 I'm using CMD by QProcess but I have a problem. My code: QProcess process; process.start("cmd.exe"); process.write ("del f:\\b.txt\n\r"); process.waitForFinished(); process.close(); When I don't pass an argument for waitForFinished() it waits for 30 secs. I want to terminate QProcess after CMD command is executed! Not much and not less! 回答1: You need to terminate the cmd.exe by sending exit command, otherwise it will wait for commands Here is my suggestion: QProcess process; process.start(

What are the consequences, if any, of multiple backslashes in Windows paths?

匆匆过客 提交于 2019-12-31 01:49:09
问题 In my programs I frequently have file names and/or paths that are configured in my app.config file. This will usually be something like: <add key="LogFileDirectory" value="C:\Logs" /> <add key="SaveLogFileTo" value="MyLogFile.txt" /> In my actual application code, I'll frequently concatenate these together with code similar to this: var logFile = ConfigurationManager.AppSettings["LogFileDirectory"] + @"\" + ConfigurationManager.AppSettings["SaveLogFileTo"]; Now, the result of the above code

How to get command prompt output in java?

怎甘沉沦 提交于 2019-12-30 10:56:58
问题 How to get the output of the command prompt which means i have opend a command prompt like this. Process process = Runtime.getRuntime().exec("cmd /c start cmd.exe /K \"C:\\Editor\\editorTemp.exe\""); i can not get the cmd output like this BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream())); String line = null; while ((line = br.readLine()) != null) { System.out.println(line); } So how can i get the command prompt output ? 回答1: This is not Java question.

what's the difference between command prompt and cmd?

坚强是说给别人听的谎言 提交于 2019-12-30 06:25:26
问题 I have Windows 7, Windows 8 and Windows 10 systems and they all behave similarly. When I type command prompt into the start menu and press enter, a window titled Command Prompt appears. I gave it a blue background and a green text. When I type start, cmd, or the name of a bat file into the command line, it opens up a window titled cmd, which I gave a background of black and a green text. It seems the colors get stored but... hmm... When I type cmd into the start menu of Windows 10, a Window

Java, Unicode, UTF-8, and Windows Command Prompt

人走茶凉 提交于 2019-12-30 04:01:05
问题 I have a jar file that is supposed to read a UTF-8 encoded file—that I wrote in a text editor under Windows—and display the characters to the screen. Under OS X and Linux this works flawlessly. I'm having a bit of trouble getting it to work under Windows though... I've defined a reader and writer like so: FileInputStream file = new FileInputStream(args[0]); InputStreamReader reader = new InputStreamReader(file, "UTF8"); PrintStream writer = new PrintStream(System.out, true, "UTF8"); I've also

“Error: Could not find or load main class My.class”

我们两清 提交于 2019-12-30 03:29:06
问题 Im using Java SDK 1.7 on Windows 7 via cmd.exe . Up until a few hours ago everything was working correctly when suddenly I was unable to run my compiled class files, consistently presented with the error in the title. I seem to be able to compile my My.java file however I am unable to run the resulting class file (My.class). I am constantly given the error "Error: Could not find or load main class My.class". I have tried this with multiple other class files all resulting in the same problem.

Running a .jar file in a command prompt from double click

别说谁变了你拦得住时间么 提交于 2019-12-29 08:32:16
问题 I'll start of by saying Im on windows 7. I have created a .jar file which executes fine from the command line using the - java -jar myJar.jar approach But what I'm after is to be able to double click on the jar file and for it to open up the command prompt window and run in the command prompt as if i've just typed the java -jar myJar.jar line. When I double click the jar file I do think it is running because a visual part of the java is appearing, but there is no command prompt window showing

Batch ERRORLEVEL ping response

限于喜欢 提交于 2019-12-29 04:45:25
问题 I'm trying to use a batch file to confirm a network connection using ping. I want to do batch run and then print if the ping was successful or not. The problem is that it always displays 'failure' when run as a batch. Here is the code: @echo off cls ping racer | find "Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)," if not errorlevel 1 set error=success if errorlevel 1 set error=failure cls echo Result: %error% pause 'racer' is the name of my computer. I'm having my computer ping itself