Gygrunt, Welcome to the windows 7 forum.
Can it be assumed that the machine is presently connected to a domain? And are you an administrator on the domain?
if not, then it many cases it won't allow you to unjoin from the domain.
Other than that, when you say retain all files, do you mean data files for a userid on the local machine?
Some people just copy all the my documents and such to an external drive before unjoining from the domain and making sure
that you have an administrator account on the local machine or you might end up having to do a complete install of the version
of windows that the machine requires.
Rich