Renommer un disques (VBScript)

Le script suivant utilise la propriété VolumeName pour modifier le nom du lecteur (disque).


Code VisualBASIC ou VBA ou VBS (script vbs : ChNameDisk) (7 lignes) :
  1. Sub ChNameDisk dim objFSO, objDrive
  2.   Set objFSO = CreateObject("Scripting.FileSystemObject")
  3.   Set objDrive = objFSO.Drives ("C")
  4.   objDrive.VolumeName = "SYSTEM"
  5.   Set objFSO = Nothing
  6.   Set objDrive = Nothing
  7. End Sub

Contents Haut

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 11/06/2004, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/vbs-renommer-disque.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.