You could either use Powershell or VBScript to call the appropriate Windows API functions. If you do not want to mess with scripting, you could use a third-party utility like qres/resswitch 

GPO/Script setting screen Resolution to all domain
So, here are two ways you might set things up such that \dostuff is done when foo is false.

The "new conditional" method

If you know when foo is going to be set, then after that do:

\newif\ifnotfoo
\iffoo\notfoofalse\else\notfootrue\fi


And then use the \ifnotfoo test.

\ifnotfoo\dostuff\fi


The "else" method

Whenever you need to \dostuff, just do:

\iffoo\else\dostuff\fi


Is either method recommended over the other? If so, why? (Or is there another method which is even better?
