On Windows 7 (and later) the process will have to run with elevated privileges to write to C:/Windows
and similar directories. But if that was the problem it would result in a different error message.
What I suspect:
When running a 32-bit JVM under 64-bit Windows new File("C:/Windows/System32")
will point to C:\Windows\SysWOW64
and there is no info
-Folder under C:\Windows\SysWOW64\oobe
As a test:
public static void main(String[] args) {
File sysdir = new File("C:/Windows/System32/oobe/info");
for(File file:sysdir.listFiles()) {
System.out.println(file.getName());
}
}
runs fine with 64-bit-JRE and throws NullPointerException
under 32-bit-JRE on Windows 7 64-bit.
So perhaps you or another application recently installed a 32-bit-jre or changed your path to point to a 32-bit-jre and thus broke your application.