Skip to content

Commit

Permalink
PDFBOX-5660: replace deprecated
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1914678 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed Dec 15, 2023
1 parent 1e30bc1 commit 0888946
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ private String getWinDir(String osName) throws IOException
{
Process process;
Runtime runtime = Runtime.getRuntime();
String cmd;
if (osName.startsWith("Windows 9"))
{
process = runtime.exec("command.com /c echo %windir%");
cmd = "command.com";
}
else
{
process = runtime.exec("cmd.exe /c echo %windir%");
cmd = "cmd.exe";
}
String[] cmdArray = { cmd, "/c", "echo", "%windir%" };
process = runtime.exec(cmdArray);
try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(
process.getInputStream(), StandardCharsets.ISO_8859_1)))
{
Expand Down

0 comments on commit 0888946

Please sign in to comment.