I have understood you. You don't understood how windows applications work.
Normally if a windows application like UltraEdit opens a file with the File Open command (not drag and drop from Windows Explorer to UltraEdit) the application itself changes the current working directory to the directory where the file is stored. The current working directory FOR THIS APPLICATION is changed, not for any other application. You can't see that change of current working directory except you do following:
Open a file with File - Open.
Run Advanced - DOS Command with command
dir, nothing entered in the field for working directory and Show DOS Box checked. The DOS command dir is executed and the ouput is captured. At the captured text you will see in the first line, in which directory the dir was executed.
Close the window with captured text and open a second file with File - Open from a different directory.
Run again the DOS command dir and you will see at the first line in the captured output that the working directory has changed to the directory of the second file you opened.
Every application has it's own current working directory. This is a normal behaviour and often wanted. It is also described in the help of Ultraedit at the help topic for the 2 options I posted. Sentence from help:
Normally the directory used for the File Open command is the last directory that the editor opened a file from.
If you open a file with macro command Open you execute File - Open without showing the dialog. But like File - Open the current working directory is changed.
With
Use active file directory for file open dialog default this handling of the current working directory at file open (and only for file open) is overwritten. Now before opening the file open dialog, UltraEdit sets the current working directory to the directory of the file currently active and then opens the file open dialog.
With
Use default directory from shortcut on initial file open the
initial file open is done not in the directory of the last recent file saved in the INI but at the directory specified by the field
Start In at the properties of the (desktop or start menu) shortcut to UltraEdit. The "Start In" directory is the current working directory at starting a program. Some programs need that the working directory at start is identical with the program directory where the EXE is. So by default the "Start In" directory is set to the program directory during creation of a shortcut.
But for UltraEdit you can specify a different working directory at start of UltraEdit. With this option enabled, this directory becomes the working directory for initial file open. Initial means that if you start UltraEdit without opening a file (no file is specified at the command line) this directory will be used for the
first File - Open. But all following File - Open will use again the directory of the last opened file.
And what about MS Office applications? They don't use the current working directory for file open and file save but always use the same directory?
Yes, MS Office is different which I personally hate. It opens and saves new files always from/to a directory specified in the options for every Office application which is by default the "My Documents" directory but can be changed individually for every Office application to a different directory.
It seems that you want this handling also for UltraEdit. No problem. Turn off the 2 settings described above and open the configuration dialog for the
Directories. Specify a
Default Save Directory and a
Default Open Directory. Now at File - Open the current working directory is always set to the default open directory before showing the open dialog and at File - Save As the the current working directory is always set to the default save directory before showing the save dialog. Now you have exactly the same directory handling as MS Office applications always use.
But note, the current working directory for DOS commands like dir or Find In Files executed in the Directory
.\ still changes after every file open.
Edit on 2009-08-21: Since UE v12.20 (I think, but I'm not sure about the version) after opening a file with File - Open the current working directory is set always to the UltraEdit program directory. Why? For example some users unpacked an archive to a temp folder and opened one or more of the files in this temp folder in UltraEdit. After reading they closed the files in UltraEdit, but not UltraEdit itself. Next they wanted to delete the temp folder, but since NT4 Windows does not allow deleting a directory used by any application currently as working directory (Win9x does not have this limitation). That's the reason why UE changes the current working directory for itself after File - Open now always to the UE program directory.
What is the current working directory of an application can be watched for example by using
Process Explorer from
SysInternals. After starting Process Explorer click with secondary (right) mouse button on a running application and choose Properties. On the Image tab the "Current directory" of the application is displayed.