xslt - Java can't run cmd-command's properly -


i attempting generate list of installed programs on windows machine.

this command using:

wmic /output:d:\miep product name && type d:\miep > d:\miep_ 

you might have realized i'm trying make type-command need output in utf-8.

i made whitelist simple loop later in file names appear , keep them while remove else.

the command works in command prompt, when try same inside java program keeps telling me i've got invalid get-expression ...

here function:

void createlists() throws ioexception {     //string cmd = "wmic /output:d:\\miep.csv product name /format:\"%windir%\\system32\\wbem\\de-de\\csv.xsl\"";     string cmd = "wmic /output:d:\\miep product name && type d:\\miep > d:\\miep_";     system.out.println(cmd);      process p;     p = runtime.getruntime().exec(cmd);     p.getoutputstream().close();      string line;     bufferedreader stdout = new bufferedreader(new inputstreamreader(p.getinputstream()));     while ((line = stdout.readline()) != null) {         system.out.println(line);     }     stdout.close();     bufferedreader stderr = new bufferedreader(new inputstreamreader(p.geterrorstream()));     while ((line = stderr.readline()) != null) {         system.out.println(line);     }     stderr.close();      system.out.println("done"); } 

i tried converting stuff .csv files might have seen in second line of code , same: works in cmd, not in java-program..!

here keeps telling me it's invalid xsl-format

can help?


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -