How can I determine in Windows whether a program is installed per-machine or per-user from the command line? I am mainly concerned about Windows 7.
There is no simple way to detect this. The only difference between "per-machine" and "per-user" is if the program saves its settings in a place that is unique per user (
HKEY_LOCAL_USER in the registry and the
%LOCALAPPDATA% folder in the filesystem) or shared among all users (
HKEY_LOCAL_MACHINE in the registry and
%PROGRAMDATA% in the filesystem)
All that is internal and custom to every program ever written and there is no generic "flag" you could read somewhere that could tell you which method a program is using.
If you want to know if a specific program is installed as per-user or per-machine, open a new question and be sure to include the details of which program you want to know about.