2

Since I dont have hyper threading option in the BIOS I am gonna disable it by launching

start /affinity 01010101

like here

The problem is that I would like to run a java program with that option but I cant make it

C:\Users\gbarbieri>start /affinity 01010101 "C:\Program Files\Java\jdk1.7.0_71\j
re\bin\java.exe" -jar D:\Documents\NetBeansProjects\EC_400_BETA\dist\EC_400_BETA
.jar
Die Datei "-jar" kann nicht gefunden werden.(= -jar cannot be found)

I tried include -jar in the '', include also the .jar, but nothing..

So how do I set affinity running a jar from console?

Community
  • 1
  • 1
elect
  • 6,765
  • 10
  • 53
  • 119
  • possible duplicate of [Using the DOS "start" command with parameters passed to the started program](http://stackoverflow.com/questions/154075/using-the-dos-start-command-with-parameters-passed-to-the-started-program) – Erwin Bolwidt Oct 28 '14 at 12:18
  • I think the question I linked above in the duplicate comment explains for you what the problem is and how to solve it (using double quotes with the windows `start` command has a special meaning, so you should first have empty double quotes if you need to use double quotes in the command name) – Erwin Bolwidt Oct 28 '14 at 12:19
  • 1
    It seems working, if u wanna answer I will accept it, @ErwinBolwidt – elect Oct 28 '14 at 12:28

1 Answers1

0

This should be marked as a duplicate of Using the "start" command with parameters passed to the started program . However, I only found out that there was a another question with the right solution after finding out why the OP's command line didn't work.

The problem is that the Windows start command treats the first argument in double quotes specially. It treats it as the title to display in the command prompt window. (See the Microsoft documentation)

The work around is to provide a title explicitly before providing a command name that needs double quotes (such as any command inside c:\Program Files\ because of the space in that path name)

This could just be an empty title, like this:

C:\Users\gbarbieri>start "" /affinity 01010101 "C:\Program Files\Java\jdk1.7.0_71\j
re\bin\java.exe" -jar D:\Documents\NetBeansProjects\EC_400_BETA\dist\EC_400_BETA
.jar
Community
  • 1
  • 1
Erwin Bolwidt
  • 30,799
  • 15
  • 56
  • 79
  • @elect It looks like the start command doesn't care where you put the first double-quoted argument (before, after or in between options) – Erwin Bolwidt Oct 28 '14 at 13:05