CVBUG.TXT Jan 24, 1987 This document contains a description of a CodeView bug/feature involving argv[0]. C programs compiled with Microsoft C Version 4.0 and executed under PC/MS DOS 3.0 or greater place a path-file_name pointer in argv[0] . The path-file_name string can be used to determine a path to the where the program resides (as oppossed to the currently selected directory). Remember this only works with DOS 3.0 or greater. For example, a program called "timecek.exe" which resides in directory C:\TEST\C\ would be envolked by setting a path to \TEST\C\ and typing "timecek". Argv[0] would point to the string containing C:\TEST\C\TIMECEK.EXE . Note , the string is all caps and the program name extension (.EXE) has been appended. Using CodeView to debug the above program, you would normally be "logged" to the C:\TEST\C directory and enter "cv timecek" . Displaying the string pointed to by argv[0] results in "timecek.exe". Note, no path, program name in lower case. If you are using argv[0] to determine the "home" directory you are lost. ACTUALLY, CodeView sets argv[0] to point to WHATEVER you enter as a filename.For example, Command Line *argv[0] cv TiMeCeK TiMeCeK.exe cv c:\test\c\timecek c:\test\c\timecek.exe cv C:\TEST\C\TIMECEK C:\TEST\C\TIMECEK.exe If you ignore the string case, you can "fake" CodeView to supply the same string that will be available when you run your program. I am not sure if MicrSoft intended such operation, but at least it is a bug/feature which can be "defeated" if desired . Dave Campbell Compuserve [74116,3324]