Click here to Skip to main content
15,909,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to get a disc name that contains the system

What I have tried:

I want to get a disc name that contains the system
Posted
Updated 11-Nov-17 4:30am
v2
Comments
PIEBALDconsult 11-Nov-17 10:18am    
SystemDrive=C:
SystemRoot=C:\Windows
System.Environment.SystemDirectory
System.Environment.GetFolderPath Method (System.Environment.SpecialFolder)
kh medo 11-Nov-17 10:21am    
this code get full path
TextBox2.Text = Path.GetPathRoot(Environment.SystemDirectory)
i want only name parttion C OR D OR F OR E such as

1 solution

You can get it from the system environment variables, like SYSTEMDRIVE.
VB.NET
Dim drive As String = Environment.GetEnvironmentVariable("SYSTEMDRIVE")
 
Share this answer
 
Comments
kh medo 11-Nov-17 10:34am    
thank u my brother solved problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900