Where are the states of opened/closed folders saved in OS X? I have a windows-server that is accessed from a bunch of computers with OSX, in list mode, if anyone opens or closes a folder, that folder stays open for any other users. I would like all folders to always be closed on the server.

As the server is windows-based I assume finder is saving and reading this info from somewhere, maybe that setting can be changed in finder or that file be removed with a script on the server.
I presume you are referring to listing a folder using the disclosure triangle in list view:



The state of shown/hidden folders in list view of a specific folder is stored in Finder cache, as well as the folder's hidden .DS_Store.

.
├── .DS_Store
├── 1
│   └── hello.txt
...


You can reset a folder's folder disclosure triangle by running the following command inside the folder that you wish to reset:

rm .DS_Store &amp;&amp; killall -HUP Finder