You can use WMI datafile for this. Note that the name requires escaping the slashes.
wmic datafile where name="C:\\windows\\system32\\kernel32.dll" get version
The result looks like:
Version
6.1.7601.18409
If you're trying to get file versions to figure out installed KBs, you can also use:
wmic qfe list
WMI also has built-in ability to run on remote machines.
wmic /node:otherhost /user:"domain\administrator" datafile where name="C:\\windows\\system32\\kernel32.dll" get version
You need to use your network administrator account or the machine's local administrator account. You can also pass in the password on the command line with /password:xyz
.