From: hatespyware@... (anon luker) Date: 2004-02-28T22:54:47+09:00 Subject: Re: Profile-independent directory specification for NT? If you want a profile _independent_ path, then just use an absolute pathname. I think that you want a profile _dependent_ path. The most correct way to get one is with WMI. You will have to peruse the sdk docs to determine the correct way of finding this pathname for your network setup, though. A slightly simpler method that you might try: require 'win32ole' wsh = WIN32OLE.new("WScript.Shell") desktop = wsh.SpecialFolders("Desktop") puts "desktop = '#{desktop}'" This assumes wsh availability (present if you use vba on this machine). If you come from a vba background, you should probably get ArtonX's excellent activerubyscript package from http://www.geocities.co.jp/SiliconValley-PaloAlto/9251/ruby/main.html .. It has a wsh<->ruby bridge that lets you use ruby via wsh in ie, iis, word, and wherever else you would normally use vba. It should also lower the bar for translating vba to ruby. It is a shame that the base windows installs don't provide this functionality, since it is de rigour for all modern scripting languages (I could be wrong about its inclusion, but http://rubyinstaller.sourceforge.net tells you to look at http://rubygarden.org/ruby?WindowsInstaller for a manifest and vice-versa and I don't have the patience for such nonsense). "Moran, Craig M (BAH)" wrote in message news:... > Is there a way to specify a directory in Ruby that is profile-independent > for the Windows NT variants? For example, if I wanted to do this in VBA for > the currently logged in user's My Documents folder, it would look like this: > ProfilePath = Environ("USERPROFILE") & "\My Documents\" > This way, regardless of who is logged in and runs the script, it will always > point to their own My Documents folder. Thanks in advance for the help- > Craig