Hello Unai,
I am glad that uninstalling Agilent VISA and reinstalling NI-VISA took care of the issue, that was a tricky issue. You are correct that MAX just changes a IVI configuration file. It is called the IVIConfigurationStore.xml.
There is an API interface to the Configuration Server and here is a KB that talks about it and includes an example:http://digital.ni.com/public.nsf/allkb/F25F9B0E8DA4BB2386256DEF00729F81?OpenDocument
MAX always works great for me, so I have not used the Config Server API.
I
HIGHLY recommend that you continue to use MAX to change the IVI settings. Remember that you can create multiple IVI Driver Sessions if you have multiple instruments of the same type or want to have different configurations of the same instrument.
Cheers,
NathanT