Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the root drive

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

Does anyone know how to get the root
drive from a given file?

For example:

From the file "myFile.txt"
which is at "C:\myDir\myFile.txt"
I want "C:\" to be returned.

Thank you.
 
Try this
u need first 3 char(left char) of the path
rotdrive=Left(pathtofile,3) ________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top