Format Drive

Hi all,

How can I format a disk from FB ?

Thanks, Guy.

Hi Guy,

You can use the following VBScript to format a volume from FinalBuilder.

strComputer = “.”
strDrive = “J:”

Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}!\” & strComputer & “\root\cimv2”)

Set colVolumesList = objWMIService.ExecQuery _
(“Select * from Win32_Volume Where DriveLetter = '” & strDrive & “’”)

For Each objVolume in colVolumesList
objVolume.Format “NTFS”, true
Next

You’ll just need to update the strDrive variable to reflect the drive you want to format.

Regards,
Paul.