Determine the hard drive name using VBA

Tessel75 -  
 Tessel75 -
Hello,
How to determine the current hard drive name with VBA?
I have been struggling in the developer assistant for a while between the ""Dir(CurrentFile)", "Path(CurrentFile)", "Drive(CurrentFile)". But the explanations from MS are really not clear or simple, and I'm not managing to figure it out.
I need such a formula to automatically change the hard drive name because my company has changed all the computers in the department, and at the same time switched to Windows 7, and instead of keeping the usual names ""C:", ""D:", etc., the names are individualized for each machine of each user, in the form of ""D54321:", ""D98765:". Now I have a large number of macros containing predefined save procedures, and I want to distribute my macros to my colleagues. For that, I would need a generic naming for the hard drive (for example "D_Racine:") and the ability to replace this generic name with the real name of the hard drive of each machine when the procedure commands the saving of the considered file.
Thank you for sharing your knowledge.

Configuration: Windows 7 / Chrome 35.0.1916.153

2 answers

eriiic Posted messages 24581 Registration date   Status Contributor Last intervention   7 281
 
Hello,

https://codes-sources.commentcamarche.net/source/62580-recuperer-le-nom-attribue-a-un-lecteur-disque-cle-etc
eric

--
By continuously trying, one ends up succeeding.
So the more it fails, the more chances we have for it to work. (the Shadoks)
In addition to thanking (yes, it’s done!!!), remember to mark it as resolved. Thank you
0
Tessel75
 
Thank you Eric,
I will look at this code tomorrow.
0