Command Line: Upload with "Arduino as ISP"

Hello

I´m writing a java program to upload a sketch which should be used by a person without any experience in this field. Till now the command line looked like this:

String command = “C://…/Arduino/arduino.exe --upload C://…/name/name.ino”;
Process pr = Runtime.getRuntime().exec(command);

While only one Arduino Board (Uno) is connected with the computer. But my problem is that now i need to upload using programmer (Arduino as ISP).

My question is: With the first command I did never selected a COM-Port. Did the --upload command automatically searched for it (remember only one Arduino board is connected) or did it only use the one in the preferences.txt file and it was always the correct one? Is it possible to use the following command line to upload using programmer while I don’t know the COM-Port:

C://…/Arduino/arduino.exe --upload C://…/name/name.ino --pref programmer=arduino:arduinoasisp

Greetings^^ btw i hope my english is not too bad