I know that you can specify SAS's work directory by adding arguments to the "target" line in the properties on the icon on the desktop, but that doesn't affect what happens if I double click a .sas file.
My basic problem is that when I open SAS by double clicking a .sas file, SAS opens and specifies the work library in the C:\, but I want it to be in the E:. I can't accomplish this by changing the user profile because I have over 50 users who each have their own sascfg file. Is there a way to change the default work library, ideally in the registry or something? I found the registry entry that controls the default action for when I double click a .sas file, it's in
HKEY_CLASSES_ROOT\SAS.Program.701\shell\Open\command
and the key is
"C:\Program Files\SASHome\SASFoundation\9.4\core\sasexe\sasoact.exe" action=Open datatype=SASFile filename="%1" progid=SAS.Application.940
Is there something that I could add to that to also specify the work folder? I've been messing around with this but I don't want to break something.
Thanks for your help
The SASOACT
executable is indeed used when someone doubleclicks on a .sas file (or other SAS system files) to let SAS figure out what to do to open it. It's probably not going to be a very helpful solution here, unfortunately, because it's not the sas.exe
itself, so you can't give it arguments to pass on to sas.exe
as far as I know.
Assuming I'm stating your core problem correctly - "How do I ensure all of my users have a consistent default work directory, when each one has a separate sasv9.cfg
file" - there is a better solution, though, that SAS specifically allows for.
You can "chain" cfg files together, which allows you to have both a "common" cfg and a "personalized" cfg file. You put the following line at the end of the config file:
-config "\\path\to\sasv9.cfg"
And then it will include that config file after it's processed the lines from the current one.
In your case, you should simply have the work folder specified in a common .cfg file (on the network somewhere), and then have them include a line referencing that .cfg file like above at the end of their config.
Note that if you put it at the end of the config, it will be replaced/removed when you install upgrades or some hotfixes; unfortunately, since SAS put the work folder location in the "core" config file section, you have to work with that (you can't just put the reference in the top "safe" section).