Windowsで別のユーザーのAppDataフォルダを知る方法とか
-
PrincePOPI_
- 6453
- 0
- 0
- 0
![](https://s.togetter.com/static/web/img/placeholder.gif)
@aetos382 お、これはスマソ。http://www.atmarkit.co.jp/bbs/phpBB/viewtopic.php?topic=26390&forum=8
2010-08-24 02:21:09![](https://s.togetter.com/static/web/img/placeholder.gif)
@tyappi んで、Shell Folders の方はわざわざ「!Do not use this registry key」とか書いてあるんだけど、どうなの。 [TWNv950]
2010-08-24 02:25:50![](https://s.togetter.com/static/web/img/placeholder.gif)
@tyappi OSによってはないかもしれん。俺の環境(2008R2)では、Shell Folders 内にそういう名前のキーがあるよ [TWNv950]
2010-08-24 02:27:58![](https://s.togetter.com/static/web/img/placeholder.gif)
@aetos382 あ、registry ね。これがすべてじゃないの。Use the SHGetFolderPath or SHGetKnownFolderPath function instead
2010-08-24 02:28:08![](https://s.togetter.com/static/web/img/placeholder.gif)
@aetos382 そりゃそうだけど。使っているのは事実。API が利用できるならば当然利用すべき。でもできない場合は OS version independent 覚悟の上で使うしかないと思う。 RT @aetos382 無視していいとは思わんがね
2010-08-24 02:35:09![](https://s.togetter.com/static/web/img/placeholder.gif)
@aetos382 移動 profile を利用している場合 User Shell Folders は file server の path を示す。Shell Folders は local の cache を示す。
2010-08-24 02:40:15![](https://s.togetter.com/static/web/img/placeholder.gif)
@PrincePOPI Win32_UserProfileでProfileディレクトリまでは取得できました。緩く作るのであれば,自アカウントのディレクトリと比較して決定することで処理できそうです。厳密にやるのであれば,@aetos382 さんの方法になると思います。
2010-08-24 02:40:31![](https://s.togetter.com/static/web/img/placeholder.gif)
@aetos382 移動 user profile を利用している場合、log on 時に file server から user profile を load してきて local の cache を置き換える。
2010-08-24 02:41:50![](https://s.togetter.com/static/web/img/placeholder.gif)
@tyappi へぇ。ま、移動プロファイルなんてそうそう使ってないだろうし、そこを固定するのは OS 依存性を仮定するより固いと思うけれど。で、欲しいのはどっちのパスなのかにもよる [TWNv950]
2010-08-24 02:43:01![](https://s.togetter.com/static/web/img/placeholder.gif)
@aetos382 移動 user profile が利用できないような network 環境の場合、当然だけど local cache との sync は行われずに local cache の内容がそのまま使われる。
2010-08-24 02:44:52![](https://s.togetter.com/static/web/img/placeholder.gif)
@aetos382 Terminal Service 使っていれば移動 user profile を使うのが当たり前です。また、どの端末でも同じように使えるよう移動 user profile を採用しているところは結構な数が存在しますよ。
2010-08-24 02:48:00![](https://s.togetter.com/static/web/img/placeholder.gif)
@okadabasso ちょっと正確じゃないですね。それをいうなら aspx.cs とか aspx.vb とかをそのまま配置することが可能ですね。というか、.NET Framework 1.1 まではそれしか無かったですし。 #librahack
2010-08-24 02:54:19![](https://s.togetter.com/static/web/img/placeholder.gif)
@tyappi で、移動プロファイルを使っているとして、現在ログインしていないユーザーの APPDATA のローカルキャッシュをどうにかしたとしても、それは次回ログイン時に(ネットワークが切れてでもいない限りは)サーバーの値で上書きされちゃうので無意味では。 [TWNv950]
2010-08-24 02:57:27