3
votes
Vote UpVote

Change the drive letter using WMI and Delphi

The Road to Delphi – Today i will show a short snippet to change the letter from a drive (Volume) using the WMI. the key is use the Win32_Volume class and set the value of the DriveLetter property. this property is read/write so we can update directly the value and then call the Put_ method of the SWbemObject object. check this sample project program ChangeVolumeLetter_WMI; {$APPTYPE CONSOLE} uses SysUtils, ActiveX, ComObj; procedure ChangeDriveLetter(OldDrive,NewDrive:Char); var FSWbemLocator : OLEVariant; FWMIService : OLEVariant; FWbemObjectSet: OLEVariant; FWbemObject : OLEVariant; ...
Favorite? Off-Topic? Rodrigo @ 2011-02-25 23:33

Statistics

Visits: 529
Votes: 3
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Horbs
Ph. B.
Yogi Yang
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)