LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2010, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 1 Jun 2010 19:56:33 -0700
Reply-To:     Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Subject:      Re: Finding the desktop without knowledge of the path structure
Comments: To: Mark Miller <mdhmiller@GMAIL.COM>
In-Reply-To:  <AANLkTikDZBV5l7fh9MdVGzAkeGPteO7iH-XOtgDNdgi5@mail.gmail.com>
Content-Type: text/plain; charset=windows-1252

Interesting. But I don't see how I'd use "start shell:personal" to get the name of the Personal folder - it opens the folder, but doesn't seem to return the name of the folder.

-- Jack Hamilton jfh@alumni.stanford.org Caelum non animum mutant qui trans mare currunt.

On Jun 1, 2010, at 19:37 , Mark Miller wrote:

> It does seem that CSIDL variables are only accessible as such from API calls > > althougn many non-MS languages include such facilities. > > Apparently to use them at prompts, you need to use the *shell: *command > which essentially is > a prefix to the Special Folder name. > see for example > http://www.winhelponline.com/blog/shell-commands-to-access-the-special-folders/ > > > The *shell:* command can be used to open a special folder directly from the > Start, Search menu or from the Run dialog. For example, the command * > shell:sendto* opens the SendTo folder (%userprofile%\sendto) of your user > profile. To launch the Documents folder of your user profile, you’d type * > shell:Personal*. Below is a complete *shell:* commands listing for Windows > 7/XP/Vista. The entire listing is stored in the following registry key in > Windows 7 & Vista: > HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ > explorer \ FolderDescriptions > > ... Mark Miller > > > On Tue, Jun 1, 2010 at 9:27 PM, Jack Hamilton <jfh@stanfordalumni.org>wrote: > > >> That's a list of possible values, but where can I use them besides in >> Windows API calls and the FILENAME statement (and maybe the LIBNAME >> statement)? >> >> The shell command >> >> cd ?CSIDL_DESKTOPDIRECTORY >> >> doesn't switch to the desktop directory, so it doesn't appear that the >> CSIDL "variables" can occur anywhere a directory name can occur. >> >> >> -- >> Jack Hamilton >> jfh@alumni.stanford.org >> Caelum non animum mutant qui trans mare currunt. >> >> >> >> >> >> On Jun 1, 2010, at 17:50 , Arthur Tabachneck wrote: >> >>> Jack, >>> >>> I obviously don't know where data_null_ discovered it, but you can get >> all >>> of the relevant info at: >>> http://msdn.microsoft.com/en-us/library/bb762494(VS.85).aspx >>> >>> HTH, >>> Art >>> --------- >>> On Tue, 1 Jun 2010 17:10:44 -0700, Jack Hamilton <jfh@STANFORDALUMNI.ORG >>> >>> wrote: >>> >>>> Indeed, and very interesting. How did you find this? It's not >>> documented anywhere I can find, although there a few examples in the >> usage >>> notes. >>>> >>>> >>>> -- >>>> Jack Hamilton >>>> jfh@alumni.stanford.org >>>> Caelum non animum mutant qui trans mare currunt. >>>> >>>> >>>> >>>> >>>> On Jun 1, 2010, at 9:33 , Data _null_; wrote: >>>> >>>>> You can also use the CSIDL variables in a FILENAME/LIBNAME statement. >>>>> >>>>> filename FT55F001 '?CSIDL_DESKTOPDIRECTORY'; >>>>> filename FT55F001 list; >>>>> >>>>> >>>>> %let DESKTOP=%sysfunc(pathname(FT55F001)); >>>>> %put NOTE: DESKTOP=&desktop; >>>>> >>>>> On 6/1/10, Jack Hamilton <jfh@stanfordalumni.org> wrote: >>>>>> It appears from the pathname that you're running under Windows (though >>> you should get into the habit of including that information when you ask >> a >>> question). >>>>>> >>>>>> I'd use the MODULEN and MODULEC functions to get that information from >>> the Windows registry (GetFolderPath API with the CSIDL_DESKTOPDIRECTORY >>> parameter). See: >>>>>> >>>>>> http://www.devenezia.com/downloads/sas/sascbtbl/ >>>>>> >>>>>> http://www.perlmonks.org/?node_id=343554 >>>>>> >>>>>> >>>>>> Google will find other references to the MODULEx functions and the >>> Windows API. >>>>>> >>>>>> The second reference says that the Desktop location is contained in >>> the environment variable USERPROFILE. In another message, Michael >> Raithel >>> suggests using a fixed path with the &SYSUSERID macro variable. Either >> of >>> those suggestions will work (perhaps best in combination) in many cases. >>> They won't work if you have changed your Desktop location, which is easy >>> to do if you know how to do it (Microsoft provides a utility). Given >> that >>> your users can't even type in path names, they probably haven't changed >>> their desktop locations, but keep in mind that if you give your program >> to >>> enough people it will eventually reach someone who knows how to customize >>> Windows. >>>>>> >>>>>> >>>>>> -- >>>>>> Jack Hamilton >>>>>> jfh@alumni.stanford.org >>>>>> Caelum non animum mutant qui trans mare currunt. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Jun 1, 2010, at 6:14 , Michael A McDaniel/AC/VCU wrote: >>>>>> >>>>>>> I have a SAS macro that reads data from a file with a specific path >>> and writes output to a file with a specific path. Different users of the >>> macro have different path structures. For example, Manny?s desktop might >>> be ?C:\Users\Manny\Desktop? while Bob?s desktop might be ?C:\Users\Bob >>> Smith\Desktop?. I currently require the user to specify the path to a >>> folder where files reside. This often causes errors because users don?t >>> know how to specify a path. Is there a way to specify the computer >> desktop >>> as the directory without knowing the path? >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Mike McDaniel >>>>>>> >>>>>>> >>>>>>> >>>>>> >> >>


Back to: Top of message | Previous page | Main SAS-L page