Home > How-To Library > File/Folders Handling

How to find the name of the current directory

**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * ****************************************************************
'use the CurDir$ function. When this function is passed a drive letter, 'it returns the current directory on that particular path. 'Always use On Error--the current dir might be on a removed floppy disk. On Error Resume Next Print CurDir$ ' Displays "D:\VisStudio\VB98" ' The current directory on drive C: Print = CurDir$("c") ' Displays "C:\WinNT\System"

If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.