I am trying to write a VB script to do an unattended quick format of a drive. I can get the format box to appear but i can't get it to autostart and complete. Ideally I just want a message to say that its done. Listed below is the code i have used
Private Declare Function SHFormatDrive Lib "Shell32.dll" (ByVal hWnd As Long, _
ByVal Drive As Integer, ByVal fmtID As Integer, ByVal Options As Integer) _
Private Sub Command1_Click()
Dim ret As Long
ret = SHFormatDrive(hMainWnd, 6, -1, 1)
Does anyone have any ideas? I would also like to be able to specify a volume name?